By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,091 Members | 1,917 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,091 IT Pros & Developers. It's quick & easy.

PHP - MySQL Login script error

P: 1
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
Share this Question
Share on Google+
3 Replies


dafodil
100+
P: 392
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
Expert 100+
P: 1,584
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
Expert 100+
P: 1,584
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.