Jump to content

help plz


DayDreamer16

Recommended Posts

I keep getting a php error in line 6, when I try to upload an image with this code.

 

<?php
$imagename = $_FILES['image']['name'];

copy($_FILES['image']['tmp_name'], "./images/$imagename");

echo "Your image has been uploaded and can be viewed here: <br>";
echo "http://www.yoursite.com/images/$imagename <hr>";
echo "<b>Preview:</b><br><img src='./hostedimages/$imagename'>";
?>

Link to comment
https://forums.phpfreaks.com/topic/208269-help-plz/
Share on other sites

Warning: copy(./upload/header.png) [function.copy]: failed to open stream: No such file or directory in /home/a2818626/public_html/upload/upload.php  on line 6

Your image has been uploaded and can be viewed here:

http://deathdreamer16.site11.com/upload/header.png

 

or just test it here

http://deathdreamer16.site11.com/upload/index.html

Link to comment
https://forums.phpfreaks.com/topic/208269-help-plz/#findComment-1088824
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.