jackie11 Posted January 22, 2007 Share Posted January 22, 2007 Hi allI 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 suggestionsThanksJackie[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] Quote Link to comment https://forums.phpfreaks.com/topic/35233-uploaded-picture-display/ Share on other sites More sharing options...
HuggieBear Posted January 22, 2007 Share Posted January 22, 2007 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.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/35233-uploaded-picture-display/#findComment-166400 Share on other sites More sharing options...
jackie11 Posted January 22, 2007 Author Share Posted January 22, 2007 HiThanks that works great!Jackie Quote Link to comment https://forums.phpfreaks.com/topic/35233-uploaded-picture-display/#findComment-166413 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.