SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru augathra's Avatar
    Join Date
    Jul 2004
    Location
    united states
    Posts
    826
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post & IE forms =(

    Hi, i am using if(array_key_exists('submit', $_POST)) { to check if my form has been submitted. It seems as I have tried every script out there to submit my form once a user hits enter, and none were successful. I tried onKeyPress="this.form.submit()" too, im not real full of javascript, so I don't even know if this could ever work... and of course it didn't work. Form submits, but my PHP doesn't perform it's code. I have also tried if($_POST['submit']) { }, and that too was not successful. My form is below:

    Code:
    <form name="form1" method="post" action="">
      <table width="65%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td><b>Input</b>
    	    &nbsp; <input type="text" name="input" maxlength="125" class="input-style"> 
    	  </td>
        </tr>
      </table>
    </form>
    BTW, it works in firefox w/o any code.

    Thanks

  2. #2
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this way...
    PHP Code:
    if (isset($_POST['submit']))
    {
    ... 
    Lats...

  3. #3
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    Ukraine
    Posts
    245
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    add to the form
    <input type="hidden" name="_submit" value="1">

    and to the php
    if($_POST["_submit"])
    ...

  4. #4
    SitePoint Guru augathra's Avatar
    Join Date
    Jul 2004
    Location
    united states
    Posts
    826
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rightinpoint.com, that worked. Thanks


Bookmarks

Posting Permissions

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