FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Code Stops Working
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Code Stops Working [message #172385 is a reply to message #172383] Wed, 16 February 2011 00:36 Go to previous messageGo to previous message
mrc2323 is currently offline  mrc2323
Messages: 12
Registered: February 2011
Karma:
Junior Member
In article <4d5b0bf7$0$8054$bed64819(at)gradwell(dot)net>,
denis(dot)m(dot)f(dot)mcmahon(at)googlemail(dot)com says...
> On 15/02/11 22:06, Mike Copeland wrote:
>
>> The change I made is in the HTML table code near the bottom of the
>> code, where I commented out one of the prompts. (You can see the change
>> I made if you look at the code.) Again, the remaining code appears to
>> function, but no e-mail is sent and no error is reported by the browsers
>> I've tested. Please advise. TIA
>
> Unfortunately we can't see the php code, just the html that it generates.
>
> However, I see the following conflict when I look at the page html:
>
> <form name="form_name" ....... onclick="check(this)">
>
> <input name="name" .... >
>
> </form>
>
> and the javascript:
>
> function check(form) {
> name = form.name;
> if (trim(name.value) == "") /* barf gently */;
> }
>
> If form.name is the name attribute of the form, then it has no value
> attribute, so I'm wondering what trim which I assume is a locally
> defined function will do when given an undefined value ....
>
> Whether this is related to your problem or not I don't know.

My apologies to all: I didn't realize that the PHP source isn't
accessible. Here it is (but it's messy due to the tabs, etc.). Hope
this helps...
<?php
include "include/page_top.php";
?>

<table border="0" style="width:455px">
<tr>
<td>
<div class="header_text" align="center">
RESULTS QUESTIONS OR PROBLEMS
</div>
</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td class="page_text">
If there is no finish time listed or your
feel the listed time is incorrect, please fill in and submit the below
info:
</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td align="center" >
<?php

//add form submition code
if(isset($submt_btn)) {

$to =
"results(at)raceplaceevents(dot)com,mrc2323(at)cox(dot)net";
$from =
"results(at)raceplaceevents(dot)com";
$subject = "Race Place
Events Website Results Question/Problem Submitted";
$body1 = "Below is the
info submitted on the website:".
"\n\nName:
$name".
"\nEmail:
$email".
"\nAge:
$age".
"\nSex:
$sex".
"\nBib
Number: $bib_number".
"\nName of
Event: $event_entered".
"\nEvent
Distance: $event_distance".
"\nHas
Finish Time?: $has_finish_time".
"\nFinish
Time: $finish_time".

"\nFinished Near Someone?: $finish_near_someone".
"\nTheir
Name or Bib #: $friend_name_bib".
"\nWas Tag
Collected?: $tag_collected".

"\nAdditional Comments: $add_comments";

$eml_result = email($to,
$subject, $from, $body1);

if($eml_result) {
do_msg("<br>Your
info has been submitted. You will be contacted in the next couple of
days.<br><br>");
} else {
do_msg("<br>There
was a problem sending your info. Please email <a
href='mailto:results(at)raceplaceevents(dot)com'>results(at)raceplaceevents(dot)com
</a> about your results problem.<br>");
}

} else {

?>
<script language="JavaScript">

function checkInput(form) {

var name = form.name;
var email = form.email;
var event = form.event_entered;

if(trim(name.value) == "") {
notifyInvalidInput("Name
is a required field. Please enter your name.", name);
return false;
} else if(trim(email.value) ==
"") {
notifyInvalidInput
("Email is a required field. Please enter.", email);
return false;
} else if(trim(event.value) ==
"") {
notifyInvalidInput("Name
of Event is a required field. Please enter.", event);
return false;
}else{
return true;
}

}

</script>

<form name="ques_form" action="<?= $_SERVER
['PHP_SELF'] ?>" method="get" onsubmit="return checkInput(this)">

<div class="bordered_text"
style="width:450px">
<table class="page_text">
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<tr>
<td>*Name:</td>
<td><input type="text"
name="name" class="input"></td>
</tr>
<tr>
<td>*Email:</td>
<td><input type="text"
name="email" class="input"></td>
</tr>
<tr>
<td>Age:</td>
<td><input type="text"
name="age" class="input" style="width:70px"></td>
</tr>
<tr>
<td>Sex:</td>
<td><select name="sex">
<option
value="Male">Male</option>
<option
value="Female">Female</option>
</select>
</td>
</tr>
<tr>
<td>Bib Number:</td>
<td><input type="text"
name="bib_number" class="input" style="width:70px"></td>
</tr>
<tr>
<td>*Name of Event:</td>
<td><input type="text"
name="event_entered" class="input"></td>
</tr>
<tr>
<td>Event Distance:</td>
<td><input type="text"
name="event_distance" class="input"></td>
</tr>
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<tr>
<td colspan="2">Did you see the
clock or have a watch with your finish time?
<select
name="has_finish_time">
<option
value="No">No</option>
<option
value="Yes">Yes</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
What was your time?
<input type="text" name="finish_time" class="input" style="width:70px">
</td>
</tr>
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<tr>
<td colspan="2">Did you finish
near of with anyone you know?
<select
name="finish_near_someone">
<option
value="No">No</option>
<option
value="Yes">Yes</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
What was their name
and/or bib number?<br><input type="text" name="friend_name_bib"
class="input" style="width:300px">
</td>
</tr>
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<!--
<tr>
<td colspan="2">Was your tag
collected at the end of the finish chute?
<select
name="tag_collected">
<option
value="No">No</option>
<option
value="Yes">Yes</option>
</select>
</td>
</tr>
-->
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<tr>
<td valign="top">Additional
Comments:</td>
<td><textarea
name="add_comments" class="input" rows="3"></textarea></td>
</tr>
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submt_btn" class="button" value="Submit">
</td>
</tr>
<tr>
<td class="spacer" colspan="2">
</td>
</tr>
<tr>
<td colspan="2" align="left">*
<span style="font-style:italic">Required Field</span></td>
</tr>
</table>
</div>
</form>

<?php
}
?>

</td>
</tr>
</table>

<?php
include "include/page_bottom.php";
?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: about memory usage with php application
Next Topic: PHP currency converter with XML feed
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 23:39:01 GMT 2024

Total time taken to generate the page: 0.04025 seconds