Closed Thread Icon

Topic awaiting preservation: Sessoin problems... :/ Pages that link to <a href="https://ozoneasylum.com/backlink?for=22008" title="Pages that link to Topic awaiting preservation: Sessoin problems... :/" rel="nofollow" >Topic awaiting preservation: Sessoin problems... :/\

 
Author Thread
Corrupt_Mind
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Jun 2004

posted posted 06-01-2004 12:01

I am currently working on the login part of my script... it does all the database checking to see if everything is correct and that works but now im working on the session part this is what I have...

code:
if ($thepassfromdb[0]===$thesubmittedpass){
LoginSuccess($_POST["name"]);
echo("You Have Logged In.<br>");
} else {
echo("Incorrect Password.");
}


function LoginSuccess($user)
{
session_register("username");
$_session["username"] = $user;
}



thats the basics to get what im doing... I dont get any error when logging in and I did an echo to see if it got made the session and it did... but when I click on a link to goto something else on the member page it doesn't keep the session info...

btw both the login & member page im trying to goto are in the same php file... and just incase you're curious I do have session_start(); at the very top... sorry about the title mis-spelling I was typing fast and didn't realize until after I submitted...

(Edited by Corrupt_Mind on 06-01-2004 12:27)

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-01-2004 13:15

a) read the documentation - session_register and $_SESSION [note case] should not be used at the same time
b) $thesumbittedpass - argh. Use $_POST, always, like you do one line later. (and you should probably be using teh name from the db, not the one the user passed in
c) turn on error reporting with php->error_reporting (as in error_reporting(E_ALL) - which would have told you that $_session doesn't exist).

so long,

->Tyberius Prime

I X I
Paranoid (IV) Inmate

From: beyond the gray sky
Insane since: Apr 2004

posted posted 06-01-2004 13:21

Welcome to the Asylum, Corrupt_Mind.




...Of all the things I've lost, I miss my mind the most (ozzy osbourne)

Corrupt_Mind
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2004

posted posted 06-01-2004 21:00

im a complete newbie when it comes to sessions & cookies... this is my first attempt :/

I did a isset to check if it was set and it said no... can someone point me to a tutorial that knows wtf its doing? lol I just need something simple that'll let me set the session info and coutinue to carry it after a link has been clicked...

also $thesumbittedpass isn't whats really there thats just explaining whats there in my code... im thinking of instead of putting the username there im going to get their userid from the database and use that instead... makes it easier I guess... maybe im wrong

btw tankerz for the welcome!

(Edited by Corrupt_Mind on 06-01-2004 21:13)

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 06-02-2004 01:51

I sorted all this crap out for myself not that long ago, giving me a login using cookies and php sessions which works quite well with no js or anything at all, ill take a look at it again tonight and post what i know (thats about 12 hours from now)

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-02-2004 09:22

try our very own Basic PHP Session Tutorial

Corrupt_Mind
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2004

posted posted 06-02-2004 13:32

I read that... infact thats why I joined this forum was to get help with that... becayse it didn't help me... I was told by someone that you have to register the variable name first...

I just dont get what im doing wrong... all these tutorials just show something so simple and yet when I do it, it doesn't work...

(Edited by Corrupt_Mind on 06-02-2004 13:33)

Corrupt_Mind
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2004

posted posted 06-02-2004 15:01

lmfao after talking with a friend for a while about it we figured out my problem... appearantly $_SESSION had to be all caps like that...

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-02-2004 15:50

which I had told you...

Corrupt_Mind
Bipolar (III) Inmate

From:
Insane since: Jun 2004

posted posted 06-03-2004 01:45

lmao never seen the "note case" sorry about that lol

« BackwardsOnwards »

Show Forum Drop Down Menu