restricting another login once you logout


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

how can I restrict a page from login authenticating against info in a MySQL DB for a second time? Right now a login check against username and password in a MySQL table and allows access against that data. This works fine, but I want to disallow access once a person has logged in once and logged out.

My current code


<?php
//ini_set("display_errors","1");
//ERROR_REPORTING(E_ALL);

session_start();
/*logout after 65 minutes*/
function login_validate() {
/*Set the timeout on a login session. */
/*Default timout is ten minutes (600 seconds). */
$timeout = 15;
$_SESSION["expires_by"] = time() + $timeout;
}

$con = mysql_connect("localhost","ETSI","Editor") or die('Could not connect: ' . mysql_error());

mysql_select_db("ETSI_Internal") or die(mysql_error());




No comments posted yet

Your Answer:

Login to answer
58 Like 9 Dislike
Previous forums Next forums
Other forums

Add weeks in a query?
I have a SQL that summarizes the quantity per week. The weeks that has no value does not exist in th

Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing

Curl & sessions PLS HELP
Hello,

I have a problem with curl and sessions and i will try to explain the best i could.

Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to

get font info from a font file
hello,

Does anyone know how to get font info from a font file ... using php of course !
<

Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

Can't seem to capture a variable in a chained select
I'm *this* close to having a chained select running but for some reason it doesn't seem to be pickin

Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I canno

Sub-domains & calling unique content
Hello,

Is there a way use something similar to the $_GET function for a sub-domain? I to be a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash