Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to login first before see index php

<?php
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
    $welcomeMessage = "Welcome to the member's area, " . $_SESSION['username'] . "!";
} else {
    header('Location: login.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Index page</title>  
</head>
<body>
<?
    if(!empty($welcomeMessage)) echo $welcomeMessage;
?>
 Index page
</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: encode zlib php 
Php :: convert to string php 
Php :: best custom email validation rule for laravel 
Php :: to enable php in apache 
Php :: wordpress highlight text excerpt 
Php :: php if in database field exists, if exists update, if not create 
Php :: laravel collection makeHidden 
Php :: check if any values are the same in an array php 
Php :: php capture include 
Php :: laravel controller subfolder 
Php :: get 1 data from get laravel 
Php :: php audio embed 
Php :: Regullar date format for php 
Php :: like query with prepare wordpress 
Php :: You are *required* to use the date.timezone setting or t 
Php :: consumir soap php 
Php :: laravel collection flatMap 
Php :: php version not update after windows env file 
Php :: laravel-check-if-related-model-exists 
Php :: laravel downgrade php version 
Php :: laravel filter 
Php :: ?: php 
Php :: string put inside tag string php 
Php :: php show hide td 
Php :: How to make a simple mail system in Laravel without view or notification 
Php :: update php local 
Php :: how to add custom navigation menus in wordpress themes 
Php :: run queue after x minutes laravel 
Php :: curlopt_postfields php example 
Php :: php find in array 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =