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
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
Link to comment
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.