formMail.php

Discussion in 'PHP' started by drew68, Jun 30, 2007.

  1. #1
    drew68, Jun 30, 2007 IP
  2. amorph

    amorph Peon

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What is wrong with it?
     
    amorph, Jun 30, 2007 IP
  3. Jikdor

    Jikdor Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Changeing the font would bea good idea.
     
    Jikdor, Jun 30, 2007 IP
  4. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #4
    when i click on submit it doesn't go to the thank you page.

    i have the register.php which is the form and the formMail1.php file
     
    drew68, Jun 30, 2007 IP
  5. amorph

    amorph Peon

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    maybe you should point the form to the next page:

    <form name="formMail1" method="post" action="formMail1.php">
     
    amorph, Jun 30, 2007 IP
  6. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #6
    tried that and it don't work :(


    gettin this error
    Parse error: syntax error, unexpected '}' in /home/gi2on3/public_html/formMail1.php on line 4
     
    drew68, Jun 30, 2007 IP
  7. amorph

    amorph Peon

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The code from formMail1.php is not good then. Can you paste it here so I can take a look at it?
     
    amorph, Jun 30, 2007 IP
  8. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #8
    <?php
    $emptyStr = true;
    $uNameErr = true;
    }

    if(empty($_POST["agency"])){
    $emptyStr = true;
    $agencyErr = true;
    }
    if(empty($_POST["position"])){
    $emptyStr = true;
    $positionErr = true;
    }
    if(empty($_POST["address"])){
    $emptyStr = true;
    $addressErr = true;
    }
    if(empty($_POST["city"])){
    $emptyStr = true;
    $cityErr = true;
    }
    if(empty($_POST["state"])){
    $emptyStr = true;
    $stateErr = true;
    }
    if(empty($_POST["country"])){
    $emptyStr = true;
    $countryErr = true;
    }
    if(empty($_POST["phone"])){
    $emptyStr = true;
    $phoneErr = true;
    }
    else
    {
    $myPhone = $_POST["student"];
    }
    if(empty($_POST["amount"])){
    $emptyStr = true;
    $amountErr = true;
    }
    else
    {
    $myAmount = $_POST["amount"];

    }
    if(empty($_POST["student"])){
    $emptyStr = true;
    $studentErr = true;
    }
    else
    {
    $myStudent = $_POST["student"];
    }
    if(empty($_POST["comment"])){
    $emptyStr = true;
    $commentErr = true;
    }
    else{
    if (strlen($_POST["comment"]) > 800)
    $myComment = substr($_POST["comment"],0,800);
    else
    $myComment = $_POST["comment"];

    }
    if(!$emptyStr)
    {
    $admin_email = 'benjijaded123@yahoo.com';
    $headers1 = "From: " ;
    $sub1 = 'New comment (GI2Online)';
    $message1 = 'Name : ' .$_POST["uName"] ."\r\n";
    $message1 .= 'Agency: '.$_POST["agency"] ."\r\n";
    $message1 .= 'Position: '.$_POST["position"] ."\r\n";
    $message1 .= 'Address: '.$_POST["address"] ."\r\n";
    $message1 .= 'City: '.$_POST["city"] ."\r\n";
    $message1 .= 'State: '.$_POST["state"] ."\r\n";
    $message1 .= 'Country: '.$_POST["country"] ."\r\n";
    $message1 .= 'Phone: '.$_POST["phone"] ."\r\n";
    $message1 .= 'Amount: '.$myAmount ."\r\n";
    $message1 .= 'Student: '.$myStudent ."\r\n";
    $message1 .= 'Comment: '.$myComment ."\r\n";
    mail ($admin_email, $sub1, $message1, $headers1);
    header("Location: http://www.gi2online.com/thank_you.html");
    exit;
    }
    }
    ?>
     
    drew68, Jun 30, 2007 IP
  9. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #9
    tell me again why there is a } on line 4? it isn't needed. there is not opening { to be closed.
     
    ansi, Jun 30, 2007 IP
  10. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #10

    i took it out and it still doesn't work

    i get...


    Parse error: syntax error, unexpected '}' in /home/gi2on3/public_html/formMail1.php on line 85
     
    drew68, Jul 1, 2007 IP
  11. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #11
    remove the } on line 85. it isn't needed either.
     
    ansi, Jul 1, 2007 IP
  12. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #12
    well i get no parsing error but it takes me to a blank page now...?
     
    drew68, Jul 1, 2007 IP