Hi,
I am regularly getting a timeout with my feedback form. Once the user hits submit, it is supposed to call up the form handler which then checks on the content, attachment, etc and then puts it all together into an email which is supposed to be sent to me.
Following symptoms appear:
- user presses submit button which causes time-out in the browsers. Both Chrome and IE return “No data” error
- I traced the progress step by step and can confirm that the script works accurately until after uploading the attachment to my server.
- the error(s) must be somewhere in the handler between connecting to my MySQL database and sending the actual email.
- i am suspicious of my as I was playing around with several buttons and actually want to disable the submit button after it is pressed once, as i found many submissions double and triple in my database
I am really at my witts end and have no clue anymore… any help for this newbie would be GREATLY appreciated!!
Thank you,
A2k
HTML submit form:
[php]
<body>
<table id="GPA_table" width="100%" bgcolor="#DDD9C4" align="center">
<p>
<tr>
<td bgcolor="#D9D9D9">
<img src="./images/iclogo_big3.jpg" style="width: 100%"/><br />
<b><center>GPA</center></b>
</td>
</tr>
<tr>
<td>
<form method="POST" name="Guest Problem Alert" action="<?php echo 'http://' . $server . '/QCI/scripts/GPA/email_parser.php' ?>" enctype="multipart/form-data">
<div>
<label for="property"><b>Property:</b></label><br />
<select name="property" style="width: 100%">
<option value="DADHA">My Property</option>
</select>
</div>
<br /><hr />
<div>
<label for="name">Staff name (*):</label><br />
<input type="text" name="staff_name" size="30"/>
</div>
<br />
<div>
<label for="department">Department:</label><br />
<select name="staff_department" style="width: 100%">
<option value="blank"> </option>
<option value="A&G">A&G</option>
</select
</div>
<br /><br />
<div>
<label for="problem">Problem (*):</label><br />
<?php
//query problems from GPA_problems
$sql="SELECT PID, Problem FROM GPA_problems";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result))
{
$PID=$row["PID"];
$problem=$row["Problem"];
$options.="<OPTION VALUE=\"$PID\">".$problem;
}
?>
<SELECT NAME=problem>
<OPTION VALUE=0>Select Problem
<?=$options?>
</SELECT>
</div>
<br /><hr />
<div>
<label for="gst_name">Guest Name:</label><br />
<input type="text" name="gst_name" size="30"/>
</div>
<br />
<div>
<label for="gst_room">Guest Room:</label><br />
<input type="text" name="gst_room" size="30"/>
</div>
<br />
<div>
<label for="incident">Incident (*):</label><br />
<textarea style="width: 100%; height: 150px;" name="incident"></textarea>
</div>
<br />
<div>
<label for="action">Action taken:</label><br />
<textarea style="width: 100%; height: 150px;" name="action"></textarea>
</div>
<br />
<div>
<label for="action">Follow up action (by whom)?:</label><br />
<textarea style="width: 100%; height: 75px;" name="followup"></textarea>
</div>
<br />
<div>
<label for="uploaded_file">Attachment <i>(max. filesize 5 MB)</i></label><br />
<input type="file" name="uploaded_file">
</div>
<br />
<div>
<label for="gst_temp">Case resolved? (*)</label><br />
<select name="case_status" style="width: 100%">
<option value=""> </option>
<option value="YES">YES</option>
<option value="NO">NO</option>
</select>
</div>
<br />
<div align="center">
<input type="submit" value="Submit"> <input type='reset' value='Reset'>
<!-- <input type="submit" value="Submit"> <input type='reset' value='Reset'> -->
<!-- <input type="submit" value="Submit" onclick="this.disabled=true; this.value = 'Wait...'; this.form.submit(); return true;" /> -->
</form>
</td>
</tr>
<tr>
<?php include './scripts/css/GPA_footer.php'; ?>
</tr>
</p>
</table>
</body>
[/php]
form handler
[php]
ERROR
You did not enter a valid Staff Name, Guest Problem, Incident Message or Case Status.
Please [Go Back] and fix this.
"; exit; } // DRAFT EMAIL MESSAGE $email_message = "
An alert has been raised:
Item | Details |
---|---|
Property | $property |
Date & Time | $date - $time |
Staff Name | $staff_name |
Staff Department | $staff_department |
Problem | $problem |
Guest Name | $gst_name |
Guest Room | $gst_room |
Incident | $incident |
Action | $action |
Follow up | $followup |
Case closed? | $case_status |
All OPEN CASES must be followed up within 1 hour from now.
$edit_url?id=$id
Kind regards,
MESSAGE SENT!
Thank you very much for your submission!
"; } ?>
[/php]