Still working on this but, I want to validate a text field of certain characters only, then if everything checks out right then redirect to the next page.
heres what I got so far
[code=php]
<?php
// start the session
session_start();
header(“Cache-control: private”); //IE 6 Fix
// Get the user’s input from the form
$name = $_POST[‘Name’];
// Register session key with the value
$_SESSION[‘Name’] = $name;
/* Validation */
function Name($name){
if(!preg_match(“/[^a-zA-Z_ ]+$/s”,$name)) return TRUE;
else return FALSE;
}
/* Validation */
$error=0; // check up variable
/* get it checking */
if(!Name($name)){
echo “Illegal input $name in “Name””;
$error++; // $error=$error+1;
}
if($error == “0”){
echo ” // i dont know what to put here
}else{
echo “Number of errors: $error”;
}
?>
it does the checking but i cant figure out what the code is to redirect…