Page 1 of 1

PHP session question

Posted: Wed Nov 18, 2009 10:33 pm
by prue_
hi everyone, I hope someone could help me with this. I have a login page that uses session.. it's working perfect on a but when I upload it on other server, session is not working.. would it be a server problem only? what could be the problem? thanks. here's my code: (domain.com/login.php)

Code: Select all

code deleted

Re: PHP session question

Posted: Thu Nov 19, 2009 12:32 am
by Weiry
prue_ wrote:when I upload it on other server, session is not working
Can you elaborate on this, are you getting any errors?
Usually PHP will throw a notice or a warning if sessions cant be established.
You may also need to check if sessions are enabled. I know that the php.ini has some session configurations there.

Try placing this at the top of a file with a session for debugging.

Code: Select all

error_reporting(E_ALL);
If that doesnt really help, try something like this to see if the session will actually start:

Code: Select all

 
if(!session_start()){
    print "Session failed to start!"; exit;
}else{
    print "Session successfully started!";
}

Edit:
Also, are you trying to run PHP script on a HTML page???

Re: PHP session question

Posted: Thu Nov 19, 2009 1:32 am
by prue_
Edit:
Also, are you trying to run PHP script on a HTML page???
oh my gosh, it's working now.. I renamed everything to .php... thanks a lot.. how come on some server - html with php code works? thanks thanks thanks!

Re: PHP session question

Posted: Thu Nov 19, 2009 3:24 am
by jackpf
Server configuration?