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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.