View Full Version : Resolved $_SERVER["REQUEST_METHOD"] with PHP_SELF and GET variable?

08-05-2012, 04:27 AM

I have a form in which uses:

<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:

if ($_SERVER["REQUEST_METHOD"] == "POST") { echo 'a'; }

it doesn't work :confused:

Anyway to fix this?

08-05-2012, 04:35 AM
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!