Hello everyone,
I would really appreciate if anyone could please help me out here. I am trying to read the user's input in one page and then trying to display it in another page (want to let my users upload a file from their machine and save them in my database).
here's what i have so far....
in File_1.php I am collecting the file's path/location and description and saving then in two different variables:
<!-- letting the browser know that we are sending files from the client's machine to the server -->
<form enctype="multipart/form-data" name="frmUploadFile" action="File_2.php" method="post">
<br>Please select a file and give a description of it.<br>
<!-- insert the file location -->
<tr>
<td>
<p>File Location:
</td>
<td>
<input type="file" name="fileUpload" size="50">
</td>
</tr>
<!-- insert the file description -->
<tr>
<td>
<p>File Description:
</td>
<td>
<input type="text" name="fileDesc" size="50">
</td>
</tr>
<tr>
<td width="67%">
<input type="submit" value="Submit" name="submit">
</td>
</tr>
and in File_2.php, I am checking if the user provided both fields:
// declared five global variables
global $fileName;
global $fileSize;
global $fileDesc;
global $fileType;
global $fileUpload;
// Making sure both the file's location and description have been entered
if($fileUpload == "none")
die("You haven't selected any files.");
elseif(empty($fileDesc))
die("You didn't put the file description.");
Now my problem is even though I am providing both fields in File_1.php, I am ALWAYS getting the message "You didn't put the file description." Can anyone please tell me what I am doing wrong?
Thank you in advance!!!
PS: i omitted few lines here that handled the font style/size etc. guessing that's not related to my question.