Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36

Thread: Form email notification depends on drop down

  1. #11
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Ummm, I'm curious about this line:

    Code:
    <select name="email-to"'Track' style="font-weight: bold; font-style:italic">
    What is that 'track' doing there???
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  2. #12
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <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.
    Last edited by big-dog1965; 09-04-2007 at 05:31 PM.

  3. #13
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Here is what I got with no errors, but doesnt email

    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">&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 
    }
    ?>
    Last edited by big-dog1965; 09-05-2007 at 09:54 AM.

  4. #14
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    !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

    PHP Code:
    $subject $FirstName." "$RaceDate ." Race Registration";
    !
    mail($to$subject$message"From: $Email"

  5. #15
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I replaced
    PHP Code:
    !mail($to, .$FirstName. .$RaceDateRace Registration",
    $message,"From$EMail"); 
    with
    PHP Code:
    $subject $FirstName." "$RaceDate ." Race Registration";
    !
    mail($to$subject$message"From: $Email"
    But stiil looked like it proccessed it ok but no mail

  6. #16
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

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


  7. #17
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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 emailPlease try again later</h1>"

    else
    {
       echo "
    <h1>Email SentThank You</h1>";


  8. #18
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    $subject = $FirstName." ". $RaceDate ." Race Registration";
    !mail($to, $subject, $message");
    if( !mail($to, $subject, $message, From: $Email) )
    {
    delete the bolded/blue text

  9. #19
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks for you contenued help

    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$messageFrom$Email) )
    { { 

  10. #20
    Join Date
    Sep 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    PHP Code:
    $message stripslashes($message); 
    $subject $FirstName." "$RaceDate ." Race Registration"
    if( !
    mail($to$subject$messageFrom$Email) ) 
    { { 
    must be

    PHP Code:
    $message stripslashes($message); 
    $subject $FirstName." "$RaceDate ." Race Registration"
    if( !
    mail($to$subject$message"From: ".$Email) ) 
    { { 
    This is what php.net says:

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •