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 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    85
    Thanks
    53
    Thanked 0 Times in 0 Posts

    $_SERVER["REQUEST_METHOD"] with PHP_SELF and GET variable?

    Hi!

    I have a form in which uses:

    PHP Code:
    <form action="<?php echo $_SERVER["PHP_SELF"] . "?m=results"?>" method="POST">
    in order to submit the form to itself (for php validation). It works fine, but when I try to use:

    PHP Code:
    <?php
    if ($_SERVER["REQUEST_METHOD"] == "POST") { echo 'a'; }
    it doesn't work

    Anyway to fix this?
    Last edited by RonnyNishimoto; 08-05-2012 at 04:34 AM.

  • #2
    New Coder
    Join Date
    Jul 2012
    Posts
    85
    Thanks
    53
    Thanked 0 Times in 0 Posts
    Woops. So sorry.

    I was staring at this for an hour, then I realized I had another $_SERVER[REQUEST_METHOD] at the top of the page which loaded the page.

    My bad!


  •  

    Posting Permissions

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