Jump to content

PHP MySQL code not getting images?


AidanPT

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.