| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Oct 2007
17 posts
Gave thanks: 3
Thanked 0 times
|
PHP Frustration!
Please can somebody help me with a little problem I'm having. A few months back I was forced to cancel my hosting account cause I had a cash flow problem. I've now opened a new account and am trying to set my site back up on the new account but my php login script doesn't seem to want to work since I last used it. I haven't changed or even touched the script since the last time I used it apart from changing the database info which I have repeatedly checked to make sure is correct.
What's happening is when I enter my username and password in my login form and click submit it goes to the page of my script but instead of it saying I'm now logged in it says two errors which are You must enter a username in order to login and You must enter a password in order to login It's as if it's saying I haven't typed anything in on the form when I clearly have. I have entered my username and password correct so I really don't know what's changed since I last used this script and it worked just fine. I hope somebody will be able to help as I'm a little bit desperate since my whole site is tied into the login script working. |
|
|
|
|
|
#2 (permalink) |
|
Surpass Developer
On a golden path...
Joined in Jan 2004
Lives in Florida
Hosted on decc.surpasshosting.com
466 posts
Gave thanks: 15
Thanked 75 times
|
It may be a configuration issue between the two servers. Make sure you are calling the session_start(); function at the top of each page, so that it loads the session data. Your old server might have had automatic session starting on.
__________________
Mark Surpass Hosting Developer sɹnoʎ uɐɥʇ ɹǝʇʇǝq sı bıs ʎɯ |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Oct 2007
17 posts
Gave thanks: 3
Thanked 0 times
|
Ok. I'm not very knowledgeable with php to be honest I used to have a friend that kind of helped me set up some of the more difficult php scripts and I've kind of used the same login script since then. What does session_start(); do and how exactly do I used it in a php script. I'm sorry for not understanding what it is you mean.
|
|
|
|
|
|
#4 (permalink) |
|
Surpass Developer
On a golden path...
Joined in Jan 2004
Lives in Florida
Hosted on decc.surpasshosting.com
466 posts
Gave thanks: 15
Thanked 75 times
|
I assume you are storing the login state in a $_SESSION variable right? Or are you doing it through a cookie?
In order to do like: if ($_SESSION["logged_in"] === true) you would need to use session_start() in order to create or initiate the session. Otherwise, that page won't have access to the stored $_SESSION array values
__________________
Mark Surpass Hosting Developer sɹnoʎ uɐɥʇ ɹǝʇʇǝq sı bıs ʎɯ |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Oct 2007
17 posts
Gave thanks: 3
Thanked 0 times
|
Oh no it's being stored in a cookie. I just don't get why it's doing this I can't see any error that's causing the problem I thought maybe it was a my browser not liking my form or something but it does the same thing in firefox and IE so I guess that idea is out.
|
|
|
|
|
|
#6 (permalink) |
|
Surpass Developer
On a golden path...
Joined in Jan 2004
Lives in Florida
Hosted on decc.surpasshosting.com
466 posts
Gave thanks: 15
Thanked 75 times
|
send me a link to the form and I will check it
__________________
Mark Surpass Hosting Developer sɹnoʎ uɐɥʇ ɹǝʇʇǝq sı bıs ʎɯ |
|
|
|
|
|
#7 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,218 posts
Gave thanks: 18
Thanked 86 times
|
I am just guessing here but I suspect the problem might be associated with register_globals being off. If the script is trying to view the contents of the form variables using just something like $username and $password, might try $_POST['username'] and $_POST['password'] instead. Be sure to use whatever the form is using.
__________________
|
|
|
|