AidanPT Posted February 9, 2014 Share Posted February 9, 2014 Hi, I posted a question a few days ago asking about this topic but since then I have encounted a few errors and changed the code. I am creating a website with a database that lets the user sign up, change details, etc... I am currently having issues letting the user have a profile image. I sorted a form which can be used to upload an image to a file on the website and then send the image name to the database to be recalled later. Uploading is all fine, name works and everything, the problem is recalling it back doesn't seem to work. I have tried a lot of codes, with the code below, I am able to recall the users first name and see that, but the photo will not work? If anybody has any ideas, could you please help me out? I am pretty new to this code so would appriciate it if you explained and helped in simple terms. Thanks! <?php session_start(); Echo "<".$_SESSION['photo'] ."> <br>"; Echo "<b>Name:</b> ".$_SESSION['first_name'] . "<br> "; ?> This comes up like this:<>Name: AidanHave tried this as well... <?php session_start(); Echo "<img src 'http://basecentre.co.uk/user_bc_74hw438eryer90reh0e9rh83232_members/upload/".$_SESSION['photo'] ."> <br>"; Echo "<b>Name:</b> ".$_SESSION['first_name'] . "<br> "; ?> which comes up like this: "broken photo icon"Name: Aidan The name seems to work fine, it's getting the image to come up correctly or at all? Quote Link to comment https://forums.phpfreaks.com/topic/286075-php-mysql-code-not-getting-images/ Share on other sites More sharing options...
requinix Posted February 9, 2014 Share Posted February 9, 2014 The photo isn't set in there. The problem is in the place where you try to set it, not where you try to use it. Quote Link to comment https://forums.phpfreaks.com/topic/286075-php-mysql-code-not-getting-images/#findComment-1468334 Share on other sites More sharing options...
AidanPT Posted February 9, 2014 Author Share Posted February 9, 2014 Sorry I don't get what you mean, could you elabourate please?Cheers, Aidan. Quote Link to comment https://forums.phpfreaks.com/topic/286075-php-mysql-code-not-getting-images/#findComment-1468335 Share on other sites More sharing options...
requinix Posted February 10, 2014 Share Posted February 10, 2014 $_SESSION['photo'] is empty, right? So where's the code where you set it? Quote Link to comment https://forums.phpfreaks.com/topic/286075-php-mysql-code-not-getting-images/#findComment-1468408 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.