Page 1 of 1

Password problem

Posted: Thu Oct 24, 2002 10:04 am
by mettlehead
I am building a very simple password example. I have 2 text field in my html form, username and password. On submit I call password.php. When I am in there all I thought I had to do was this:

<?
if($username=="me" && $password=="you") {
echo "your in";
}
else {
echo "You have not entered a valid username/password. Remember, they are case sensitive.";
}
?>

it doesn't seem to work though, any ideas? I alo need to know how to call a html page in php, like mypage.html.

Posted: Thu Oct 24, 2002 10:13 am
by qads
just use

Code: Select all

include("path/page.html");
after you have loged in.

do u use a html form to login? if so check the username and password fields names.
if you use a form, try this:

Code: Select all

$username = $_POST&#1111;'username'];
$password = $_POST&#1111;'password'];
<? 
if($username=="me" && $password=="you") &#123; 
echo "your in"; 
&#125; 
else &#123; 
echo "You have not entered a valid username/password. Remember, they are case sensitive."; 
&#125; 
?>
don't use ASP style tags, always use <?php ?>....

Great

Posted: Thu Oct 24, 2002 10:24 am
by mettlehead
Thanks, it works no. 1 Million thanks. :)