i am a beginner in PHP and I am trying to learn how to make a simple registration form with mysql and php.
The problem is I cannot link to another file that is in another folder. Here are some pictures:
<?php
session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: pages/login.php');
exit();
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
}
?>
<?php include('server.php') ?>
To include server.php
in your register page you need to use require('../server.php')
. The two dots is a shortcut/alias for the parent directory.