Computing.Net > Forums > Programming > PHP Login Help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP Login Help

Reply to Message Icon

Name: DOS programmeR
Date: August 21, 2009 at 14:39:21 Pacific
OS: Windows 98
CPU/Ram: ?
Product: Compaq / ?
Subcategory: General
Comment:

Hello, I have made a username and password check in html and php. But it won't work. Tell me what's wrong and how to fix it, please.

Code:
<html>
<head>
<title>Mindos:Login:Admin#Check</title>
</head>
<body bgcolor="black" spellcheck="false">


<title>Mindos:Login:Admin#Check</title>
<a name="UserNameCheck"> <span style="color: green;"> <strong> Checking UserName... </strong> </span> <?php
$UNEqual = "username"
if ( $UserName == $UNEqual ) {
header('Location:http://mindos.110mb.com/logincheck.html#PassWordCheck');
} else {
echo "Invalid UserName!";
header('Refresh:10;url=http://mindos.110mb.com/admin.html');
}
?> <a name="PassWordCheck"> <br />
<span style="color: green;"> <strong> Checking Password... <?php
$PWEqual = "password"
html_entitie_decode($PWEqual)
if ( $PassWord == $PWEqual ) {
header('Location:http://mindos.110mb.com/mainshell.html#0x0D00l51o0x1Bx00x108gg0x0254e65HYLT189d');
} else {
echo "Invalid PassWord!";
header('Refresh:10;url=http://mindos.110mb.com/admin.html');
}
?> </strong></span></p>
</body>
</html>

Also, if there is a way to put c++ in html like there is php, tell me.



Sponsored Link
Ads by Google

Response Number 1
Name: shutat
Date: August 22, 2009 at 22:42:07 Pacific
Reply:

What is the data source of $UserName and $PassWord? Are you using a form, reading data from a cookie, or maybe static assignment? If the former, then you need to use one of the globals, $_COOKIE, $_POST or $_GET to acquire the data.

You might also want to use an identity test instead of a comparison test - $UserName === $UNEqual

What do you mean by C++? Do you mean executing a binary? If so, then your host would need to allow it. I've used C before, but not C++; here's a resource on html and c++ that *may* help you out.

HTH


0

Response Number 2
Name: DOS programmeR
Date: October 15, 2009 at 19:01:04 Pacific
Reply:

I am using a form for all the input.


0

Response Number 3
Name: Fist (by fmwap)
Date: October 16, 2009 at 01:57:41 Pacific
Reply:

Then you should post the form too.

$UserName should be $_POST[UserName] or $_GET[UserName] - post your login form so we can tell.

Also - none of those calls to header() are going to work because they come after output has started, and two of them appear to be HTML META refreshes - not HTTP headers?

And html_entitie_decode() is mis-spelled & doesn't end with a semi-colon...



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: PHP Login Help

PHP Login www.computing.net/answers/programming/php-login/5334.html

Special PHP Login Script www.computing.net/answers/programming/special-php-login-script/6050.html

PHP - Please help me cause I'm stucked www.computing.net/answers/programming/php-please-help-me-cause-im-stucked/319.html