Adsense
Popular Posts
- MySQL workbench -"Could not decrypt password cache"
- peer review (3)
- PHP, dump varailbes in a format way
- "Unusual traffic from your computer network" from blogger
- Install APXS in Redhat Linux
- JavaScript, remove trailing insignificant zeros after toFixed function
- Update member directory
- Set Windows path command line
- JavaScript: add days to current date
- DataTable table order by numeric, not by text
Thursday, October 10, 2013
Design department database
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\demosite\index.php
line 4 add:
session_start();
Add a login and logout session: line 11 add:
$url="../scripts/personal/";
if(!isset($_SESSION['username']))
{
if(isset($_POST['submit_login']))
{
if( isset($_POST['name']) && isset($_POST['pass']) && ($_POST['name']==$admin_name) && ($_POST['pass']==$admin_password) )
{
$_SESSION['username'] = $admin_name;
}else{
echo "<div class='login-msg'>Incorrect Login </div>";
}
}
}
// end login session with logout
if(isset($_GET['action']) && ($_GET['action']=='logout'))
{
session_destroy();
unset($_SESSION['username']);
$url = str_replace('?action=logout', '', $_SERVER['PHP_SELF']);
echo $url;
header("Location: $url");
exit();
}
$html=true;
Local test site:
http://localhost/ubc_surgery_pub/demosite/
remote site:
http://139.173.32.21/ubc_surgery_pub/demosite/
remote directory:
web_root/cesei/ubc_surgery_pub/demosite
Labels:
ubc-surgery
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment