View Full Version : image upload form

11-06-2006, 05:06 AM
OK so I am using this code to sorta make a small image host for me and my friends but its acting up........to start, here is my code


$file_path = $_FILES['fild']['tmp_name'];
$file_name = $_FILES['fild']['name'];
$file_size = $_FILES['fild']['size'];
$file_type = $_FILES['fild']['type'];
$file_error = $_FILES['fild']['error'];

copy($file_path, $file_name) or die('There was an error while uploading your file. Please try again.');
echo('Your file has been uploaded.<br>Thank you!');
echo ("<br>The URL is: rxrowley.6te.net/1/".$_FILES['fild']['name']);

<form method="post" enctype="multipart/form-data">
<input TYPE="file" name="fild">
<input name="submit" type="submit" value="Upload" />

So, The image will upload just fine, but when I try to put in the URL, it does not work, the only way I can get the image to display is by making a link from a page.....hmmmm.......any takers?

11-06-2006, 05:43 AM
I guess what im trying to do is in the echo that says the URL is.... to make it a link to the file, I just cant figure out how to write the code for a link in php

11-06-2006, 09:27 AM
You don't need to put the echo statement in brackets. Also are you absolutely certain that the folder called '1' that is where the images are stored has read permissions set?