PHP Login Help

August 21, 2009 at 14:39:21
Specs: Windows 98, ?
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.


See More: PHP Login Help

Report •


#1
August 22, 2009 at 22:42:07
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


Report •

#2
October 15, 2009 at 19:01:04
I am using a form for all the input.

Report •

#3
October 16, 2009 at 01:57:41
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...



Report •

Related Solutions


Ask Question