I have a form…
I have this at the top of the page…
<?php
session_start();
include 'db/conn.php';
if(!empty($_POST))
{
//regex expressions
//Alphabetic and range: /^[a-zA-Z]{2,15}$/
//length: /^[a-zA-Z]{2}$/
function checkFirstName($input) {
$pattern = '/[a-zA-Z]{2,15}/';
if(preg_match($pattern, $input)) {
//set a SESSION variable
$_SESSION['First_Name'] = $input;
return true;
} else {
//refresh the page usinng HTML
header('index.php?error=1');
}
}
checkFirstName($_POST['First_Name']);
} else {
?>
{show the page}
But I just get
when the form is submitted.
Did the header() not work?