have tried to use an include file to store $username but it is not returning to the calling page index.php can anyone see the prob and am i going about it the correct way? thx
index.php
login.php
what u think ?
To err is human, to completely mess up takes a computer.
index.php
Code:
<?php
$PageTitle = "JST";
require("header.php");
//phpinfo();
if($message == "Invalid") {
print("<B><CENTER><FONT COLOR=RED>The Username and password do not match please try again!</FONT>
</CENTER></B>\n");
}
print("<FORM ACTION=include(\"handleLogin.php")// METHOD=POST>\n");
$username = include("handleLogin.php");
print("Username: <INPUT TYPE=TEXT NAME=\"UserName\"><BR>\n");
print("Password: <INPUT TYPE=PASSWORD NAME=\"Password\"><BR>\n");
print("<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Submit!\">\n");
//print("<P> <A HREF=\"login.php\">Login</A> To go the next page.\n");
echo $username;
require("footer.php");
?>
login.php
Code:
<?php
if(($_POST["UserName"]=="t")&&($_POST["Password"]=="t")) {
$username=$_POST["UserName"];
return $username;
//header("Location: index.php?UserName=$UserName");
} else {
//header("Location: index.php?message=Invalid");
return "username is invalid";
}
<?
what u think ?
To err is human, to completely mess up takes a computer.