HI i am new in php and i have a problem whenever i write some php codes and execute them.
Example:
<?
if($File){
print("$File_name\n");
if(copy($File,"users/$File_name")){
print("Successful\n");}else
{
print("not successful\n");
}
unlink($File);
}
print("upload file to the server\n");
print("<form action=\"Fileupload.php\" method=post enctype=\"multipart/form-data\">\n");
print("File<input type=File name=\"File\" size=20>\n);
print("<input type=submit name=\"submit\" value=\"submit\"></form>\n");
?>
So when i run this, i get the message
NOTICE: Undefined variable : File in c:\webdocs\Fileupload.php on line 6.
Please can someone help me?
Need some Help in PHP
Moderator: General Moderators
might need to add this to the begining of your script
Also, where is $File_name being set?
Mark
Code: Select all
$File = $_POST["File"];Mark