Help will contact form!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • atiq
    New Member
    • Apr 2007
    • 36

    Help will contact form!

    I want the thank page to be displayed for about second after the user has submit the form and then to go to another URL say, http://www.google.com. Below is the code:

    [PHP]<?php
    // $mailto - set to the email address you want the form
    // sent to, eg
    //$mailto = "youremailaddre ss@example.com" ;

    $mailto = 'atiqisthebest@ hotmail.com' ;

    // $subject - set to the Subject line of the email, eg
    //$subject = "Feedback Form" ;

    //$subject = "Feedback by $name" ; ***MOVED to line 78***

    // the pages to be displayed, eg
    //$formurl = "http://www.example.com/feedback.html" ;
    //$errorurl = "http://www.example.com/error.html" ;
    //$thankyouurl = "http://www.example.com/thankyou.html" ;

    $formurl = "http://miraj.atiq.eu/index.html" ;
    $errorurl = "http://atiq.eu/error.html" ;
    $thankyouurl = "http://miraj.atiq.eu/" ;

    $uself = 0;

    // -------------------- END OF CONFIGURABLE SECTION ---------------

    $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
    $name = $_POST['name'] ;
    $email = $_POST['email'] ;
    $comments = $_POST['comments'] ;
    $http_referrer = getenv( "HTTP_REFER ER" );

    $subject = "Feedback by $name" ;

    if (!isset($_POST['email'])) {
    header( "Location: $formurl" );
    exit ;
    }
    if (empty($name) || empty($email) || empty($comments )) {
    header( "Location: $errorurl" );
    exit ;
    }
    if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
    header( "Location: $errorurl" );
    exit ;
    }

    if (get_magic_quot es_gpc()) {
    $comments = stripslashes( $comments );
    }

    $messageproper =

    "This message was sent from:\n" .
    "$http_referrer \n" .
    "------------------------------------------------------------\n" .
    "Name of sender: $name\n" .
    "Email of sender: $email\n" .
    "------------------------ COMMENTS ------------------------\n\n" .
    $comments .
    "\n\n------------------------------------------------------------\n" ;

    if(mail($mailto , $subject, $messageproper,
    "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: feedback.php 2.08" )
    {
    ?>
    <script language="javas cript">
    window.open ("thank.html"," mywindow","loca tion=1,status=0 ,scrollbars=0,w idth=400,height = 400");
    </script>
    <?

    $thankyouurl = 'http://www.google.com' ;
    echo '<meta http-equiv="refresh" content="5;url= '.$thankyouurl. '">'
    }

    ?>[/PHP]

    When the contact form is processed i get the following error:

    Parse error: parse error, unexpected '{' in e:\domains\m\mi raj.atiq.eu\use r\htdocs\feedba ck.php on line 110

    Can someone help solve this problem...any help would be greatly appreciated!

    Thanks
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You have 2 errors in this listing:

    Ending parenthesis here [php]if(mail($mailto , $subject, $messageproper,
    "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep .
    "X-Mailer: feedback.php 2.08" ))[/php]and ending semicolumn here:[php] echo '<meta http-equiv="refresh" content="5;url= '.$thankyouurl. '">';[/php]Ronald

    Comment

    Working...