473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 2045
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

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

Similar topics

7
by: MLH | last post by:
I have an sql script file that is supposed to create a set of database tables for me. Supposedly I type the following on my linux box and its all supposed to work... mysql (ENTER) \....
4
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem...
2
by: PHP_Paul | last post by:
Ok, I'm trying to poineer into the wonderful area of PHP/MySQL programming, but I'm having some difficulties. http://www.paulhq.com/php/freepage.html should register, but when anyone fills something...
3
by: focussys | last post by:
hi i am a student and am doing this for one of my assignments i am trying to create a login using perl and mysql database.i was succesful in doing that now i want to use cookies for...
9
by: Ben | last post by:
Hello, I'll bet this has been asked a million times but I can't seem to find a thread that gives the clear example I need. This PC has MySQL and IIS configured and running. The MySQL database is...
2
by: studentfromhell | last post by:
These mesages appeared... what should I do? script is below the error messages... Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in...
20
by: cmbcorp | last post by:
Hi, I have been playing around with a simple php login script and im getting an error message when i attempt to log in with the username and password i set in the sql table. The error message is...
5
by: Sport Girl | last post by:
Hi again my great online assistants, just would like to say that i'm testing the script under unix , and after researches on the internet, i have realised that to resolve 500 Internal Server Error,...
5
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.