Jump to content

Uploaded picture display


jackie11

Recommended Posts

Hi all

I was trying to get a picture uploaded from a form and then to display in a table, which I finally managed to get working perfectly, but I have made a change (by accident) to the code that displays the picture and now the picture will not display and I can't manage to get it working again, really can't fingure out what I have done, its probably something really simple, I have tried re-arranging the code a number of different ways but I can't remember how I had it set up previously, (it really does teach me that I should make a back-up copy when things are working)

Any suggestions

Thanks

Jackie

[code]

<?php $Employee_ID = $_POST['Employee_ID'];
$Surname = $_POST['Surname'];
$Forename = $_POST['Forename'];
$Job_title = $_POST['Job_title'];
$Office_location = $_POST['Office_location'];
$Telephone = $_POST['Telephone'];
$Email = $_POST['Email'];
$Expertise = $_POST['Expertise'];
$Hobbies = $_POST['Hobbies'];
$DOB = $_POST['DOB'];


$target_path = "../page_g/etc/";
$target_path = $target_path . basename( $_FILES['Picture']['name']);

if(move_uploaded_file($_FILES['Picture']['tmp_name'],
$target_path)) {echo "";
} else{
    echo "There was an error uploading your picture file, please try again!";
}
       
?>

<table align="center" cellspacing="15">

  <tbody>

    <tr>

<td style="text-align: center"; <a href='../page_g/etc/{$target_path['basename']}' border='0'>
      <img src= <?php echo= $target_path ?> picture="" border="0" height="100" width="90"></a></td>
<td style="text-align: center;"></td>
    </tr>

  </tbody>
</table>


[/code]
Link to comment
https://forums.phpfreaks.com/topic/35233-uploaded-picture-display/
Share on other sites

Try changing this:
[code]<img src= <?php echo= $target_path ?> picture="" border="0" height="100" width="90">[/code]

To this:
[code]<img src="<?php echo $target_path; ?>" picture="" border="0" height="100" width="90">[/code]

Also, this code doesn't look correct...
[code]<a href='../page_g/etc/{$target_path['basename']}[/code]
as $target_path is not an array.

Regards
Huggie

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.