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 5 of 5

Thread: _POST in IE

  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    217
    Thanks
    9
    Thanked 0 Times in 0 Posts

    _POST in IE

    PHP Code:
    echo"<form action='game_questiontime.php?action=submitanswer' method='post'><input type='hidden' name='id' value='$qid'><input type='text' name='answer'><br><input type='submit' name='submitt' value='Submit'></form><br><br><b>Note: You only get one guess.</b><br></center></td></tr></table>";
    }

    if(
    $action == "submitanswer") {
    if(!isset(
    $_POST['submitt'])) {
    $input="No form.";
    error($input);
    }
    } ... 
    For some reason, when i submit the form in firefox it works, but when i submit it in IE it doesn't. Any ideas?

  • #2
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    note the spelling:
    if(!isset($_POST['submitt']))
    John

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by PappaJohn View Post
    note the spelling:
    if(!isset($_POST['submitt']))
    Yes, note the spelling:
    Quote Originally Posted by ole90 View Post
    Code:
    <input type='submit' name='submitt' value='Submit'>
    Quote Originally Posted by ole90 View Post
    For some reason, when i submit the form in firefox it works, but when i submit it in IE it doesn't. Any ideas?
    Change $action to $_GET['action'] for one. Also, you should be using double-quotes for your HTML code.
    Last edited by Inigoesdr; 12-28-2007 at 08:18 AM.

  • #4
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Quote Originally Posted by Inigoesdr View Post
    Yes, note the spelling:
    heh, my bad
    John

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,147
    Thanks
    2
    Thanked 333 Times in 325 Posts
    The action parameter is a $_GET anyway - game_questiontime.php?action=submitanswer One would hope that there is an assignment statement that is setting $action earlier in the code or that register globals are on, otherwise the code would never work for any browser.

    When a form works in one browser and not another it us usually due to invalid markup that one browser ignores so that it sees the form and the other browser sees as invalid so that it does not fully render the form.

    There are a bunch of table tags at the end of the posted echo statement. I suspect that the markup is invalid and is causing the form to not function in one of the browsers and/or there is something like invalid nested forms...

    BTW: The posted code works in IE and FF (accounting for the need to set $action = $_GET['action']). That would indicate that something else in the code is the problem.
    Last edited by CFMaBiSmAd; 12-28-2007 at 06:41 AM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

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