Can Someone offer suggestions to my problem !! (I'm going mad!!!)
I'm oing hrough a php tutorial, exolaining how to upload a file to my web server.
the trouble is that there seems to be a proble with enctype="multipart/form-data",
according to the tutorial, this shou generate variables with data about the file being uploaded. This seems to be my trouble.
here is the code for both the form and the upload pages : -
#############
form page
#############
<head>
<title>uploading a file</title>
</head>
<body>
<form method="post" action="do_upload.php" enctype="multipart/form-data">
<p>File to upload:<br>
<input type="file" name="img1 size="30"></p>
<p><input type="submit" value="upload file"></p>
</form>
</body>
#############
do_upload
#############
debug<br>
$img1 = <?=$img1?><br>
$img1_name = <?=$img1_name?><br>
$img1_size = <?=$img1_size?><br>
$img1_type = <?=$img1_type?><br>
<?
if($img1_name != ""){
@copy("$img1", "/http_docs/uploader/$img1_name");
} else if($img_name == ""){
echo "oops something went wrong";
}
?>
This is the output from the do_upload page after exec: -
debug
$img1 =
$img1_name =
$img1_size =
$img1_type =
oops something went wrong
Please help