Doh004
Thu 18th Dec '03, 1:55pm
Hello there. I am new to php and I have written a php upload script. Everything works fine but I don't know howto have a link that has the url to the file that the user just uploaded.
Here's what I have so far:
<html>
<head>
<title>File Uploaded!
</title>
</head>
<body>
<?php
if ( ($_FILES['uploadedfile']['type'] == 'text/html') ||
($_FILES['uploadedfile']['size'] >= 100000) )
{
echo 'Sorry but the file you tried to upload was either the wrong file format or was over 100KB. <a href="<A href="http://www.dohgames.com/phptest/upload.html">Click Here to try and upload again.</a>';
}
else
{
copy($HTTP_POST_FILES['uploadedfile']['tmp_name'],
$HTTP_POST_FILES['uploadedfile']['name']);
echo 'Thank you for uploading your file!';
echo 'Click Here to view the file you have just uploaded.';
}
?>
</body>
</html>
I really want the link to be displayed inbetween those last two echos. Please help.
Thankyou :)
Here's what I have so far:
<html>
<head>
<title>File Uploaded!
</title>
</head>
<body>
<?php
if ( ($_FILES['uploadedfile']['type'] == 'text/html') ||
($_FILES['uploadedfile']['size'] >= 100000) )
{
echo 'Sorry but the file you tried to upload was either the wrong file format or was over 100KB. <a href="<A href="http://www.dohgames.com/phptest/upload.html">Click Here to try and upload again.</a>';
}
else
{
copy($HTTP_POST_FILES['uploadedfile']['tmp_name'],
$HTTP_POST_FILES['uploadedfile']['name']);
echo 'Thank you for uploading your file!';
echo 'Click Here to view the file you have just uploaded.';
}
?>
</body>
</html>
I really want the link to be displayed inbetween those last two echos. Please help.
Thankyou :)