Reputation: 63
<form method="get" action="<?php echo $_SERVER['PHP_SELF']?>">
<h3>Select your product and click submit</h3><br />
<select name="prod">
<option value="default">Select your product</option>
<option value="os">Operating Systems</option>
<option value="mobile">Smart Mobiles</option>
<option value="mobile">Computers</option>
<option value="shirt">Shirts</option>
</select><br /><br />
<input type="submit" value="Submit" name="submit"/>
</form>
Upvotes: 0
Views: 8432
Reputation: 6051
You could check if the value of the submit control exists.
if(isset($_GET['submit']))
This way, when the form will be posted the $_GET['submit'] will have a value, then you can know that the form was posted.
Upvotes: 3
Reputation: 60
much easier to use .click() from jQuery to check but add a boolean field for submit in db
Upvotes: -1
Reputation: 944559
The submit button will be a successful control if it has been clicked. Check for the existence of a submit
key in the form data.
Upvotes: -1