/    Sign up×
Community /Pin to ProfileBookmark

Form problem

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:

[B]This is the pertinent code on the form itself:[/B]

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

[B]This is the code for the ‘zlottproc.php’ page:[/B]

<?
$to = “[email protected]“;
$subject = “New Submission”;
$body = “This submission is from nnName: $fullnamennTitle: $titlennCompany: $companynnEmail: $emailnnPhone: $phonenn”;
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!!

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@Rick_BullJan 29.2003 — 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.
Copy linkTweet thisAlerts:
@SimpyauthorJan 29.2003 — Nope, that didn't do the trick.

Thanks for the suggestion though. It was worth a shot!
Copy linkTweet thisAlerts:
@swonJan 29.2003 — May they do something on the php.ini file on the server:

try this one:

mail($to,$subject,$body,"From:[email protected]");
Copy linkTweet thisAlerts:
@SimpyauthorJan 30.2003 — 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 [COLOR=royalblue]mail($to,$subject,$body,"From:[email protected]");[/COLOR] 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.
Copy linkTweet thisAlerts:
@SimpyauthorFeb 03.2003 — 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.
×

Success!

Help @Simpy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...