simple form code.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pessi
Forum Newbie
Posts: 2
Joined: Tue Dec 02, 2003 5:33 pm

simple form code.

Post by pessi »

dear all,
Novice here and having problems with simple code. Please help

here is my code

Code: Select all

<form name="form1" action="something.php">
<input type="submit" name="mybutton" value="submit" />
</form>
<?php
if($_POST["mybutton"] == "submit")
echo "Success";
else
echo "Failure";
?>
I donot get a success message even when I click the button.

Thanks in advance,
prasad.


GOT the solution...replaced POST by GET
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: simple form code.

Post by Christopher »

Code: Select all

<form name="form1" action="something.php" method="post">
<input type="submit" name="mybutton" value="submit" />
</form>
<?php
if($_POST["mybutton"] == "submit")
echo "Success";
else
echo "Failure";
?>
(#10850)
Post Reply