469,578 Members | 1,933 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

PHP - MySQL Login script error

I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved my site to this newsit.es host service because it is ten times better but my login script wont work anymore. I believe it has to do with the settings not allowing sessions. Does this sound right?

I tried hundreds of times and it kept sending me back to the login page. I figured i set up the mysql connection settings wrong but I tested it by designing a simple page which would select all ids from a specific table inside the database and was able to retrieve all of the data.

Any ideas on how to get by this session login problem?


Here is the first lines of my login script

Expand|Select|Wrap|Line Numbers
  1.  
  2. //check that the user is calling the page from the login form and not accessing it directly
  3. //and redirect back to the login form if necessary 
  4. if (!isset($username) || !isset($password)) {
  5. header( "Location: index.php?pid=1" );
  6. }
  7.  

When I try to login i get the index.php?pid=1 error

Could this be a mysql settings problem? I have two other sites with this script on two completely different web host services and never had a problem.
Jul 13 '07 #1
3 1879
dafodil
392 256MB
I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved my site to this newsit.es host service because it is ten times better but my login script wont work anymore. I believe it has to do with the settings not allowing sessions. Does this sound right?

I tried hundreds of times and it kept sending me back to the login page. I figured i set up the mysql connection settings wrong but I tested it by designing a simple page which would select all ids from a specific table inside the database and was able to retrieve all of the data.

Any ideas on how to get by this session login problem?


Here is the first lines of my login script

//check that the user is calling the page from the login form and not accessing it directly
//and redirect back to the login form if necessary
if (!isset($username) || !isset($password)) {
header( "Location: index.php?pid=1" );
}



When I try to login i get the index.php?pid=1 error

Could this be a mysql settings problem? I have two other sites with this script on two completely different web host services and never had a problem.
Maybe the web host has different settings you can check their instructions about setting your database... Try that code to other webhost services if that code works then the problem is in the web host.
Jul 13 '07 #2
ak1dnar
1,584 Expert 1GB
Thread title changed.

Earlier: PHP Login Problem - Think it is MySQL settings problem
Recent: PHP - MySQL Login script error

How to use a good thread title

Thanks !
Ajaxrand
Jul 13 '07 #3
ak1dnar
1,584 Expert 1GB
I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved my site to this newsit.es host service because it is ten times better but my login script wont work anymore. I believe it has to do with the settings not allowing sessions. Does this sound right?

I tried hundreds of times and it kept sending me back to the login page. I figured i set up the mysql connection settings wrong but I tested it by designing a simple page which would select all ids from a specific table inside the database and was able to retrieve all of the data.

Any ideas on how to get by this session login problem?


Here is the first lines of my login script

Expand|Select|Wrap|Line Numbers
  1.  
  2. //check that the user is calling the page from the login form and not accessing it directly
  3. //and redirect back to the login form if necessary 
  4. if (!isset($username) || !isset($password)) {
  5. header( "Location: index.php?pid=1" );
  6. }
  7.  

When I try to login i get the index.php?pid=1 error

Could this be a mysql settings problem? I have two other sites with this script on two completely different web host services and never had a problem.
Hi bull1099,

Welcome to TSDN.

please run a script to check session is enabled or not on the php engine on the server.
Expand|Select|Wrap|Line Numbers
  1.  <?php 
  2. phpinfo();
  3. ?>
  4.  
There you will get a section for current config for session. and update the result back to the thread.
Jul 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by focussys | last post: by
9 posts views Thread by Ben | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.