Hi, Im not very fluent in html, and im trying to do a very simple task. I've been browsing google and multiple forums including this one for a while trying to figure out this basic code but having no luck. I believe i may need to use javascript for this. What i'm trying to accomplish is: - Have visitors enter a confirmation code into a text box - If they enter the right code they get sent to my members page - If they enter the wrong code they get sent to an error page Pretty simple I know, but i cant seem to figure this out. i read the tutorial on validation on w3schools, and tested some code out, but i cant seem to get it to work. Im trying to post the code here so i can show you but, im apparently not able to submit "live links" yet. Hell, i'll paypal someone $10 to help me with this simple problem asap.
Hey - you could do it in Javascript, I'd do it in PHP - that way you'll never be able to guess the code by looking at the page source. This works absolutely fine. Replace the XXXXX with whatever code you want, yahoo and google with where you want people to go. You'll need to give the page a .php extension (eg- index.php) and you'll need to style any html on the page. Give me a shout if you need any further help. Or want to paypal me $10, haha ben <?php if (isset($_POST["qcode"])) { $getqc = $_POST["qcode"]; if ($getqc == "XXXXX") { /* Where you want people to go if they get the code right */ header ("Location: http://www.google.com"); exit; } else { /* Where you want people to go if they get the code wrong */ header ("Location: http://www.yahoo.com"); exit; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Question</title> </head> <body> <form action="index.php" method="post"> <input name="qcode" type="text" /><br><br><input type="submit" name="Submit" value="Submit"> </form> </body> </html> Code (markup):