PDA

View Full Version : Probably an easy php question


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 :)

Doh004
Fri 19th Dec '03, 10:50am
Please people I would really like to know howto do this. Thanks

Steve Machol
Fri 19th Dec '03, 1:33pm
Are you a vB customer? This really isn't a PHP support forum.

Doh004
Fri 19th Dec '03, 2:18pm
No but I will be in feburary. Once I learn more php then I will upgrade my websites forums to vB. Please answer.

Steve Machol
Fri 19th Dec '03, 2:53pm
These forums are for vB customer support. If someone wants to help a non-vB customer then they can. However this is not a PHP support forum and you'd probably be better off posting on one that specializes in PHP coding.

Shane
Sun 21st Dec '03, 4:01am
Where does it get stored? I think that is the missing piece to why know one has replied :)