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.

<body bgcolor="black" spellcheck="false">

<a name="UserNameCheck"> <span style="color: green;"> <strong> Checking UserName... </strong> </span> <?php
$UNEqual = "username"
if ( $UserName == $UNEqual ) {
} else {
echo "Invalid UserName!";
?> <a name="PassWordCheck"> <br />
<span style="color: green;"> <strong> Checking Password... <?php
$PWEqual = "password"
if ( $PassWord == $PWEqual ) {
} else {
echo "Invalid PassWord!";
?> </strong></span></p>

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

See More: PHP Login Help

Report •

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.


Report •

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

Report •

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