...

View Full Version : default image not working?



runnerjp
05-17-2008, 03:29 PM
<?php $q = mysql_query($sql) or die("Error running query:".mysql_error());
if($q && mysql_num_rows($q) > 0) {
$row = mysql_fetch_array($q);
if(!empty($row)) {
echo "<img src='http://www.members/images/thumbs/". $pid . "." . $row['ext'] . "'";
}
else {
echo "<img src='http://www./members/images/thumbs/big.jpg";
}
}
?>

my image for echo "<img src='http://www./members/images/thumbs/". $pid . "." . $row['ext'] . "'"; will display if the users has an image uploaded but if not it displays nothing when it should echo echo "<img src='http://www./members/images/thumbs/big.jpg"; ??

jaap
05-19-2008, 09:17 PM
Besides you're using a "." after your "www" , you're not closing your img tag. Try this:


echo '<img src="http://www./members/images/thumbs/big.jpg" /> ';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum