Forum Moderators: coopster
here is my code:
======================================================
<?php
if(!isset($_REQUEST['upld']))
{ ?><form enctype="multipart/form-data" action="work_details.php" method="POST">
<table border=1 cellspacing="0" cellpadding="5" width="560"><td align="center"><table>
<tr><td>Upload Worksheet</td><td><input name="file" type="file" size="20"/></td></tr>
<tr><td></td><td><input type="submit" value="Upload" name="upld" /></td></tr></table>
<?php
}
else
{ $target = "upload/";
$target = $target . basename( $_FILES['file']['name']) ;
if(move_uploaded_file($_FILES['file']['tmp_name'], $target))
{ echo "The file ". basename( $_FILES['file']['name']). " has been uploaded";
}
else
{ echo "Sorry, there was a problem uploading your file.";
}
}
?>
==============================================
Please help
Anand :)
[edited by: An156 at 10:37 am (utc) on April 25, 2009]
but when i tried by seperating the upload box code in a simple up.html and targeting it to upload.php then it works. how i can do the both things on the same page?
Plz help