Re: HTTP_GET_VARS[]

From: Date: Thu, 30 Jan 2003 16:44:44 +0000
Subject: Re: HTTP_GET_VARS[]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133666@lists.php.net to get a copy of this message
I am using PHP 4.3.0. it looks a little confusing because I am not using the $_POST when calling variables, but that is because before that script I have this. $title = $_POST['title']; $version = $_POST['version']; $developer = $_POST['developer']; $serial_number = $_POST['serial_number']; $platform = $_POST['platform']; For me it makes things easier to read. I changed what you said, and it still doesn't update anything. I even added echo $HTTP_POST_VARS['id']; to check to see if there was any value, but the echo statement doesn't return anything. Can I carry the HTTP_POST_VARS to another page, or do I need to use hidden fields or something? On Thursday, January 30, 2003, at 10:10 AM, Matt Schroebel wrote:
-----Original Message----- From: Mike Tuller [mailto:php@ce.anoka.k12.mn.us] Sent: Thursday, January 30, 2003 11:02 AM Subject: [PHP] HTTP_GET_VARS[]
The issue I am having now is that I have the editsoftwareassest.php's form action set to POST to a script called updatesoftwareasset.php that is supposed to take the values from the fields in editsoftwareasset.php and update the information. I have the following statement sent to the database. $query = "UPDATE assets SET title = '$title', version = '$version', developer = '$developer', serial_number = '$serial_number', WHERE asset_id = '$HTTP_GET_VARS[id]'" ;
Change the var to '{$HTTP_POST_VARS['id']}' (with the curly braces since the array reference is inside a double quoted string. If your version of php is 4.1.2 or higher, you really ought to use '{$_POST['id']}' since it's a magic global and easier to use since you won't have to declare it global inside functions.


« previous php.general (#133666) next »