473,729 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP - MySQL Login script error

1 New Member
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 2092
dafodil
392 Contributor
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($userna me) || !isset($passwor d)) {
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 Recognized Expert Top Contributor
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 Recognized Expert Top Contributor
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
2104
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) \. mysql_dump.sql.txt When I type myslq <ENTER> I get a command prompt that looks like this...
4
11509
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 for me. 1) I put the file in /home/mlh/public_html/credifree/sql_script/. 2) I made that directory my current directory 3) I typed mysql and pressed ENTER 4) I then typed source mysql_dump.sql.txt and pressed ENTER A bunch of error...
2
3008
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 out, it returns a MySQL error: Could not insert data because You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 Here are the codes: freepage.html...
3
5405
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 authorisation how can i do this
9
3592
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 "myDB" with a table "myUsers" with fields "Username" and "Password". I also have the MySQL ODBC driver loaded with a DSN "dsnMySQL" setup. First question is can someone direct me to a site or provide a sample code for a login page that...
2
1659
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 c:\phpdev\www\website\calendar.php on line 29 Warning: Cannot send session cache limiter - headers already sent (output started at c:\phpdev\www\website\calendar.php:29) in c:\phpdev\www\website\calendar.php on line 30 Warning: Cannot add header information - headers...
20
2375
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 as follows: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/greenpos/public_html/test4/checklogin.php on line 28 Wrong Username or Password The code: <?php $host="localhost"; // Host name
5
5084
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, we should put the script in cgi-bin directory, use of ASCII transfer mode, chmod 755 scriptname.cgi, and then login to unix and type ./scriptname.cgi. I have connected to the database using mysql -u***** -p***** bugs and i could have access to the...
5
9136
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 $conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed"); @mysql_select_db($db) or die("Database Selection Failed"); return $conn; }
0
8761
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9142
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.