problem with isset($_POST['submit'])

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • backups2007
    New Member
    • Jul 2007
    • 92

    problem with isset($_POST['submit'])

    I tried using the isset() function in the system that I am developing. But for some reason, it just doesn't work. I've checked my code over and over but it idn't seem to have any error.

    i used something like this:
    [PHP]
    if(isset($_POST['submit']))
    {
    include("insert _form.php");
    }
    [/PHP]

    please help. it's really urgent. thanks in advance.
  • hello2008
    New Member
    • Dec 2007
    • 14

    #2
    Originally posted by backups2007
    I tried using the isset() function in the system that I am developing. But for some reason, it just doesn't work. I've checked my code over and over but it idn't seem to have any error.

    i used something like this:
    [PHP]
    if(isset($_POST['submit']))
    {
    include("insert _form.php");
    }
    [/PHP]

    please help. it's really urgent. thanks in advance.
    Hi,

    Have you checked the form from where your request is coming ..does it have action = "post" or is it "get"? Also check the name of the submit button.. is it exactly the same as what you have put in isset()? Have you said <input type = "submit" name = "submit"> ? Check these things once again.. Also, try putting an echo -statement in your if-condition... just to be sure whether the control is coming inside if or not..

    Comment

    • backups2007
      New Member
      • Jul 2007
      • 92

      #3
      it uses action="post".

      And the button connected to the script is an input type button with a validation script.

      Comment

      • hello2008
        New Member
        • Dec 2007
        • 14

        #4
        Originally posted by backups2007
        it uses action="post".

        And the button connected to the script is an input type button with a validation script.
        Hi,

        First of all, I have mistakenly written action = "post", its method = "post" ... sorry.. my bad!

        Coming to what you are saying.. well... I am no expert, but normally if you have only one submit-button in your form then it's input type is generally given 'submit' ..atleast from what I have seen.. try making the input type as 'submit' and see.. and let us know if it works!

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Yeh, i had this problem. If it's just a 'button' with then uses a javascript .submit() it won't be recognised in the isset.

          I'm not sure what the solution is either.

          Comment

          Working...