|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
eeek, why wont this work?
hello everyone,
Im having trouble with the "Creating a member area". Im sure its a simple problem, but i just cant seem to fix it after several hours, so i was hoping you guys might be able to lend a hand. Ok, so I have an 'index.php' page and I successfull log-in. I know the login works. My problem starts when I access my 'research.php' page. I have the code <?php $temp = $dtlsSecurity->IsLoggedIn(); print($temp); ?> but it always returns '0'. It should return '1' as in true when im logged in, but it doesnt. I'm guessing that maybe, the session info isnt passed over to this page? does that make sense? Anyway, I just cant get this page to know im logged in. The code in its entirety, for the research.php page is shown here: Any help is much appreciated. Thanking you all in advance. --------- research.php ----------------- <?php ob_start(); require_once('class.security.php'); $dtlsSecurity = new Security; ?> <html> <head> <title>Research</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <?php $temp = $dtlsSecurity->IsLoggedIn(); print($temp); ?> </body> </html> ------------------------------------------ |
|
#2
|
|||
|
|||
|
try this, i didnt test it yet (i just woke up heh
)PHP Code:
|
|
#3
|
|||
|
|||
|
thanks jxl for the help,
unfortunately, it didnt work. But I think my explanation wasn't very clear. I would be really grateful for any other help though, or Ben if your reading this :-) ok, so to start, the website im try to create is at http://www.pcm.uklinux.net I have created the following login credentials username - a password - a so from the 'index.php' page, which has the log-in section on the left, I can successfully log-in. This is confirmed because, the log-in section changes to a menu when logged in. When the person is logged in, I then want 'research.php' to become available. At the moment, there is no content, just some basic code to determine if i'm logged in from that page. So after logging in from index.php, if we then click the 'research' link, we can see from that page we have a return of '0', suggesting im not logged in. It's this what confuses me. The entire code for 'research.php' is included in my first post, and ther is an extract on the website. For some reason, when i look at another page, it just cant remember that I'm logged in. Any help would be much appreciated. Thanking all in advance, |
|
#4
|
|||
|
|||
|
i was also having a lot of problems when i copied pasted the code
the solution is that you have to see and add in the appropriate table names inside your code. because in the article 1/6 , the tables names are missing. now i am trying to figure out how to logout .. i know we just outta call the logout function but .....
__________________
Hungry for Code Programming works best with a team over one single person
|
|
#5
|
|||
|
|||
|
im not sure if I understand your solution. I have all the tables,
i.e. log session users My log-in function works ok, it just doesnt recognise im logged in when in research.php Thanks for the advice, but i dont think thats the problem. Any oher suggestions anyone? Thank-you in advance. |
|
#6
|
|||
|
|||
|
see you have the tables
but the name of the tables are not initialized in the code the code does not know the names of them.. so u gotta specify in the security class file |
|
#7
|
|||
|
|||
|
Hi AmericanD
Apologies for disregarding your advice. I didnt initially think it was the correct answer. After looking into the code further, I think I know what you mean. So are you refering to this function? function StoreSession_TableName($strName) { //Allows you to define the session table name, if you change the name of it from the default $this->__StoreSessionTableName = $strName; } Thanks |
|
#8
|
|||
|
|||
|
I got the same problem..
I have checked in my database.. and it stores info in tables: session, user, log no error with that.. seems to be something with the sessions.. Anyone knows how to solve it? //LatisZM ![]() |
|
#9
|
|||
|
|||
|
guyssssss !!!!!
check the sessions table and answer this does it store the username, name and other things apart from the session id ? if it doesn't then u've the same problem i had.. |
|
#10
|
|||
|
|||
|
I have the same problem too,
But, AmericanD, it does store the username, name and other things apart from the session id. This is my database entry after a logging in id sessionid username auth userid 1 b23cbef11fbfd2df3d3a02b5be36fc5f jackS 1 4 but when I access another page, it doesn;t know im logged in. So when you said the the tables are not initialized in the code the code does not know the names of them. Where exactly in the code are you referring to? I see you have responded to other people about this, but could you provide more specific info on what you mean. Cheers, L8R's |
|
#11
|
|||
|
|||
|
Did you get that to work? If you did how?
Ich spend a how frikken day about this, and i just dont get it. ok the next thing i will try ist to write a mysql that check the tables. this is getting mebut beside that ben a really cool artikel 1-3. thanks. |
|
#12
|
|||
|
|||
|
well sloved it
![]() sorry for buggin |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > eeek, why wont this work? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|