Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.

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

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

![]() |
![]() |
![]() |

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