RE: [PHP] HTTP_GET_VARS[]
| From: | Matt Schroebel | Date: | Thu, 30 Jan 2003 16:10:59 +0000 |
| Subject: | RE: [PHP] HTTP_GET_VARS[] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-133664@lists.php.net to get a copy of this message | ||
> -----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.