Do you see what's wrong here? I can't find anything.
this prints:
echo $_FILES["new_text_file"]["name"];
and this too:
echo $_FILES["new_text_file"]["tmp_name"];
php:
";
echo $_FILES["new_text_file"]["tmp_name"];
//Uploads the text file to the server
if(move_uploaded_file($_FILES["new_text_file"]["tmp_name"]), $_FILES["new_text_file"]["name"])
{
//header('Location: ga-dev-exercise-pavan.php');
echo 'worked';
}else {
echo 'did not work';
}
}
?>
html:
<form enctype="multipart/form-data" action="ga-dev-exercise-pavan.php" method="POST">
Choose a text file you want to upload and search through:
<input type='file' name='new_text_file'>
<input type="hidden" name="submit_yes_file" value="true" />
<br /><br />
<input type="submit" value="upload">
</form>