Nuv Posted March 6, 2011 Share Posted March 6, 2011 Following is the form.Now i want to see if submit button is pressed or not.Usually if html had <input type="submit" value="Submit" name = "submit" /> i would simply use <?php if(isset($_POST['submit'])) ?> But below is the form which has an image as a submit button Form - <form action="" method="post" id="sendemail"> <ol> <li> <label for="name">Name (required)</label> <input id="name" name="name" class="text" /> </li> <li> <label for="email">Email Address (required)</label> <input id="email" name="email" class="text" /> </li> <li> <label for="email">Phone number</label> <input id="phone" name="phone" class="text" /> </li> <li> <label for="address">Address(required)</label> <input id="address" name="address" class="text" /> </li> <li> <label for="city">City(required)</label> <input id="city" name="city" class="text" /> </li> <li> <label for="state">State(required)</label> <input id="state" name="state" class="text"/> </li> <li> <label for="zipcode">Pincode/Zipcode(required)</label> <input id="zipcode" name="zipcode" class="text" /> </li> <li> <input type="image" name="submit" id="imageField" src="images/submit.gif" class="send" /> <div class="clr"></div> </li> </ol> </form> How should i check if form is submitted or not when instead of submit button there is an image ? ----------------------------------------------------------------- Alternative Solution ---------------------------------------------------------------------------- I tried sending it to other page but then i had to send an array back to this page and i didn't know how to send that either.I tried <?php $error = serialize($error); echo "<meta http-equiv='refresh' content='0;url=about.php?array=".$error."'> "; ?> But even after $array = unserialize($array); $array contained nothing. Can someone please show me how to send in array in between pages for future ? Quote Link to comment Share on other sites More sharing options...
flolam Posted March 6, 2011 Share Posted March 6, 2011 Google: "php check if form was submitted" -> first result -> if($_SERVER['REQUEST_METHOD'] == "POST") or <input type='hidden' name='submit' /> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.