Log in

View Full Version : Form email notification depends on drop down



big-dog1965
09-01-2007, 08:02 AM
Is it posible to have a email sent to differant people depending on a selection made from a drop down on a form. The drop down choices are Wichita, AMain, Hutchison, Enid, Action, Newton. Only one can be selected on the form. So for instance if Wichita was selected an email would be sent to wichita@wichita.com If AMain was selected an email would go to AMain@amain.com and so on.
Here is the PHP

<?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");
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."
";
$message = stripslashes($message);
mail("wichita@wichita.com","".$FirstName." ".$RaceDate." Race Registration",
$message,"From: $EMail");
$link = mysql_connect("localhost","logmein","withthispw");
mysql_select_db("form_21D",$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_Tran sponder,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);
?>

alexjewell
09-01-2007, 04:46 PM
Just do an if, else if, else if, else if, else if, else if statement. Make a variable called $to or something and give it a different value depending on the if/if else statement, then call it in the mail function: mail($to...

boogyman
09-01-2007, 04:49 PM
yes

you put the value of the select dropdown menu as the to in the mail function



<form action="process.php" method="post">
<select name="email-to">
<option value="whichita@blah.com">Whichita</option>
<option value="AMain@blah.com">AMain</option>
</select>


process.php


$to = $_POST['email-to'];
$subject = "_SUBJECT_OF_EMAIL_";

// build your message here
$message = " ";

mail($to, $subject, $message);

alexjewell
09-01-2007, 04:59 PM
Ha, I should have thought of that. That option is easier, but it can be easily hijacked by someone. They can use a simple firefox extension to "edit the html" and submit it to whatever email address they'd like.

boogyman
09-01-2007, 05:31 PM
Ha, I should have thought of that. That option is easier, but it can be easily hijacked by someone. They can use a simple firefox extension to "edit the html" and submit it to whatever email address they'd like.

i was showing him the method... you should always sanitize the data... and ideally what he should do is probably something like


<select name="email-to">
<option value="whichita">Whichita</option>
<option value="AMain">AMain</option>
...
</select>


process.php


$checkArray = array(
'wichita' => 'email address',
'amain' => 'email address',
...
);

$email = trim(strip_tags(strtolower($_POST['email-to'])));\
$to = $checkArray[$email];

mail($to, $subject, $message);


the $checkArray is an array of all of the possible answers. the initial value of the email is trimmed for whitespace, strips all tags that a malicious user might have tried to code in, and it lowers the string to make sure its in the correct format.
$to = gets the value from the $checkArray according to the name which is the key.

then you proceed with the mailing

big-dog1965
09-03-2007, 10:14 PM
Sorry but as Iam a newbie and stuff Im not fallowing this. Do I put this "email-to" in the form like this
<select name="email-to"'Track' style="font-weight: bold; font-style:italic">
<option value='Wichita' selected>Wichita
<option value='A Main'>A Main
</select>

Then where in the process.php do I put

$checkArray = array(
'wichita' => 'email address',
'amain' => 'email address',
...
);

$email = trim(strip_tags(strtolower($_POST['email-to'])));
$to = $checkArray[$email];

mail($to, $subject, $message);

Then what do you mean you should always sanitize the data

boogyman
09-03-2007, 10:53 PM
Sorry but as Iam a newbie and stuff Im not fallowing this.

thats okay Sorry I wasnt clear enough.





Do I put this "email-to" in the form like this
<select name="email-to"'Track' style="font-weight: bold; font-style:italic">
<option value='Wichita' selected>Wichita
<option value='A Main'>A Main
</select>


yes that is correct you put the "name" of the select drop down as email-to / whatever you want to name it. it doesn't have to be that, but you need to be sure to know what it is for the next step.]



Then where in the process.php do I put

$checkArray = array(
'wichita' => 'email address',
'amain' => 'email address',
...
);

$email = trim(strip_tags(strtolower($_POST['email-to'])));
$to = $checkArray[$email];

mail($to, $subject, $message);

this is a segment of the php yes.. but in order for this part to work you need to work of what I did initially also.. below is the script that combines both. the second portion of this script is where you are assigning the email to its corresponding address. I only created 2 of them to show you how its done, and I am sure you can copy my example.
1) make sure the <option value="A Main"> and the key in the array("A Main" remain the exact same, otherwise the email address will not be picked up and you wont be able to send the email.
2) trim() deletes the leading and trailing spaces
strip_tags() will delete any harmful php tags
strtolower() will take whatever is in the email-to value and make it entirely undercase. I did this so it was 1 less thing you needed to worry about, but is not needed as long as you make sure that the form and the array values are the same.




$email = trim(strip_tags(strtolower($_POST['email-to'])));
$checkArray = array(
'wichita' => 'email address',
'amain' => 'email address',
...
);
$to = $checkArray[$email];

$subject = "_SUBJECT_OF_EMAIL_";

// build your message here
// this is what will show up in the body of the email
$message = " ";

if( !mail($to, $subject, $message) )
{
echo "<h1>Unable to send email, Please try again later</h1>";
}
else
{
echo "<h1>Email Sent. Thank You</h1>";
}

if all you want to do is send an email to someone then you can just use this as your entire process.php script, with a few adjustments to fit your specific needs.

1) email-to
you do not have to have this the same as what you have in your <form> however whatever you use you must be sure to change it through all of the corresponding instances as well.

2) subject
I left it up to you to decide what you want the "subject" of the email to be. if you want the user to decide the subject then that would require a little bit of extra coding and again you would need to make sure that the "name" attribute of the form match the processing.

3) the message
I didn't put anything in here, because I didn't know how you were going to handle it. if you need a script to help you populate the message body of the email then please letme know and I will write something up...

4) actual mailing
I took the liberty of creating the actual mail portion of the script for you.. The script will attempt to send the email, and if it can send the email, it will display the thanks heading, and if there is an error it will display the error heading. there is alot of flexibility in that, you would just need to change the "echo", which would print out the heading, to whatever you wish it to say.. or you can delete it altogether and decide what you want to do with it from there, be it a redirect etcetc...



Then what do you mean you should always sanitize the data
You should sanitize everything that comes from the user (client-side) because there are certain tags / scripts that when ran can create a problem in not only php, but every language. Now whether the user just mistakenly entered in something in correctly or it was a user being intentionally malicious, you do not want to give them access to your system beyond what you say is okay. It is possible for someone to create their own form and use that to submit to your script, and if that script has malicious code, it can be destructive.

if you have any questions on that please let me know... and I will try to answer them as thoroughly and quickly as possible.

big-dog1965
09-03-2007, 11:11 PM
Can I just use this much of your code to make it work and where would I paist it in at in that code

$email = trim(strip_tags(strtolower($_POST['Track'])));
$checkArray = array(
'wichita' => 'email address',
'amain' => 'email address',
...
);
$to = $checkArray[$email];
Because if you notice the php code I suplied takes the user to a thank you page of sorts and the code also has all the info that gets sent to the email by pulling it from the Database (I think thats where it comes frome anyway)

If it makes it easier to see what Im doing wichitarcraceway (http://www.wichitarcraceway.com/)
On left youll see registration if you click that you can fill out stuff and submit then youll see results the same results are sent to email

boogyman
09-03-2007, 11:36 PM
I didnt look at the code you sent initially, however now I am confused. The code you sent me is collecting data from the form then it is doing 2 things. It is populating and sending the email and it is also connecting to the database and attempting to insert data into there. now ifyou are attempting to do both, my script needs some adjustments. If you are indeed attempting to "register" a new user, you should try to register them before sending the email.. and then if the registration goes correctly you should email the user of the changes....

Also I am unfamiliar with the
pt_register() function, and it is not listed on php.net. It looks as if it is obtaining and declaring a variable at the same time, which would be a good thing if thats what its doing.. if thats not what it is doing, then I am afraid to say that all of that is useless as you haven't declared any of those variables.

I am going to take it that the "Track" is the name of the email select input? if that is then yes you can just copy and paste that info into the script you have.

When I first look at the "subject" portion of the email script I got very very very confused, but if you will be the only one who EVER looks at this script and you remember than I guess it would be okay... I would have broken that out and created the "subject" variable... and put all of that content as the contents, this way it makes for easier debugging in the future, but its your choice.

the last thing I would say is kinda redundant, you are attempting to send the email first before you input the data into the database... I would input the data into the database, and if that is successful, then send the email, otherwise you could get extra emails if there was an error in inserting the data into the database, that you wouldn't get if you waited until the success of the insertion.

Just some constructive criticism

I hope that cleared that all up...

big-dog1965
09-03-2007, 11:58 PM
I used a formgenarater to creat the form it created everything including the DB. It seems to work ok I get an email and everything. Really the only on going problem I have is the date if the user enters it DDMMYYYY insted of YYYYMMDD the DB doesnt store the information but I still get the email so I know someone register. I added the Track field because some people go to other tracks so insted of me having to sort the information for each track the other track can take care of there own stuff. the current register on the web doesnt have the new form with the track field because it is in use and until I can get the track field worked out didnt want it live, but it functions the same just without the track field and emails to indivigual tracks

Did I loose my help on this?
I tried to paist the code you made in several differant places and got errors not knowing coding I delete or change what I thought was errors, but still errors
Please Help
The form is so people know where others are racing. really informational only, but helps track directors see whos coming to race as well by email

alexjewell
09-04-2007, 12:00 AM
Ummm, I'm curious about this line:



<select name="email-to"'Track' style="font-weight: bold; font-style:italic">


What is that 'track' doing there???

big-dog1965
09-04-2007, 05:22 PM
<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.

big-dog1965
09-05-2007, 06:48 AM
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
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_Tran sponder,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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>
<!-- Do not change anything below this line -->

<?php
}
?>

boogyman
09-05-2007, 12:22 PM
!mail("$to","".$FirstName." ".$RaceDate." Race Registration",
$message,"From: $EMail");

take out the quotes of the php variables,,, they become strings when you do encapsulate them.


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



$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message, "From: $Email")

big-dog1965
09-05-2007, 01:18 PM
I replaced

!mail($to, .$FirstName. .$RaceDate. Race Registration",
$message,"From: $EMail");

with

$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message, "From: $Email")

But stiil looked like it proccessed it ok but no mail

boogyman
09-05-2007, 01:23 PM
oo you are saying not to mail it... sorry id idnt catch that originally



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>";
}

big-dog1965
09-05-2007, 01:38 PM
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

$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>";
}

boogyman
09-05-2007, 01:48 PM
$subject = $FirstName." ". $RaceDate ." Race Registration";
!mail($to, $subject, $message");
if( !mail($to, $subject, $message, From: $Email) )
{

delete the bolded/blue text

big-dog1965
09-05-2007, 02:38 PM
I get this
Parse error: syntax error, unexpected ':' in /home/wichita/public_html/Registr/Registration.php on line 84
Lines 82-85

$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, From: $Email) )
{ {

elwinh
09-05-2007, 02:40 PM
$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, From: $Email) )
{ {


must be


$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, "From: ".$Email) )
{ {


This is what php.net says:


<?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);
?>

boogyman
09-05-2007, 02:48 PM
';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> [/PHP]

it is not required to put the any of those additional headers. they were just listed as a reference of how to create multiple additional headers... but what is important is to note that you do need to encapsulate the string inside some form of quotes, which was the problem

big-dog1965
09-05-2007, 03:03 PM
Done this and got
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/wichita/public_html/Registr/Registration.php on line 87
Not to confuse things, but
This works but need the value in form to be wichita not email address
added at line 39 $locationEmail = $_POST['Track'];
and change the orginal
mail("email address","".$FirstName." ".$RaceDate." Race Registration",
$message,"From: $EMail");
To
mail("$locationEmail","".$FirstName." ".$RaceDate." Race Registration",
The form looks like
<select name='Track' style="font-weight: bold; font-style:italic">
<option value='email address' selected>Wichita
<option value="email address">Hutchison</option>
</select>
Which cant it needs to be because I display the value on other page and dont want to display email address
<select name='Track' style="font-weight: bold; font-style:italic">
<option value='Wichita' selected>Wichita
<option value="Hutchison">Hutchison</option>
</select>

boogyman
09-05-2007, 03:18 PM
what happened to the array that I posted? that will take the value of the dropdown and insert the email address into the "to" rather then the name of the track.

and since there have been multiple updates, can you please post your code again? I will examine the whole script instead of just error by error, to hopefully get this working for you.

ps dont forget to wrap the script in
[p.hp]
[/p.hp]
tags without the dot(s)

big-dog1965
09-05-2007, 03:38 PM
Here is what I have but with error
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/wichita/public_html/Registr/Registration.php on line 87

<?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' => 'email address',
'Hutchison' => 'email address',
'A Main' => 'email address',
'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("wichita",$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_Tran sponder,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);
$subject = $FirstName." ". $RaceDate ." Race Registration";
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>";
}

?>


<!-- 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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>
<!-- Do not change anything below this line -->

<?php
}
?>

big-dog1965
09-05-2007, 03:50 PM
Another attempt. The problem is the form field value is the email address. It cant be because I display it the form field value on another page and dont want it to be an email address I guess an array or something is needed? How?
What was Changed line added 39 and modified line 69 from origanal PHP file. then made the form field values email address

<?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");
$locationEmail = $_POST['Track'];
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."
";
$message = stripslashes($message);
mail("$locationEmail","".$FirstName." ".$RaceDate." Race Registration",
$message,"From: $EMail");
$link = mysql_connect("localhost","login","logmein");
mysql_select_db("wichita,$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_Tran sponder,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);
?>


<!-- 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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>
<!-- Do not change anything below this line -->

<?php
}
?>

boogyman
09-05-2007, 04:11 PM
copy and paste this entire code and tell me if it works now..
I believe this should work... before you did forgot a closing tag, which I believe I have remedied. I have also moved a couple things around to help any future debugging / good coding form.




<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input. \n<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.="\n<li>You did not enter one or more of the required fields. Please go back and try again.</li>";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EMail))
{
$error.="\n<li>Invalid email address entered</li>";
$errors=1;
}

$IPAddress = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$DatePosted = date("Y-m-d h:i");


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("wichita",$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."')";
if( mysqli_query($link, $query) )
{
$EMail = trim(strip_tags(strtolower($_POST['Track'])));
$checkArray = array(
'Wichita' => 'email address',
'Hutchison' => 'email address',
'A Main' => 'email address',
'Pea Body' => 'email address',
'Newton' => 'email address',
'Action RC' => 'email address',
'Enid' => 'email address',
);
$to = $checkArray[$EMail];
$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, "From: ".$Email) )
{
echo "<h1>Unable to send email; Please try again later</h1>"
}
else
{
displayThanks();
}
}
else
{
echo "An Error Occured Inserting Data. Please try again later";
}
}

public function displayThanks() {
?>
<h2 align="center">Registration Confirmation <a href="#" onclick="window.print();return false;">PRINT</a><h2>

<div align="center">

<table width="100&#37;">
<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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>

<?php
}
?>


PS if this doesnt work I would like to see what is in the global.inc.php file

big-dog1965
09-05-2007, 04:31 PM
Paisted and got error
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/wichita/public_html/Registr/Registration.php on line 95
I did add email address to aray
global.inc.php

<?php

function pt_register()
{
$num_args = func_num_args();
$vars = array();

if ($num_args >= 2) {
$method = strtoupper(func_get_arg(0));

if (($method != 'SESSION') && ($method != 'GET') && ($method != 'POST') && ($method != 'SERVER') && ($method != 'COOKIE') && ($method != 'ENV')) {
die('The first argument of pt_register must be one of the following: GET, POST, SESSION, SERVER, COOKIE, or ENV');
}

$varname = "HTTP_{$method}_VARS";
global ${$varname};

for ($i = 1; $i < $num_args; $i++) {
$parameter = func_get_arg($i);

if (isset(${$varname}[$parameter])) {
global $$parameter;
$$parameter = ${$varname}[$parameter];
}

}

} else {
die('You must specify at least two arguments');
}

}

?>

boogyman
09-05-2007, 05:26 PM
it shouldn't be the problem, but the error is being given on line


echo "<h1>Unable to send email; Please try again later</h1>"


try adding a semi colon at the end and see what happens then



echo "<h1>Unable to send email. Please try again later</h1>";

big-dog1965
09-05-2007, 05:50 PM
Now
Parse error: syntax error, unexpected T_FUNCTION in /home/wichita/public_html/Registr/Registration.php on line 107

boogyman
09-05-2007, 05:56 PM
now its not recognizing the call to the "thanks" page... deleting displayThank();
and putting your code for the display in... basically swapping the two



echo "<h1>Unable to send email, try again later.</h1>";
}
else
{
?>


<h2 align="center">Registration Confirmation <a href="#" onclick="window.print();return false;">PRINT</a><h2>

<div align="center">

<table width="100&#37;">
<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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>


<?php
}
}
else
{
echo "An Error Occured Inserting Data. Please try again later";
}
}
?>

big-dog1965
09-05-2007, 10:25 PM
Dang This is hard just paisting back in didnt work I change some other stuff now I guess it is getting to end and bombing out

Parse error: syntax error, unexpected $end in /home/wichita/public_html/Registra/Registration.php on line 136


<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input. \n<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.="\n<li>You did not enter one or more of the required fields. Please go back and try again.</li>";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EMail))
{
$error.="\n<li>Invalid email address entered</li>";
$errors=1;
}

$IPAddress = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$DatePosted = date("Y-m-d h:i");


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("wichita",$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);
{
$EMail = trim(strip_tags(strtolower($_POST['Track'])));
$checkArray = array(
'Wichita' => 'wichitarcraceway@cox.net',
'Hutchison' => 'kelly-ra@cox.net',
'A Main' => 'kangle@cox.net',
'Pea Body' => 'kangle@cox.net',
'Newton' => 'kangle@cox.net',
'Action RC' => 'kangle@cox.net',
'Enid' => 'kangle@cox.net',
);
$to = $checkArray[$EMail];
$message = stripslashes($message);
$subject = $FirstName." ". $RaceDate ." Race Registration";
if( !mail($to, $subject, $message, "From: ".$Email) )

{
echo "<h1>Unable to send email, try again later.</h1>";
}
else
{
?>

<h2 align="center">Registration Confirmation <a href="#" onclick="window.print();return false;">PRINT</a><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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>
<!-- Do not change anything below this line -->

}
?>

boogyman
09-05-2007, 11:09 PM
}
?>


needs to be

<?php } ?>
you need the beginning php sign again

big-dog1965
09-05-2007, 11:28 PM
same error
tried
<?php } ?>

<?php }
?>

<?php
}
?>

big-dog1965
09-06-2007, 04:55 AM
After deleting some stuff I got this to work.

<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input. \n<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.="\n<li>You did not enter one or more of the required fields. Please go back and try again.</li>";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EMail))
{
$error.="\n<li>Invalid email address entered</li>";
$errors=1;
}

$IPAddress = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$DatePosted = date("Y-m-d h:i");

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."
";
$Local = $_POST['Track'];
$checkArray = array(
'Wichita' => 'EMAIL ADDRESS',
'Hutchison' => 'EMAIL ADDRESS',
'A Main' => 'EMAIL ADDRESS',
'Pea Body' => 'EMAIL ADDRESS',
'Newton' => 'EMAIL ADDRESS',
'Action RC' => 'EMAIL ADDRESS',
'Enid' => 'EMAIL ADDRESS',
);
$to = $checkArray[$Local];

$message = stripslashes($message);
mail("$to","".$FirstName." ".$LastName." ".$RaceDate." Race Registration",
$message,"From: $EMail");

$link = mysql_connect("localhost","login","logmein");
mysql_select_db("wichita",$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);
?>

<body bgcolor="#FFFFFF">

<h3 align="center">Registration Confirmation <a href="#" onclick="window.print();return false;">
<font size="3">PRINT</font></a></h3>
<p align="center"><b>An email was sent to the track you selected informing them
of your plans of attending.<br>
<font size="2">This new registration form is on a trial bases in hopes to make
things easier for track owners and driver.</font></b></p>
<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">&nbsp;</td><td width="199"> &nbsp;</td><td width="164">Date Posted: </td><td> <?php echo $DatePosted; ?> </td></tr>
</table>
</div>
<!-- Do not change anything below this line -->

<?php
}
?>

boogyman
09-06-2007, 12:29 PM
okay thats good to hear


$Local = $_POST['Track'];
$checkArray = array(
'Wichita' => 'EMAIL ADDRESS',
'Hutchison' => 'EMAIL ADDRESS',
'A Main' => 'EMAIL ADDRESS',
'Pea Body' => 'EMAIL ADDRESS',
'Newton' => 'EMAIL ADDRESS',
'Action RC' => 'EMAIL ADDRESS',
'Enid' => 'EMAIL ADDRESS',
);
$to = $checkArray[$Local];

$message = stripslashes($message);
mail("$to","".$FirstName." ".$LastName." ".$RaceDate." Race Registration",
$message,"From: $EMail");

$link = mysql_connect("localhost","login","logmein");
mysql_select_db("wichita",$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);
?>


but you have now reverted back to sending the email before the person has been registered.

change the above to .



$link = mysql_connect("localhost","login","logmein");
mysql_select_db("wichita",$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."')";
if( mysql_query($query) )
{

$Local = $_POST['Track'];
$checkArray = array(
'Wichita' => 'EMAIL ADDRESS',
'Hutchison' => 'EMAIL ADDRESS',
'A Main' => 'EMAIL ADDRESS',
'Pea Body' => 'EMAIL ADDRESS',
'Newton' => 'EMAIL ADDRESS',
'Action RC' => 'EMAIL ADDRESS',
'Enid' => 'EMAIL ADDRESS',
);
$to = $checkArray[$Local];

$message = stripslashes($message);
if( mail("$to","".$FirstName." ".$LastName." ".$RaceDate." Race Registration", $message,"From: $EMail") )
{
echo "<p>Email confirmation sent</p>";
}
else
{
echo "<p>An error occured sending confirmation</p>";
}
}
else
{
echo "<p>Could not register. Please try again later</p>";
}

?>

big-dog1965
09-06-2007, 04:37 PM
Ok still working no errors
THANK YOU