Jump to content

Have problem with input type=file value


Dathremar

Recommended Posts

After searching the web and not finding anything like this I decided to post my problem here, I hope some1 can help...

 

I made an upload page with 2 input fields. It works perfectly on local machine and on test server, BUT it does not work on the live server.

I used echo $myfile and echo $myfile1 (names of the input fields) to get the value of the variable after the submit and on the local server and test server I get empty variable (ofc when i leave the fileds empty) and when I leave the fields empty and submit the form on the live server I get the value Array in both of the variables.........

 

I really don't know why is this happening.. Is it something about versions of php, OS or something like that .... Everything i read so far says that input type=field CAN'T have default value ......

 

Maybe it is a newb question, but if some1 knows any info about this plz answer

Link to comment
https://forums.phpfreaks.com/topic/91075-have-problem-with-input-typefile-value/
Share on other sites

Ok here is the definition of the input boxes:

 

<input name="myfile" type="file" class="text11_crn_bold" id="myfile" size=20>

 

<input name="myfile1" type="file" class="text11_crn_bold" id="myfile1" size=20>

 

And i am doing a checking if they are empty or not after submitting:

 

if (trim($myfile) == "")

{

if (trim($myfile1) == "")

{

do something if both empty

}

else

$error_msg = ERR_logo;

}

else

{

if ($myfile1 == "")

$error_msg = ERR_logo;

else

{

do something else if both full

}

}

}

 

    So the thing is that it is always considering that the variables $mfile and $myfile1 are full and goes to the part to do something if both full no matter if i leave the input boxes empty or not. I used echo to view the value of the variable and it displayed  Array on the on line server and like I said on my local server and test server it is working fine. If you have more q about this tell me. Thx for trying to help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.