pajoo Posted December 15, 2011 Share Posted December 15, 2011 In my registration you must upload a picture of yourself but it doesnt work. Any help please? <?php include ("includes/session.php"); include ("includes/dbconnect.php"); include ("includes/functions.php"); $currID = $_SESSION['oppid']; $query = mysql_query("SELECT img_name, img_size, img_type, img_content FROM testpassers WHERE id='{$currID}' ", $connection); $row = mysql_fetch_assoc($query); $imagebytes = $row['img_content']; $img_type = $row['img_type']; if($img_type == "image/jpeg") { header('Content-type: image/jpeg'); } else if ($img_type == "image/jpg") { header('Content-type: image/jpg'); } else if ($img_type == "image/png") { header('Content-type: image/png'); } else if ($img_type == "image/gif") { header('Content-type: image/gif'); } echo $imagebytes; ?> Thanks! Quote Link to comment Share on other sites More sharing options...
kickstart Posted December 15, 2011 Share Posted December 15, 2011 Hi I would guess that something is being output before the image. Possibly an error message, possibly a line feed from a blank line before your first <?php tag. All the best Keith Quote Link to comment Share on other sites More sharing options...
awjudd Posted December 17, 2011 Share Posted December 17, 2011 Can you also include the script where you store the image into the database because it could be breaking there. ~awjudd Quote Link to comment Share on other sites More sharing options...
fenway Posted December 19, 2011 Share Posted December 19, 2011 First, you're talking about adding a picture, and you've shown a select. Second, any issue with your php code doesn't really belong in a MySQL forum. 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.