SOURCE CODE:
<html> <head><title>Form Collection</title></head> <body> <h1> Member Login</h1> <? // With PHP, we'll get an error if nothing is posted to form without this code in BLUE if ((isset($_GET['txtMember'])) && (isset($_GET['txtPassword']))) { $txtName=$_GET['txtMember']; $txtPass=$_GET['txtPassword']; } else { $txtMember=""; $txtPassword=""; } ?> <? if (($txtMember != "Hunter") || ($txtPassword != "qwerty")) { ?> <form method="get" name="frmC" action="282ln08get.php"> <input type="text" name="txtMember" size="20">Member Name <br><Br> <input type="password" name="txtPassword" size="20">Password <br><Br> <input type="submit" value="Login" name="btnSubmit"> </form> <? } else { ?> <? $txtMember = $_GET['txtMember']; $txtPass = $_GET['txtPassword']; ?> <h3>Welcome Back <? echo $txtMember; ?> !</h3> <br> <? } ?>
ANSWER: Check out the URL! This example, the GET example, appends the URL with the name/value pairs! And, it uses $_GET in place of $_POST.