I am wondering why this is not relocating me to the contact page?
<?php session_start(); ?>
<?php
function setSessions($page){
switch($page)
{
case "contact":
$_SESSION['contact_name'] = $_GET['name'];
$_SESSION['contact_address'] = $_GET['address'];
$_SESSION['contact_phone'] = $_GET['phone'];
header('Location:contact.php');
exit;
break;
case "employment":
break;
case "position":
break;
default:
break;
}
}
$current_page = $_REQUEST['page'];
setSessions($current_page);
?>
I am positive it is going in the contact case.
thanks for the help
-edit: NVM, it works. Thanks!
You can’t send any output before making a call to
header().You would have to remove:
and
References:
http://php.net/manual/en/function.header.php
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.