Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts

    default image not working?

    PHP Code:

    <?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"; ??

  • #2
    New Coder
    Join Date
    Aug 2005
    Location
    Groningen, Netherlands
    Posts
    57
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Besides you're using a "." after your "www" , you're not closing your img tag. Try this:
    PHP Code:
    echo '<img src="http://www./members/images/thumbs/big.jpg" /> '


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •