I have used the following code on older versions of php, but now I am trying to get this to work on a machine running Version 4.2.2 with the register_globals turned off... I was told that in that case, I have to use superglobals to get my variables recognized... I can get the variable $userfile to work, but I can't get the variable $userfile_name to work.. Any help or advise that anyone can give, would be much appreciated..
Here is my form:
<form action="newsletter_upload.php3" method=post target="main">
Select Your File:<br>
<input name="userfile" type="file"><br><br>
<input type="submit" value="Upload">
</form>
And then here is what it is passed to:
<?php
$userfile = $_POST['userfile'];
if ($_POST['userfile']=='')
{
echo "No File For Uploading. Please try again.";
exit;
}
$upfile = "../newsletter/".$userfile_name;
if ( !copy($userfile, $upfile))
{
echo "Problem: Could not upload the file to the directory.";
exit;
}
echo "Your File was uploaded successfully!";
?>
Again, thanks for any help!