Forum Moderators: coopster
The new server is Windows NT running IIS PHP 4.2.2 with register_globals OFF. The old server was Solaris running Apache PHP 4.2.1 with register_globals ON. So my forms used to pass variables using POST, then I referenced the variables by name. Now I am converting them using this code:
$text = "Company Name: ".$_POST['companyname']. (etc)
The problem lies in the first page which seems to get stuck. If I type a single character into any of the form fields it works fine. But anything much longer and it just hangs. The browser saying it's opening the next page but it never does. Eventually the script times out.
It seems to happen in a way I can't nail down. Sometimes the form goes through, other times not. But I can guarantee it fails if you type in long entries like "mmmmmmmmmmmmmmmmm".
The mystery is made stranger by the fact that this problem only affects Internet Explorer (6). On Mozilla and Netscape 4, the form works! So now I'm thinking it's the IE6 cache - nope, cleared that. Then maybe the mime header? Or the HTML is wrong somehow but I have checked my code. (It's XHTML Transitional with <fieldset> tags.)
Here's a sample of the form code:
<form name="form1" method="post" action="email.php">
<fieldset>
<legend><nolayer>My Form</nolayer></legend>
<label for="companyname"><b>Company Name: </b><input type="text" size="50" name="companyname" /></label>
I have searched the PHP manual website but cannot find any answer. Besides register_globals, the two servers used share almost the same settings. Both use the default 8M for maximum post bytes. Is it the server or my code? Do I need to add something extra to the page? Or is it an IE6 bug?
Sounds like you have a tough issue on your hands. If you want me to test anything, stickymail me the test url and I'll give it a shot.
I'm adding several variables together so they can be sent via email.I'm making an assumption that you may be using the
mail() function in your php script. Also, you seem to have narrowed down a possibility in your last post:Since the browser worked before on a different server, I can only conclude that there is something in the code or browser that doesn't like the new setup....you've been scrutinizing the browser and script, but maybe it's time to analyze the server instead. This warning is right out of the mail() function Manual pages: [us4.php.net]
The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn't use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second, the custom headers like From:, Cc:, Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. PHP < 4.3 only supported the Cc: header element (and was case-sensitive). PHP >= 4.3 supports all the mentioned header elements and is no longer case-sensitive.
mail("c.a.hester@blahblahblah", "Registration", $text2);
I've tried using PHP SELF to use mail() on the same page but still it sticks.
If I can't solve this one, the forum is useless. I should have remembered about the problem in IE but I use Mozilla mostly now, only checking IE now and then.
I can edit the PHP.ini file if that helps. Otherwise I can ask the site admin guy to tweak the settings. Only I am in the dark. What could possibly be wrong?
This link suggests a character limit problem?
[faqts.com ]
Now I must play detective and search the net for clues!
Is there any reason not to use POST instead of GET? Or is there a way to boost the 'buffer' used by GET to allow more characters to be passed from a form?