Re: Can't read $_POST array

From: Date: Thu, 19 Aug 2010 00:35:46 +0000
Subject: Re: Can't read $_POST array
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-307554@lists.php.net to get a copy of this message
On Thu, Aug 19, 2010 at 7:41 AM, Daevid Vincent <daevid@daevid.com> wrote: > You've got something jacked. DO NOT proceed with your coding using this > hack. > > Put this in a blank file named whatever_you_want.php and hit it with your > web browser. > > --------------------------------------------------------------------------- > ----- > <?php if ($_POST['action'] == 'Go') print_r($_POST); ?> > > <form action="<?=$_SERVER['SCRIPT_NAME']?>" > method="POST"> >        <select name="my_select"> >                <option value="foo">foo</option> >                <option value="bar">bar</option> >        </select> >        <input type="submit" value="Go" name="action" > class="button > submit"/> > </form> > --------------------------------------------------------------------------- > ----- > >> -----Original Message----- >> From: Brian Dunning [mailto:brian@briandunning.com] >> Sent: Wednesday, August 18, 2010 2:23 PM >> To: PHP-General >> Subject: Re: [PHP] Can't read $_POST array >> >> This was the complete code of the page (this is the POST >> version not the REQUEST version): >> >> <?php >> $response = print_r($_POST, true); >> echo $response; >> ?> >> >> Returns an empty array no matter what POST vars are sent. We >> fixed it by changing it to this, which I've never even heard >> of, but so far is working perfectly: >> >> <?php >> $response = file_get_contents('php://input'); >> echo $response; >> ?> >> >> I have no idea what the problem was. Thanks to everyone for your help. >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Does what your posting contain any content like '<' '>' my guess is that you need to access the content using the filter_ functions. Andrew

« previous php.general (#307554) next »