Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Previous Link

  1. #1
    New Coder
    Join Date
    Nov 2004
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Previous Link

    Does anyone know how to code a "previous" link in php?

    I get the following error..

    Parse error: parse error, unexpected ')', expecting ',' or ';' in /home/track/public_html/email.php on line 20

    ------- email.php -----------
    <html>
    <head>
    <title>PROCESS FORM</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#333333" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

    <? //This line tells the server "PHP Code is Starting!"
    #The function

    function checkemail($email){ //First, we check $email, validating that there's one @ symbol, and that the lengths are right
    return preg_match("/^[^\s()<>@,;:\"\/\[\]?=]+@\w[\w-]*(\.\w[\w-]*)*\.[a-z]{2,}$/i",$email);
    }

    #The Error-Checker

    $email = $_POST['email'];
    if((!$email) OR (!checkemail($email))){
    echo 'You did not enter a valid e-mail address.<br> Please <a href="page' . $page-1 . '.php">click here< Previous</a>' , '< Previous');
    die; //stop the PHP from continuing
    }

    ?>

    </body>
    </html>

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    echo 'You did not enter a valid e-mail address.<br> Please <a href="page' . $page-1 . '.php">click here< Previous</a>' , '< Previous');

    should be

    echo 'You did not enter a valid e-mail address.<br> Please <a href="page' , $page-1 , '.php">click here < Previous</a>';
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Nov 2004
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your prompt help raf.

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you're welcome!
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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