Monday, April 29, 2013

How to check if login credentials are null or not register in php


Add those lines before html tag. if login credentials are null or not register it will redirect the page in index page. In this case credential is username.

<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
session_start();
if(!$_session=$myusername){
header("location:index.php");
}
?>

No comments:

Post a Comment