Jump to content


Photo

stop duplicate entry


  • Please log in to reply
5 replies to this topic

#1 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 11 August 2006 - 09:09 AM

hi i want to know how to stop duplicate entries when using php sessions.

i mean say i open up one Internet Explorer and log in, if i open another Internet Explorer window, i want to be able to stop from login in on the second one, cause it is already logged in

thanks

#2 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 11 August 2006 - 09:22 AM

uhhhh the login script... what does it set?  As long as you keep 1 window of IE open it retains a session if i remember correctly... So In theory it should stay logged in...
Why doesn't anyone ever say hi, hey, or whad up world?

#3 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 11 August 2006 - 09:24 AM

i have;

$_SESSION['MemberID'] = $login_array['members_id'];
session_register('MemberID');

i can open two internet explorer windows and log in on both of them with the same username and password

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 11 August 2006 - 09:30 AM

<?php
if($_SESSION['member_id']){
header("location: index.php");
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 11 August 2006 - 09:36 AM

wats that mean?

#6 Guest_huey4657_*

Guest_huey4657_*
  • Guests

Posted 11 August 2006 - 09:53 AM

Somewhere in the login script (usally when username and password have been validated) you need to set authentication
$_SESSION['auth'] = "yes";

then the top of your pages goes something like this

session_start();

 /* Check to see if user is logged in,
    if not send to login page. */

 if(@$_SESSION['auth'] != "yes")

   {

   header("Location: Login.php");

   exit();

   }





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users