Hi all
Please see script below. Can anyone tell me why when there is a $_GET variable called 'answer' detected, the page section1 is not included?
I'm stumped as this works for the previous include of 'newuser'
<?php
include $_SERVER['DOCUMENT_ROOT'] . '\360feedback\includes\includes.php';
if (isset($_GET['newuser']))
{
include 'userform.html.php';
exit ();
}
if (isset($_GET['answer']))
{
include 'section1.html.php';
exit ();
}
if(isset($_POST['firstname']))
{
;
$sql = 'INSERT INTO user SET
firstname = "' . $_POST['firstname'] . '",
surname = "' . $_POST['surname'] . '",
relation = "' . $_POST['relation'] . '"';
if(!mysqli_query($link, $sql))
{
$error = 'Error adding user:' . mysqli_error($link);
include $_SERVER['DOCUMENT_ROOT'] . '\360feedback\includes\error.html.php';
exit();
}
header('Location: .');
exit();
}
$result = mysqli_query($link, 'SELECT * FROM user');
if(!$result)
{
$error = 'Error fetching users: ' . mysqli_error($link);
include $_SERVER['DOCUMENT_ROOT'] . '\360feedback\includes\error.html.php';
exit();
}
while ($row = mysqli_fetch_array($result))
{
$firstname[] = $row['firstname'];
$surname[] = $row['surname'];
$relation[] = $row['relation'];
}
include 'main.html.php';
?>