sending two values at once
Moderator: General Moderators
sending two values at once
what am i missing here??
<input type=hidden name=disks value='option1' and 'option2'>
<input type=hidden name=disks value='option1' and 'option2'>
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
acctually if your gonna use post in your form you could do this
once the form was submitted it would be like this
Code: Select all
<input type=hidden name=blah value="123&blah1=456">Code: Select all
URL: www.blah.com?blah=123&blah1=456- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
just checked on it real quick:dull1554 wrote:acctually if your gonna use post in your form you could do thisonce the form was submitted it would be like thisCode: Select all
<input type=hidden name=blah value="123&blah1=456">Code: Select all
URL: www.blah.com?blah=123&blah1=456
a value of "123&blah1=456" will change to "123%26blah1%3D456" in the submit.. resulting in:
$_GET['blah'] = '123&blah1=456';
The easiest way is to use a seperator in the value, then split on that back in your PHP. Using a hidden variable works, yet can create excessive overhead for what is a trivial operation.
which can be broken up in PHP like this:
Code: Select all
<input type=hidden name="blah" value="one|two|three">Code: Select all
list($one, $two, $three)=explode("|", $_GET["blah"], 3);