...

View Full Version : Please help with $_SESSION



Staidas
04-21-2012, 11:55 AM
Hey guys, could you help me please with $_SESSION as I'm trying to create admin login page. Here's the code:

<?php
session_start();
$_SESSION['user']="username";
?>
(Then I enter adminindex.php which checks if "username" is admin or not from MySQL table).

What I want to do is to make it as a form, so I wouldn't need to go to the actual code to change the "username" and that it would transfer me to adminindex.php (where it checks if "username" is an admin or not).

Thank s in advance!

myfayt
04-21-2012, 01:32 PM
Are you saying you want to alter the current session? I hope not.

If you mean someone enters their username and password and it creates a session, and it creates a new session for their username, that's different.

Staidas
04-21-2012, 04:39 PM
I'm not sure what is the difference as I'm new at it... I'm just looking into different ways to login to admin panel. I was hoping that it is possible to change the "username" in other way then thru code editing.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum