andrew_biggart Posted April 12, 2010 Share Posted April 12, 2010 Ok I have a form which is only displayed when ever the user is logged in, I want a profile thumb beside the form and for some reason the image is not being displayed even though the same piece of code works on other bits of the site, is there something interfering with the code? <form method="post" action="forum_comment.php?Post_id=<?php echo $post_id; ?>"> <?php // close connection mysql_close(); ?> <?php $username=$_SESSION['myusername']; include("config.php"); // Retrieve data from database $sql="SELECT Profile_picture FROM biggartfp9_user_infot Where Username = '$username' " ; $result=mysql_query($sql); $row = mysql_fetch_array($result); $profile_picture = $row['Profile_picture']; if(isset($_SESSION['myusername'])) { echo " <table cellpadding='0' cellspacing='0' class='acc_status_table'> <tr> <td class='forum_ad'>Add a Comment</td> </tr> <tr> <td class='acc_status_feed'> <table> <tr> <td> <table cellpadding='0' cellspacing='0'> <tr> <td class='forum_view_cat' style='width: 50px' valign='top'></td> <td class='forum_comments_wrapper'> <table style='width: 100%'> <tr> <td class='forum_reply' colspan='2'>Reply ?</td> </tr> <tr> <td class='forum_comments_comment' colspan='2'> <textarea class='forum_reply_text'cols='20' name='replycomment' rows='2'></textarea> </td> </tr> <tr> <td class='forum_reply_max'>Max 2000 Characters</td> <td class='forum_reply_input'><input class='forum_reply_submit' name='Submit1' type='submit' value='Post Reply' /></td> </tr> </table> </td> <td class='forum_comments_spacer'> </td> <td class='forum_view_pic' style='width: 50px' valign='top'> <img src='../Profile_pics/". $Profile_picture ."' style='width:50px;' /> </td> </tr> </table> <br /> </td> </tr> </table> </td> </tr> </table> "; } else{ } ?> </form> Quote Link to comment Share on other sites More sharing options...
Jax2 Posted April 12, 2010 Share Posted April 12, 2010 Well, you're defining profile_picture and then calling Profile_picture ... won't work like that Quote Link to comment Share on other sites More sharing options...
Jax2 Posted April 12, 2010 Share Posted April 12, 2010 It's usually a good idea, during development, to put this at the top of every page: ini_set('display_errors',1); error_reporting(E_ALL); it will catch stuff like that and tell you about it. Quote Link to comment Share on other sites More sharing options...
andrew_biggart Posted April 12, 2010 Author Share Posted April 12, 2010 Thank you I will use your advise! I had been staring at it so long I couldn't spot that... Just needed a fresh pair of eyes so thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.