How to check if a button is pressed.

How to check if a button is pressed.

How to check if a button is pressed using php .. 🙂

if (isset($_POST['button'])){
	
	echo "button pressed";
}

else {
	
	echo "button not pressed" ; 
	}

<form class="form-horizontal" action="check_button_pressed.php" method="post">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10"><button class="btn btn-default" name="button" type="submit">Test</button></div>
&nbsp;

</div>
&nbsp;

</form>&nbsp;

Will on button click display button pressed .. 🙂

Leave a Reply

Be the First to Comment!

Notify of

wpDiscuz