billybob joe Posted April 6, 2008 Share Posted April 6, 2008 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 More sharing options...
Synook Posted April 6, 2008 Share Posted April 6, 2008 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 More sharing options...
billybob joe Posted April 6, 2008 Author Share Posted April 6, 2008 What if I were to use radio buttons? Link to comment Share on other sites More sharing options...
kv79 Posted April 6, 2008 Share Posted April 6, 2008 I suggest you to learn from w3school a $_POST and If ..else method . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.