Forum Moderators: coopster

Message Too Old, No Replies

Form Issues!

advice please?

         

dreamcatcher

8:35 am on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I`ve written this PHP script that enables people to upload files to their server. It works like a charm and I`ve had several people tell me that it works great and they like it. Thats good.

Now the script checks for valid field entries and if nothing is entered, ie: Name, then an error is generated. An example of my code is as follows.

if ($action == "upload")

{

$name = $_REQUEST['name'];

if ($name == "")

{ error message }

do uploading...blah blah

}

I`ve had an e-mail from someone that has said that even though they have entered something they still keep getting an error.

I was just wondering if you guys knew why? Is it related to problems with a server running in Safe Mode?

Also, would it be better to do:

if (empty($name))

instead of the above?

Thank you!

justageek

11:47 am on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it works for others but not one in particular then I would say that person may have the problem. There are several ways to do what you are doing and nothing wrong with the way you are doing it. Are you sure he got your error and not an error from something else? Browser error? Script timeout error? Another error?

JAG

ukgimp

11:55 am on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the user is likely to be forever stupid. I bet they messed it up. Have you checked your error logs to see what they are trying to enter?

dreamcatcher

12:15 pm on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The error is nothing to do with anything on my server, this person has uploaded my script to his own server and gets the error messages even if he DOES enter something. Strange. He assures me he hasn`t messed with any of the code. Thats usually a sure sign that they have. :-P

I think its the second time I`ve heard something like this happening, I remember seeing something about it on another forum a while back but can`t find the post.

Oh well, so long as I`m doing nothing wrong with my scripting thats all that matters. Which at the end of the day, is what I was really worried about.

Thanks! :)

coopster

2:32 pm on Sep 17, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Then I'd venture to guess you are correct, it is a setting(s) on the other person's server. Tell them to start with PHP File Upload Manual [us3.php.net] to determine their issues.

ukgimp

2:42 pm on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



do they have global varibales on/off or something similar

Timotheos

3:18 pm on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could be an older version of php that doesn't support $_REQUEST

dreamcatcher

4:01 pm on Sep 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks guys, I`ve passed the information on and he`s going to contact his hosting company to get some more information. If an explanation turns up I`ll let you know.

:)