Re: help with explode.....

From: Date: Thu, 24 Jul 2003 17:48:04 +0000
Subject: Re: help with explode.....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156793@lists.php.net to get a copy of this message
> Okay... this probably isn't that hard to do... but I am just not sure to > do it... so i will ask you guys... i amsure someone is going to have a > one liner for me here! > > I am making a survey/poll builder everything is dynamic... there is an > admin section where the user can make the new survey.. and set certain > surveys as active.... but this where I am coming into some > difficulties.... the program builds the form dynamically... all radio > buttons... when the user submits the form i need to disect each form > answer and then dump it into MySQL... So I need to know if I can do > something like use the 'explode()' function no this... and assign them > to variables... I need to draw out the radio button id and what they > answered... I really don know whether i got ur question or not. Probably ur questions is abt fetching the radio buttons id and their corresponding values, when a form is submitted . Well if u have large number of radio buttons then give some common name to all of them. like radbut1, radbut2, radbut3 and so on................ so u know anything starting from "radbut" is your radio button .. now use $HTTP_POST_VARS or GET_VARS depending upon ur form method to retrieve the variables/values pairs. i.e while(list($key,$value) = each($HTTP_POST_VARS)) { if (eregi("radbut",$key)) // radio button // Carry out operations u want }

« previous php.general (#156793) next »