Jump to content

Form Help Please.........


billybob joe

Recommended Posts

Okay, Im working on this thing to create pokemon and am having troubles with the form....heres what I have:Pokemoncreator.html

<html><head><title>My New T35 Free Web Hosting Site</title></head><body><a href="index.php"> Go back to the main page</a><br><form action="pokelab.php" method="get"><input type="checkbox" name="one" value="1"><input type="checkbox" name="two" value="2"><input type="submit" value="Create!"></form></body></html>

pokelab.php

<html><head><title>My New T35 Free Web Hosting Site</title></head><body><?phpif ("one"= 1 & "two"=2 ) document.Write "Whatever...";?></body></html>

Link to comment
Share on other sites

You use $_GET and $_POST to retrieve form values (you use $_GET because your method is GET). And when a checkbox is checked its value is "on". Also, the equivalence operator (==) is used for checking equivalence (as opposed to the assignment operator =). Too, the AND boolean comparison operator in PHP is && or and (& is for binary arithmetic). Finally, echo or print is used to write text to the page in PHP (as opposed to JS's document.write())

if ($_GET["one"] == "on" && $_GET["two"] == "on") echo "Whatever...";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...