Re: mixing $_POST and $_GET vars

From: Date: Mon, 12 Sep 2005 13:26:35 +0000
Subject: Re: mixing $_POST and $_GET vars
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-222177@lists.php.net to get a copy of this message
If you are going to be accepting data, and you don't care or are not sure if it's going to be a GET or a POST, then use $_REQUEST, which contains both $_GET and $_POST data. On Sep 9, 2005, at 7:46 PM, bruce wrote:
hi.. quick question.. a basic link <a ref ="foo.php?a=1">blah</a> allows you to process the vars in foo.php using $_GET, easy/basic enough. however, if i have a form from cat.php that does a 'post' of the form information/input to the foo.php, i'm then going to have to either change the form to do a 'get' or else i'm going to have to do both a $_GET, and a $_POST within foo.php to access the vars from the pages that are interfacing with foo.php. is there an easier/cleaner/better approach?? or do i really need/wind up doing something like if ($_GET['foo'])... if ($_POST['apple'])... and just have a mix of both methods within the code... thanks -bruce bedouglas@earthlink.net --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577

« previous php.general (#222177) next »