Jump to content
php.lv forumi

user image


Snaip3Rs

Recommended Posts

Viss ar karotīti jādod.

 

Tavs skripts:

<?php include "base.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>Profils</title>
</head>  
<body>
<?php
session_start();
$query  = "SELECT id, Username, Imgurl FROM users";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
   echo "ID :{$row['id']} <br>" .
        "Lietotājvards : {$row['Username']} <br>" .
        "Bildes url : {$row['Imgurl']} <br><br>";
} 
?>
</body>
</html>

 

Pamaini

Bildes url : {$row['Imgurl']} <br><br>

uz

<img src="{$row['Imgurl']}" alt="Bilde" />

Pārsteidzošā kartā bilde parādās!!!!

 

Cik noprotu, tad tavs pašreizējais projekts nav nekas nopietns, tādēl neteikšu ka būtu īpaša jēga informāciju likt sessijās utt. Vienkārši pie katras bildes izvades lapas sākuma pieliec SQL konjekciju un vietā kur gribi bildi ieliec

$query  = "SELECT Imgurl FROM users";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<img src="{$row['Imgurl']}" alt="Bilde" />";
}

Link to comment
Share on other sites

Nekas vienkāršāks nevar būt par šo te?

<img src="<?php
 session_start();
$query  = "SELECT id, Username, Imgurl FROM users";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
   echo "{$row['Imgurl']}";
} 
?>" /> 

 

m8t Ir tāda lieta ka neuzrādās!

Link to comment
Share on other sites

Tāpat iet jo pārbaudiju vairākos veidos, bet negāja un atcerējos ka php skriptu ar varēja likt image tagos ne tikai tur vienu daļu! Es uzzināju ka ar šo vien nepietiks

<?php
echo "Bildes url : {$row['Imgurl']} <br><br>";
?>

Un pamanīju ka neizvada bildes linku tad izdomāju visu lieko lai nemaisa izdzēsīšu un atstāšu tikai linku un pielikšu klāt image un vis sanāca!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...