Jump to content

Recommended Posts

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: Aidan

Have 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?

Link to comment
https://forums.phpfreaks.com/topic/286075-php-mysql-code-not-getting-images/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.