thanks travelbuff,
I have commented out all of the username and password validation code
still get same results, so I assume that this part of the code isn't affecting / causing the problem, I'm leaving it commented out, like you say i can re-introduce it once the problem is solved.
First thing to say is that the guy who built the database has called the table 'tblUser' and the field are called 'CLogIn' / 'CPass' etc. so I am following these names exactly.
I have access to PHPMyAdmin, but to be honest I can 'read' what it says there but I'm not familiar with exactly how it works.
However, I have run the following codes in the sql tab and found some interesting results;
By the way the tblUser contains the members of the beatles for testing purposes!
SELECT UserId FROM tblUser WHERE CLogIn = 'John.Lennon' AND CPass = PASSWORD( 'happiness ');
says that 'Your SQL-query has been executed successfully' but doesn't acutally return any results.
SELECT * FROM tblUser WHERE CLogIn = 'John.Lennon' AND CPass = PASSWORD( 'happiness ');
says that 'Your SQL-query has been executed successfully' but doesn't acutally return any results.
SELECT * FROM tblUser WHERE CLogIn = 'John.Lennon' ;
shows the row containing all the fields for this username.
From this I think my problem lies with the password.
So I have tested it with a non-encrypted password;
SELECT * FROM tblUser WHERE CLogIn = 'Paul.McCartney' AND CPass = 'vegetarian';
and it showed the expected row for the username.
So I took PASSWORD() out of the php code and ran with Paul.McCartney and it (sort of) worked.
I moved on to the session section of the code but now got the jumbo error message;
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /////***/connect.php:20)
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /////***/connect.php:20)
which I know is because there is code prior to the session_start(), but how do I get around this because I need to connect to the database first, and then verify the login information before i start the session (don't I?)
but then, the good news......
I also get the following output;
The session ID is c715eda3b5f0a568a5669337912415b8
The cookie info is: Array
session user name is Paul.McCartney
session password is vegetarian
session user id is 2
all is what i would expect, apart from cookie info is: Array , should this not show the information contained within the array?
So travelbuff, couple of questions if you don't mind.........
Is the cookie information Array part of the code correct? Is this what you would expect from your code? Or is it because of 'Cannot send session cookie - headers already sent' ?
How do I get around the part of the code to start the session and set the session variables in the correct order so that I avoid 'Cannot send session cookie - headers already sent / Cannot send session cache limiter - headers already sent '. ?
Once I get all this working (!) how can I re-introduce PASSWORD() into the code - I need the information to be as secure as possible and to maintain database integrity, as although the information contained in the database (when we go live) isn't going to be ultra-sensitive I still need to make sure it is all well safeguarded.
a million thank yous