Click to See Complete Forum and Search --> : Form problem


Simpy
01-28-2003, 07:21 PM
Hi,

I've created a form where I ask the user to fill out a few text boxes (name, address, etc.) and then submit the form. When they click the Submit button 3 things are supposed to happen: A script runs to make sure the user filled out all the Required fields; an e-mail is sent to me containing all the information the user entered; and the user jumps to a "thanks for participating" page. This has all worked perfectly for months, but now all of a sudden it's stopped working correctly.

Now when the user clicks "Submit", the form hangs and eventually they get a "Connection timed out" error. The script is running properly, I still receive the e-mail with all of the user's information, but they're not jumping to the "thank you" page. Instead, all the user sees is the "connection timed out" error. Here is the code I've used:

This is the pertinent code on the form itself:

<form method="POST" action="zlottproc.php" name="form" onSubmit="return checkFields2()">

This is the code for the 'zlottproc.php' page:

<?
$to = "chris@zlott.com";
$subject = "New Submission";
$body = "This submission is from \n\nName: $fullname\n\nTitle: $title\n\nCompany: $company\n\nEmail: $email\n\nPhone: $phone\n\n";
mail($to,$subject,$body);


header("Location: thankyou_hg.phtml");

?>


Anyone have any ideas about what's causing the process to suddenly time out like this? Is it a hardware issue perhaps? (Again, the code hasn't been touched since it was working fine.) The website resides on a Windows 2000 server.

Any help is greatly appreciated!!

Rick Bull
01-29-2003, 09:57 AM
I'm not really sure if this will help, but I would try making the location header use a complete URI (e.g. http://www.yourserver.com/thankyou_hg.phtml) as you aren't supposed to leave the location header relative. Other than that I can't think what else it could be.

Simpy
01-29-2003, 05:16 PM
Nope, that didn't do the trick.

Thanks for the suggestion though. It was worth a shot!

swon
01-29-2003, 05:59 PM
May they do something on the php.ini file on the server:

try this one:

mail($to,$subject,$body,"From:name@domain.com");

Simpy
01-29-2003, 08:18 PM
I'm sorry, I'm not exactly clear on what you mean here.

Do you mean I should change the php.ini file by adding mail($to,$subject,$body,"From:name@domain.com"); to the [mail function] section of the file? I'm pretty sure that's not what you mean but, again, I don't know.

(And the e-mail part of this whole process is working fine. It's the "Location" redirect that's causing the trouble.)

Sorry if I'm being dense here.

Simpy
02-03-2003, 04:26 PM
Well I finally got this problem solved. Turns out there's a "delay" setting that you can turn on or off on the mail server. I guess it's designed to prevent spam as the server "analyzes" the e-mail to make sure it's okay to let pass through. (At least that's what I think it's supposed to do?) Since this delay was turned on, this analyzing process was taking too long. Apparently Microsoft has a limit for how long this analyzing process can take and if it exceeds that limit you get the "timed out" error. I turned the delay setting to off and everything's working again.