I am tyring to get an image to upload through a user HTML form with the following client code below:
<form action="store.php" method="get" enctype="multipart/form-data">
<div class="tr">
<span class="td">
For the Attunement process Please upload your Full Length Photo
</span>
<span class="td">
<input type="file" name="fileToUpload" id="fileToUpload" required>
</span>
</div>
<div class="tr">
<span class="td">
<br>
<label for="reikilevel">Choose the Level for which you are applying</label>
</span>
<span class="td">
<select name="reikilevel" id="reikilevel">
<option value="Reiki Supermasters Foundation">Reiki Supermasters Foundation</option>
<option value="Reiki Supermasters Healer">Reiki Supermasters Healer</option>
<option value="Reiki Supermasters master Apperntice">Reiki Supermasters Apprentice</option>
<option value="Reiki Supermasters Master">Reiki Supermasters Master</option>
</select>
</span>
</div>
<div class="tr">
<span class="td">
Your Requested Attunement Availability? <br>(Please note: Your attunement may not happen on the requested date. Based on availability of Grandmaster email will be sent to you)
</span>
<span class="td">
<input type="date" id="rqdate" name="rqdate" required>
</span>
</div>
<div class="tr">
<span class="td">
Your First name: </span>
<span class="td">
<input type="text" name="fname" required><br>
</span>
</div>
<div class="tr">
<span class="td">
Your Last name:</span>
<span class="td">
<input type="text" name="lname" required><br>
</span>
</div>
<div class="tr">
<span class="td">
Your Email:</span>
<span class="td">
<input type="email" name="email" required><br>
</span>
</div>
<div class="tr"><span class="td">
Your Mobile Number: (Include Country code example +1 for USA +91 for India)</span>
<span class="td">
<input type="phone" name="mobileno" required ><br>
</span>
</div>
<div class="tr"><span class="td">
Have you taken Reiki Attunement before? (If yes please write from where you took your last attunement. If not write No.)
</span>
<span class="td">
<input type="text" name="previous"><br>
</span>
</div>
<div class="tr">
<span class="td">
<input type="submit" name="submit" style="background-color:maroon;color:white;padding-left:5%;padding-right:5%;padding-top:5%;padding-bottom:5%;font-family: 'Bowlby One', cursive;" value="SUBMIT APPLICATION"><br>
<i>* You will be taken to the Payments page after you submit this form.</i>
</span>
</div>
<div class="tr">
<span class="td">
To prove you are human please enter the number shown here <? echo(rand(1,100)); ?>.
</span>
<span class="td">
<input type="text" name="rando" value="00" maxlength="2" required><br>
</span>
</div>
</form>
</div>
Server side PHP when I try to get values:
$filename=$_GET['fileToUpload']; //Works fine gets the name of file
$file_name = $_FILES['image']['name']; //Empty
$file_size =$_FILES['image']['size']; //Empty
$file_tmp =$_FILES['image']['tmp_name']; //Empty
$file_type=$_FILES['image']['type']; //Empty
echo "<br> File Name: " . $file_name; //Empty
echo "<br> File Size: " . $file_size;//Empty
echo "<br> File TMP: " . $file_tmp;//Empty
echo "<br> File Type: " . $file_type;//Empty
echo "<br> File Error: " . $_FILES['newfile']['error'];//Empty
OUTPUT BEGINS
Your Studentid: 47
Reiki Level requested: Reiki Supermasters Foundation
Your First Name: Puneet
Your Last Name: Mathur
Your Email: puneet.mathurs@gmail.com
Your Mobileno: +917975451287
Your Previous Reiki Status: no
Your Application is received It is pending approval by Grandmaster.
the actual Record value is: 47,Reiki Supermasters Foundation,,Puneet,Mathur,puneet.mathurs@gmail.com,+917975451287,no
File Name:
File Size:
File TMP:
File Type:
File Error:
OUTPUT ENDS
In the variables above the $_FILES
is basically empty I have tried adding enctype="multipart/form-data"
to the client user form but there is no change (Got this from other Stack Overflow posts)
I have checked php.ini info the file_uploads=on so that is not an issue as well.
Can anybody tell me why the $_FILES
is not getting any values?