Jump to content


Photo

Sessions not working??


  • Please log in to reply
3 replies to this topic

#1 esport

esport
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 20 July 2006 - 03:15 AM

Hi Guys,
I am currently using sessions to store my user login. So once they login,
@session_start();
if($_POST['login']){
$_SESSION['username']=$_POST['username'];
}

But when i post a form with a feild 'username' that is not part of the login form, it changes the session vairable that was originally set. It seems the the $_POST is conflicting with the $_SESSION.

Any ideas?

D



#2 redarrow

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

Posted 20 July 2006 - 03:24 AM



<? session_start();

$username=($_POST['username']);

if($_POST['login']){
$_SESSION['username']=$username;
}

?>


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

#3 esport

esport
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 20 July 2006 - 03:28 AM

No, i can set the session OK, its when i POST a form with the same names as the sessions, it seems to be overiding the sessions with the values from the POST even tho im not setting the sessions.

#4 redarrow

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

Posted 20 July 2006 - 03:55 AM

what do you mean i dont understand at all

so if you post username what happens

post you full code.
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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users