I am trying to make a login page but I can't seem to get the header to show up.
session_start();
$_SESSION['prevURL'] = $_SERVER['REQUEST_URI'];
if(!$_SESSION['set'])
{
header("location: main_login.php");
}
Based on your comment. You cannot show (print, echo) HTML before the Session_start();
<!DOCTYPE html>
<html>
<?php
session_start();
$_SESSION['prevURL']=$_SERVER['REQUEST_URI'];
//make this $_SESSION[ 'adminSet'] if it 's an admin-only page
if(!isset($_SESSION['set'])) {
header("location: main_login.php"); }
?>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script>
<script src="/bootstrap/js/bootstrap.js"> </script>
<script src="/bootstrap/js/bootstrap.min.js"> </script>
Should be changed to this:
<?php
session_start();
$_SESSION['prevURL']=$_SERVER['REQUEST_URI'];
//make this $_SESSION['adminSet'] if it 's an admin-only page
if(!isset($_SESSION['set'])) {
header("location: main_login.php"); }
?>
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script>
<script src="/bootstrap/js/bootstrap.js"> </script>
<script src="/bootstrap/js/bootstrap.min.js"> </script>