_POST empty while using file and text in form
When uploading files, POST must be used and not GET. Uploads won't work with the GET method.
- Reason being is that you are using a GET method. Change your method to
method="post"
Also make sure your PHP contains $_POST and not $_GET which you haven't shown us.
If you want to get the value of the text box use, and name your form element:
<input id="imgphno" type="text" maxlength="10" name="textbox" />
^^^^^^^^^^^^^^
then use it as:
$text = $_POST['textbox'];
you can't rely solely on id but name to pass a form element.
then do as you wish from there, but use POST again... not GET since you're uploading also.
As per the manual http://php.net/manual/en/function.move-uploaded-file.php
This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.
Another answer given on Stack to support this:
move_uploaded_file() is only for files that were uploaded via POST.