Newbie hjælp til file upload script
Hi RødderJeg er lige begyndt på PHP, så jeg har lige lidt som driller..
Det her script skulle jeg meget gerne bruge som file upload, men deeet virker sku ikke helt, når man trykker upload står den godt nok og tygger på det, men der sker ikke rigtig noget, kan i hjælpåe mig med at udfylder stien til hvor min upload mappe ligger??
jeg kører win2000 server..
mappen ligger i C:/Inetpub/wargame/test/upload/
<?
/* Easy Uploader */
// set variables (SET THESE TO SUIT YOUR CIRCUMSTANCES):
// Upload directory (MUST HAVE TRAILING SLASH):
$uploaddir="/Inetpub/wargame/test/upload/";
// Your email
$youremail="thomas@elsgaard.dk";
// Thank you page:
$thankspage="http://www.wargame.dk/test/thanks.htm";
// Set Upload thanks message for USER
$uptymessage="$realname, thank you for uploading the file $file_name\n\nWe will get back to you ASAP.";
// Set Upload thanks message for OWNER
$ownermessage="$realname [ $email ] has uploaded a file named $file_name\n\nCheck the upload directory.";
// Email message on or off ? 1 = on, 0 = off
$emailmessages = "1";
// start code (DO NOT CHANGE ANYTHING BELOW THIS LINE):
// Check for valid email address
$x = ereg("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$email);
if($x==0)
// if no valid email address entered, display no email message
{
echo "<div align=center>You <b>must</b> specify a valid email address for yourself. <a href=java script:history.back(-1)>Return to the form</a>.</div>";
}
else {
// Check to see if valid file
if ($file == "none") {
// if no valid email address entered, display no file message
echo "<div align=center>You <b>must</b> specify a file to upload. <a href=java script:history.back(-1)>Return to the form</a>.</div>";
}
else {
//directory to upload to
copy($file, $uploaddir.$file_name);
unlink($file);
//return thank you page
Header("Location: $thankspage");
}
}
if ($emailmessages == "1") {
//mail you to let you know a new uploaded file
mail("$youremail", "Uploaded file", "$ownermessage");
//mail user to thank them
mail("$email", "Uploaded file", "$uptymessage");
exit;
}
?>
