Tiruak Posted June 20, 2010 Share Posted June 20, 2010 Hello there, I've tried everything I can possible think of, and don't seem to get this to work. Once again, I'm new to php I have a database where I upload the user picture. I can get my form to upload and store the image on the database together with my user info. So now, when I try to echo the picture on my user profile, it just shows a bunch of invalid characters, probably due to a header problem. Now, maybe I'm missing the point here, but as far as I've learned, I need to call a header at the beginning of my script, before any html is displayed. But, if I do use something like // header('Content-type: image/jpg'); // at the beginning of my page, it actually makes all my page mess up, and still doesn't show the image. I'm contacting the database correctly, selecting the right user, storing all his info into my array, and trying to display the $user['usr_photo'] of my array. I appreciate any help. Quote Link to comment Share on other sites More sharing options...
Tiruak Posted June 20, 2010 Author Share Posted June 20, 2010 Can't edit anymore: Here is what I'm trying to do (the code is just an example, of course): <?php require_once("../includes/connection.php"); ?> <?php require_once("../includes/functions.php"); ?> <?php // header('Content-type: image/jpeg'); $sel_arb = get_arbitro_by_id($_GET['arb']); //echo $sel_arb['arb_photo']; ?> <html> <head> <title>The title is this</title> </head> <body> <table width=50%> <tr> <td>Name is <?php echo $sel_arb['arb_nome'];?></td> <td><?php echo $sel_arb['arb_photo'];?></td> </tr> </table> </body> </html> <?php require("../includes/footer.php"); ?> Quote Link to comment Share on other sites More sharing options...
thewooleymammoth Posted June 20, 2010 Share Posted June 20, 2010 did you try this http://www.phpriot.com/articles/images-in-mysql/8 ? Quote Link to comment Share on other sites More sharing options...
Tiruak Posted June 20, 2010 Author Share Posted June 20, 2010 did you try this http://www.phpriot.com/articles/images-in-mysql/8 ? I will give it another shot... I guess I need to stop cheering for Brazil in the world cup and close the door to concentrate. 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.