Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts

    Need to check if a form has been sumitted.

    for the form submit button i have

    PHP Code:
     <input class="send" type="image" src="images/submit.gif" name="submit" /></p
    but when i check for this condition it doesn't recognize it

    PHP Code:
     if(isset($_POST['submit'])) 
    Why is this and what other condition could i use..

    The above works if i change type image to type submit..

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    what I normally do is just add an action field to the form,

    so you could either have it in the form url like: action='MyPage.php?action=submit'
    or you could use a hidden field in the form, like: <input type='hidden' name='action' value='submit' />

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    I'm not sure why, but you can put this line right above it and check for it instead.

    <input type="hidden" name="verify" value="123">

    if($_POST['verify'] == "123"){


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •