This passes a value from one file to another file using PHP.
[exercise001.html]
[exercise002.php]
<HTML>
<HEAD>
<TITLE>A BASIC HTML FORM</TITLE>
<?PHP
$username = $_POST['username'];
echo "Welcome $username.";
?>
</HEAD>
</HTML>
[exercise001.html]
<HTML>
<HEAD>
<TITLE> LOGIN PAGE </TITLE>
</HEAD>
<FORM NAME ="form1" METHOD ="POST" ACTION = "exercise002.php">
<INPUT TYPE = "TEXT" VALUE ="username" NAME="username">
<INPUT TYPE = "Submit" NAME= "Submit1" VALUE = "Login">
</FORM>
</HTML>
<HEAD>
<TITLE> LOGIN PAGE </TITLE>
</HEAD>
<FORM NAME ="form1" METHOD ="POST" ACTION = "exercise002.php">
<INPUT TYPE = "TEXT" VALUE ="username" NAME="username">
<INPUT TYPE = "Submit" NAME= "Submit1" VALUE = "Login">
</FORM>
</HTML>
[exercise002.php]
<HTML>
<HEAD>
<TITLE>A BASIC HTML FORM</TITLE>
<?PHP
$username = $_POST['username'];
echo "Welcome $username.";
?>
</HEAD>
</HTML>
No comments:
Post a Comment