Page 1 of 1

simple form code.

Posted: Wed Jan 30, 2008 2:26 pm
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

Re: simple form code.

Posted: Wed Jan 30, 2008 3:55 pm
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";
?>