RE: [PHP-WIN] GET / POST

From: Date: Mon, 09 Sep 2002 04:06:32 +0000
Subject: RE: [PHP-WIN] GET / POST
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15713@lists.php.net to get a copy of this message
Comments below... -----Original Message----- From: XXXPixie [mailto:lentenis@inbox.lv] Sent: 08 September 2002 09:52 To: php-windows@lists.php.net Subject: [PHP-WIN] GET / POST hi! I'm a total newbie to php4 or web design and i (of course) have a problem: i'm using apache 2.x and php4 as a module. so, when i use the GET method to pass data to my php script: script.php?x=5 i can't access it as a normal global variable: <?php print $x; ?> the only way i can get to it is: <?php print _GET['x'] ?> what's wrong? RG> PHP v4.2.x has register_globals set to Off by default which is why you have to access the _GET superglobal array - if security is not an issue then either switch on register_globals again or do something like extract($_GET) or extract($_REQUEST) at the top of your script... by the way, what's the difference between GET and POST methods anyway? RG> Very briefly .... http get method passes data via the query string/url, http post method data is sent via the http headers - post method is more secure (can't be tampered with easily) and can handle large data transmissions with binary data, get is bookmarkable but is limited in size and can be easily modified by a user... HTH RIch -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.windows (#15713) next »