Re: multiple entries for a variable passed with GET

From: Date: Thu, 30 Oct 2003 01:32:39 +0000
Subject: Re: multiple entries for a variable passed with GET
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168103@lists.php.net to get a copy of this message
I've got a form with a text entry list allowing the visitor to select more than one entry. The multiple entries are passed in the URL properly (see below) but the QUERY is only using the last one listed. What's up? URL being passed... http://www.cancerreallysucks.org/RobesonWeb/robeson1searchB.php?manufacturer=JUKI&manufacturer=REECE&manufacturer=WELDTRON&Submit=Submit
The problem is that $manufacture (or $_GET['manufacture']) is a scalar variable, meaning it can only have a single value. The last value assigned to it (WELDTRON) will override the others. Turn manufacture into an array (by making the HTML form input name "manufacture[]") and you'll be good to go. Larry

« previous php.general (#168103) next »