Ummm, I'm curious about this line:
What is that 'track' doing there???Code:<select name="email-to"'Track' style="font-weight: bold; font-style:italic">
Printable View
Ummm, I'm curious about this line:
What is that 'track' doing there???Code:<select name="email-to"'Track' style="font-weight: bold; font-style:italic">
<select name="email-to"'Track' style="font-weight: bold; font-style:italic">
That was what i thought I was supost to put in from other reply. I have figured out that email-to is Track so the line is
<select name='Track' style="font-weight: bold; font-style:italic">
well heck guys ive tried to use all kinds of differant ideas on the above metioned post Im shooting in the dark here. I think I understand what is tring to be done with $to as a verable but just dont have a clue.
I did this and I dont get errors It processes like it should, but NO emails are sent to anyone. Can you see something Im missing.
In PHP line 39 THRU 49 is what I added then line 83 I added !mail("$to
Im woundering if its because I have a $email already for the persons email addess that is filling out the forn.
Form field drop down
<select name='Track' style="font-weight: bold; font-style:italic">
<option value='Wichita' selected>Wichita
<option value="Hutchison">Hutchison</option>
<option value='A Main'>A Main
<option value="Pea Body">Pea Body</option>
<option value="Newton">Newton</option>
<option value="Action RC">Action RC</option>
<option value="Enid">Enid</option>
</select>
PHP File
PHP Code:<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','FirstName');
pt_register('POST','LastName');
pt_register('POST','Address');
pt_register('POST','City');
pt_register('POST','State');
pt_register('POST','ZipCode');
pt_register('POST','HomePhone');
pt_register('POST','CellPhone');
pt_register('POST','EMail');
pt_register('POST','MembershipNo');
pt_register('POST','RoarNo');
pt_register('POST','FirstClass');
pt_register('POST','TransmitterFrequency');
pt_register('POST','TransponderNo');
pt_register('POST','TrackTransponder');
pt_register('POST','SecondClass');
pt_register('POST','TransmitterFrequency2');
pt_register('POST','TransponderNo2');
pt_register('POST','TrackTransponder2');
pt_register('POST','AbilitySkillLevel');
pt_register('POST','RaceDate');
pt_register('POST','Track');
pt_register('POST','IPAddress');
pt_register('POST','DatePosted');
if($FirstName=="" || $LastName=="" || $Address=="" || $City=="" || $State=="" || $ZipCode=="" || $EMail=="" || $FirstClass=="" || $TransmitterFrequency=="" || $AbilitySkillLevel=="" || $RaceDate=="" || $Track=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EMail)){
$error.="<li>Invalid email address entered";
$errors=1;
}
$IPAddress = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$DatePosted = date("Y-m-d h:i");
$email = trim(strip_tags(strtolower($_POST['Track'])));
$checkArray = array(
'Wichita' => 'wichita@wichita.net',
'Hutchison' => 'Hutchison@Hutchison.net',
'A Main' => 'A Main@A Main.net',
'Pea Body' => 'email address',
'Newton' => 'email address',
'Action RC' => 'email address',
'Enid' => 'email address',
);
$to = $checkArray[$email];
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="First Name: ".$FirstName."
Last Name: ".$LastName."
Address: ".$Address."
City: ".$City."
State: ".$State."
Zip Code: ".$ZipCode."
Home Phone: ".$HomePhone."
Cell Phone: ".$CellPhone."
E Mail: ".$EMail."
Membership No: ".$MembershipNo."
Roar No: ".$RoarNo."
First Class: ".$FirstClass."
Transmitter Frequency: ".$TransmitterFrequency."
Transponder No: ".$TransponderNo."
Track Transponder: ".$TrackTransponder."
Second Class: ".$SecondClass."
Transmitter Frequency2: ".$TransmitterFrequency2."
Transponder No2: ".$TransponderNo2."
Track Transponder2: ".$TrackTransponder2."
Ability Skill Level: ".$AbilitySkillLevel."
Race Date: ".$RaceDate."
Track: ".$Track."
IP Address: ".$IPAddress."
Date Posted: ".$DatePosted."
";
$link = mysql_connect("localhost","login","logmein");
mysql_select_db("wichitar_frgn1",$link);
$query="insert into Registration (First_Name,Last_Name,Address,City,State,Zip_Code,Home_Phone,Cell_Phone,E_Mail,Membership_No,Roar_No,First_Class,Transmitter_Frequency,Transponder_No,Track_Transponder,Second_Class,Transmitter_Frequency2,Transponder_No2,Track_Transponder2,Ability_Skill_Level,Race_Date,Track,IP_Address,Date_Posted) values ('".$FirstName."','".$LastName."','".$Address."','".$City."','".$State."','".$ZipCode."','".$HomePhone."','".$CellPhone."','".$EMail."','".$MembershipNo."','".$RoarNo."','".$FirstClass."','".$TransmitterFrequency."','".$TransponderNo."','".$TrackTransponder."','".$SecondClass."','".$TransmitterFrequency2."','".$TransponderNo2."','".$TrackTransponder2."','".$AbilitySkillLevel."','".$RaceDate."','".$Track."','".$IPAddress."','".$DatePosted."')";
mysql_query($query);
$message = stripslashes($message);
!mail("$to","".$FirstName." ".$RaceDate." Race Registration",
$message,"From: $EMail");
?>
<!-- This is the content of the Thank you page, be careful while changing it -->
<body bgcolor="#FFFFFF">
<h2 align="center"><h2 align="center">Registration Confirmation
<a href="#" onclick="window.print();return false;"><font size="2">PRINT</font></a><h2>
</h2></h2>
<div align="center">
<table width="100%">
<tr><td width="114">First Name: </td><td width="199" style="font-weight: bold"> <?php echo $FirstName; ?> </td>
<td width="164">First Class: </td><td style="font-weight: bold"> <?php echo $FirstClass; ?> </td></tr>
<tr><td width="114">Last Name: </td><td width="199" style="font-weight: bold"> <?php echo $LastName; ?> </td>
<td width="164">Transmitter Frequency: </td><td style="font-weight: bold"> <?php echo $TransmitterFrequency; ?> </td></tr>
<tr><td width="114">Address: </td><td width="199" style="font-weight: bold"> <?php echo $Address; ?> </td>
<td width="164">Transponder No: </td><td style="font-weight: bold"> <?php echo $TransponderNo; ?> </td></tr>
<tr><td width="114">City: </td><td width="199" style="font-weight: bold"> <?php echo $City; ?> </td>
<td width="164">Track Transponder: </td><td style="font-weight: bold"> <?php echo $TrackTransponder; ?> </td></tr>
<tr><td width="114">State: </td><td width="199" style="font-weight: bold"> <?php echo $State; ?> </td>
<td width="164">Second Class: </td><td style="font-weight: bold"> <?php echo $SecondClass; ?> </td></tr>
<tr><td width="114">Zip Code: </td><td width="199" style="font-weight: bold"> <?php echo $ZipCode; ?> </td>
<td width="164">Transmitter Frequency: </td><td style="font-weight: bold"> <?php echo $TransmitterFrequency2; ?> </td></tr>
<tr><td width="114">Home Phone: </td><td width="199" style="font-weight: bold"> <?php echo $HomePhone; ?> </td>
<td width="164">Transponder No: </td><td style="font-weight: bold"> <?php echo $TransponderNo2; ?> </td></tr>
<tr><td width="114">Cell Phone: </td><td width="199" style="font-weight: bold"> <?php echo $CellPhone; ?> </td>
<td width="164">Track Transponder: </td><td style="font-weight: bold"> <?php echo $TrackTransponder2; ?> </td></tr>
<tr><td width="114">E Mail: </td><td width="199" style="font-weight: bold"> <?php echo $EMail; ?> </td>
<td width="164">Ability Skill Level: </td><td style="font-weight: bold"> <?php echo $AbilitySkillLevel; ?> </td></tr>
<tr><td width="114">Membership No: </td>
<td width="199" style="font-weight: bold"> <?php echo $MembershipNo; ?> </td>
<td width="164">Race Date: </td><td style="font-weight: bold"> <?php echo $RaceDate; ?> </td></tr>
<tr><td width="114">Roar No: </td><td width="199" style="font-weight: bold"> <?php echo $RoarNo; ?> </td>
<td width="164">Track: </td>
<td style="font-style: italic; font-weight: bold"> <?php echo $Track; ?> </td></tr>
<tr><td width="114"> </td><td width="199"> </td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>
<!-- Do not change anything below this line -->
<?php
}
?>
take out the quotes of the php variables,,, they become strings when you do encapsulate them.Quote:
!mail("$to","".$FirstName." ".$RaceDate." Race Registration",
$message,"From: $EMail");
like i said before declaring your subject like that can be very hard to debug later. Try to store it as a variable.. believe me it will help in the debugging process
PHP Code:$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message, "From: $Email")
I replaced
withPHP Code:!mail($to, .$FirstName. .$RaceDate. Race Registration",
$message,"From: $EMail");
But stiil looked like it proccessed it ok but no mailPHP Code:$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message, "From: $Email")
oo you are saying not to mail it... sorry id idnt catch that originally
PHP Code:if( !mail($to, $subject, $message, "From: $Email") )
{
echo "<h1>Unable to send email; Please try again later</h1>"
}
else
{
echo "<h1>Email Sent! Thank You</h1>";
}
I get errors I paisted what you had and got this
Parse error: syntax error, unexpected '"' in /home/public_html/Registr/Registration.php on line 84
I changed it to lines 82-92
PHP Code:$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message");
if( !mail($to, $subject, $message, From: $Email) )
{
echo "<h1>Unable to send email; Please try again later</h1>"
}
else
{
echo "<h1>Email Sent! Thank You</h1>";
}
delete the bolded/blue textQuote:
$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message");
if( !mail($to, $subject, $message, From: $Email) )
{
I get this
Parse error: syntax error, unexpected ':' in /home/wichita/public_html/Registr/Registration.php on line 84
Lines 82-85
PHP Code:$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, From: $Email) )
{ {
must bePHP Code:$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, From: $Email) )
{ {
This is what php.net says:PHP Code:$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, "From: ".$Email) )
{ {
PHP Code:<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>