473,513 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

login problems

12 New Member
Ok... On my website, I have a login form that submits the information through POST to a php page, but my problem is that my php page is not getting the POST information. I know my form is sending the information, but the php page gets "" strings. My code is here:
[PHP]
<?php
$GLOBALS['username'] = ucfirst(strtolower($POST['Username']));
$GLOBALS['password'] = $POST['Password'];
@mysql_connect("mysql3.freehostia.com", "jonaxt3_general", "mellon") or die("Cannot Connect To DB!");
@mysql_select_db("jonaxt3_general") or die("Cannot Select DB!");
$sql = 'SELECT id FROM users WHERE username=\''
.
$GLOBALS['username']
.
'\' and password=\''
.
$GLOBALS['password']
.
'\'';
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_num_rows($r)==0){
print "no such login in the system. please try again.";
echo "<br>Username: " . $POST['Username'];
echo "<br>Password: " . $POST['Password'];
exit();
}
else{
echo "Congrats!";
//proceed to perform website’s functionality – e.g. present information to the user
}
?>
[/PHP]
I know it is not very secure, but it is a work in progress, and I plan to add that later.
Jul 17 '07 #1
3 1160
adamalton
93 New Member
At a very quick glance, you seem to be missing the underscores in $_POST. (You've got $POST, which wont work.)
Jul 17 '07 #2
mwasif
802 Recognized Expert Contributor
In you previous posts you always used $_POST instead of $POST.
Jul 17 '07 #3
nazgul42
12 New Member
Thank you, that helped.
Jul 17 '07 #4

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

Similar topics

4
3414
by: XP | last post by:
I am having problems with the blow page. I have a login page where I enter the userid and password. This then connects to this page. If I enter the userid and password correctly, it prints successfully logged into system. If I enter the wrong information all I get is an erro page HTTP status 502 etc. Can anyone help? <?php
1
5452
by: Wayne Smith | last post by:
Applies to: Microsoft FrontPage 2000, Microsoft Access 2000, IIS 5.0 Operating System: Microsoft Windows 2000 Professional I am trying to protect a portion of a web site by allowing users to register a username and password & then login with those details, but so far I am having only marginal success. I am far from an expert on ASP...
0
1354
by: Ed Ploy | last post by:
Would anyone care to point me to a good site or group for troubleshooting user .Net / Passport login problems? I've turned up a lot of development info (such as this group), but little on subscriber and authentication problems. Specifically, I'm a service tech who has a customer having troubles logging in to her Hotmail account from her...
9
3578
by: buran | last post by:
Dear ASP.NET Programmers, How can I post data to an ASP.NET login page and pass authentication? The login page uses forms authentication, users must supply usernames and password and have to click on a submit button. I want to automate this process by supplying values with HttpWebRequest and then download a file on the site. I think that...
0
1277
by: Steve Commisso | last post by:
I'm trying to create a forked login where users of certain roles will be redirected to specific pages. The easy way to do this would be to do the redirecting in the Page_Load() of the default page after login, but I'd like to skip this step and just have the Login control go ahead and do it. So my plan is this: override the OnLoggedIn()...
2
1979
by: Gary Coutts | last post by:
Hi, I am have problems redirecting from a login page. The login page is simple, with just 2 textboxes and one button. On the button click the routine below is called: I am using: Visual Studio 2003 Version 7.1.3008 Framework 1.1 Version 1.1.4322 SP1 Windows XP Pro Version 2002 SP2
1
4980
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database - An easy way to classify different pages as either Admin, Member or Public, where login is necessary for Admin and Member but not for Public. My idea...
9
3568
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. ...
0
1310
by: kang jia | last post by:
hi i have small problems occurred in my login function, which i use Django to build, in my template which is login.html, the code is like the following: <html> <head> <title>Login</title>
10
4795
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey Jones, then login as David Smith the Welcome message below will show "Welcome Davey". And it will be Davey's information that is accessible - not David...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
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...
0
7397
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. ...
0
7563
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...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
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...
0
4757
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...
0
3252
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...
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.