Ok, im really new to PHP, so this might be a really simple fix...
But what im wanting to do, is have a person upload a file and put their name in a form, that would post to "submit.php" That page would then create a new folder based on their name, and then put the uploaded file into that folder. When I try this code, it just gives me this error:
Warning: mkdir() [function.mkdir]: File exists in /home/vasarine/public_html/apply/submit.php on line 17
and puts the uploaded file into the "demos" folder
Any ideas?
O, and btw, I know the $target_path isnt used anywhere. Its just something I forgot to take out
But what im wanting to do, is have a person upload a file and put their name in a form, that would post to "submit.php" That page would then create a new folder based on their name, and then put the uploaded file into that folder. When I try this code, it just gives me this error:
Warning: mkdir() [function.mkdir]: File exists in /home/vasarine/public_html/apply/submit.php on line 17
and puts the uploaded file into the "demos" folder
Code:
<?php
$name=$_GET['name'];
$email=$_GET['email'];
$uploadedfile=$_GET['uploadedfile'];
$url=$_GET['url'];
$target_path = "demos/";
$address="apply@vasarinet.com";
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
mkdir("/home/vasarine/public_html/apply/demos/" . $name . "/");
move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],"/home/vasarine/public_html/apply/demos/" . $name . "/" . $_FILES["uploadedfile"]["name"]);
}
?>
Any ideas?
O, and btw, I know the $target_path isnt used anywhere. Its just something I forgot to take out