I had upload file with POST and it seems to works fine, but after I go to the next page I can't use the file with the location in the global varible: $_FILES["myfile"]["tmp_name"] because it's null. I don't know why, I used this code before and it worked fine...
Here is the code:
www/step1.php
if (isset($_POST["check_if_press"]) && $_POST["check_if_press"] == "Upload")
{
if (!empty($_FILES["myfile"]["tmp_name"]))
{
header("Location: ./step2_1.php");
}else echo "Please select a file";
}
<form action="<?php echo $PHP_SELF; ?>" method="post" enctype="multipart/form-data">
Upload file: <input type='file' name='myfile' /><br />
<input type='Submit' name='check_if_press' value='Upload' />
</form>
www/step2_1.php
echo $_FILES["myfile"]["tmp_name"];
Now I get NULL printed on the screen.
When I used POST without the arguments :
action="<?php echo $PHP_SELF
But with:
action="./step2.php"
Instead, It work, but than I cant use the upload check .
Thanks,
Yonatan.