...

View Full Version : Previous Link



johnnybananas
09-16-2005, 12:43 AM
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>

raf
09-16-2005, 12:54 AM
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>';

johnnybananas
09-16-2005, 01:05 AM
Thank you for your prompt help raf.

raf
09-16-2005, 08:17 AM
you're welcome!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum