dropfaith Posted October 30, 2008 Share Posted October 30, 2008 So i finally got radio buttons now its on to checkboxes how would i go about making a serilized array repopulate checkboxes? Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 30, 2008 Author Share Posted October 30, 2008 a:4:{i:0;s:31:"Soldiers, marines, paratroopers";i:1;s:37:"Sailors, coast guard, merchant marine";i:2;s:14:"Airmen, pilots";i:3;s:28:"Policewomen, security people";} is how the array is Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 30, 2008 Author Share Posted October 30, 2008 nothing i do works right i changes from serlize to implode Airmen, pilots,Policewomen, security people,Truck drivers <input type="checkbox" name="Archetypes[]" value="Soldiers, marines, paratroopers" <?php if ($row->Archetypes == 'Soldiers, marines, paratroopers') { echo 'selected="selected"'; } ?>/> Soldiers, marines, paratroopers <br /> <input type="checkbox" name="Archetypes[]" value="Sailors, coast guard, merchant marine" <?php if ($row->Archetypes == 'Sailors, coast guard, merchant marine"') { echo 'selected="selected"'; } ?>/> Sailors, coast guard, merchant marine <br /> <input type="checkbox" name="Archetypes[]" value="Airmen, pilots" <?php if ($row->Archetypes == 'Airmen, pilots') { echo 'selected="selected"'; } ?>/> Airmen, pilots <br /> <input type="checkbox" name="Archetypes[]" value="Policewomen, security people" <?php if ($row->Archetypes == 'Policewomen, security people') { echo 'selected="selected"'; } ?>/>Policewomen, security people <br /> <input type="checkbox" name="Archetypes[]" value="Truck drivers" <?php if ($row->Archetypes == 'Truck drivers') { echo 'selected="selected"'; } ?>/> Truck drivers <br /> <input type="checkbox" name="Archetypes[]" value="Firemen" <?php if ($row->Archetypes == 'Firemen') { echo 'selected="selected"'; } ?>/> Firemen <br /> <input type="checkbox" name="Archetypes[]" value="Executioners" <?php if ($row->Archetypes == 'Executioners') { echo 'selected="selected"'; } ?>/> Executioners <br /> <input type="checkbox" name="Archetypes[]" value="Nurses, doctors" <?php if ($row->Archetypes == 'Nurses, doctors') { echo 'selected="selected"'; } ?>/> Nurses, doctors <br /> <input type="checkbox" name="Archetypes[]" value="Prostitutes, tramps" <?php if ($row->Archetypes == 'Prostitutes, tramps') { echo 'selected="selected"'; } ?>/> Prostitutes, tramps <br /> <input type="checkbox" name="Archetypes[]" value="Cruel/abusive women" <?php if ($row->Archetypes == 'Cruel/abusive women') { echo 'selected="selected"'; } ?>/> Cruel/abusive women <br /> <input type="checkbox" name="Archetypes[]" value="Cowgirl" <?php if ($row->Archetypes == 'Cowgirl') { echo 'selected="selected"'; } ?>/> Cowgirl <br /> <input type="checkbox" name="Archetypes[]" value="Surfers, life guards" <?php if ($row->Archetypes == 'Surfers, life guards') { echo 'selected="selected"'; } ?>/> Surfers, life guards <br /> <input type="checkbox" name="Archetypes[]" value="Biker chicks" <?php if ($row->Archetypes == 'Biker chicks') { echo 'selected="selected"'; } ?>/> Biker chicks <br /> <input type="checkbox" name="Archetypes[]" value="Warrior/Wrestler" <?php if ($row->Archetypes == 'Warrior/Wrestler') { echo 'selected="selected"'; } ?>/> Warrior/Wrestler <br /> <input type="checkbox" name="Archetypes[]" value="Royalty, nobility" <?php if ($row->Archetypes == 'Royalty, nobility') { echo 'selected="selected"'; } ?>/> Royalty, nobility <br /> <input type="checkbox" name="Archetypes[]" value="Business people. managers, the boss" <?php if ($row->Archetypes == 'Business people. managers, the boss') { echo 'selected="selected"'; } ?>/> Business people, managers, "the boss." <br /> <input type="checkbox" name="Archetypes[]" value="Divas " <?php if ($row->Archetypes == 'Divas') { echo 'selected="selected"'; } ?>/> Divas <br /> <input type="checkbox" name="Archetypes[]" value="Teachers" <?php if ($row->Archetypes == 'Teachers') { echo 'selected="selected"'; } ?>/> Teachers <br /> <input type="checkbox" name="Archetypes[]" value="Daddy" <?php if ($row->Archetypes == 'Daddy') { echo 'selected="selected"'; } ?>/> Daddy <br /> <input type="checkbox" name="Archetypes[]" value="Mommy" <?php if ($row->Archetypes == 'Mommy') { echo 'selected="selected"'; } ?>/> Mommy Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 30, 2008 Share Posted October 30, 2008 The value parameter is just the value that the form sends when the checkbox is checked. To check a checkbox (and a radio button) - http://www.w3schools.com/tags/att_input_checked.asp Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 31, 2008 Author Share Posted October 31, 2008 right but i need to do it dynamic from database your link showed me basic html> Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 31, 2008 Share Posted October 31, 2008 Hmm. I did not scroll over in your code far enough. You are echoing selected="selected" It should be checked="checked" Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 31, 2008 Author Share Posted October 31, 2008 okay fixed that but it didnt help i need to figure out how to get it from the array imploded comma delimiter? Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 31, 2008 Author Share Posted October 31, 2008 okay so this is the entire form if anyone can walk me thru getting one set of checkboxes working with this form the rest is cake but i cant fiqure this out at all <?php include("header.php"); $u = $_SESSION['username']; $uid = $_SESSION['loginid']; $query = "SELECT * FROM Alice WHERE loginid = '$uid'"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); $Archetypes = explode(',',$result[1]); for ($i="0"; $i<count($Archetypes); $i++) { if(empty($Archetypes[$i])) {unset($Archetypes[$i]);} } // if records present if (mysql_num_rows($result) > 0) { // iterate through resultset // print article titles while($row = mysql_fetch_object($result)) { ?> <br><br><B>Be sure to fill out this form in its entirety.</b><br><br> <form id="myform" class="cssform" action="editform.php" method="POST"> <!-- DO NOT change ANY of the php sections --> <input type="hidden" name="Loginid" value="<?php echo $row->uid;?>" /> <p> <label for="user">My legal name is:</label> <input size="25" name="Name" value="<?php echo $row->Name;?>" /> <br /><br /> </p><p> <label for="user">The name I go by during play is:</label> <input size="25" name="NameDuringPlay" value="<?php echo $row->NameDuringPlay;?>" /> <br /><br /> </p><p> <label for="user">My phone number is: </label> <input size="25" name="Phonenumber" value="<?php echo $row->Phonenumber;?>"/> <br /><br /> </p><p> <label for="user">My email address is: </label> <input size="25" name="EmailAddress" value="<?php echo $row->EmailAddress;?>" /> <br /><br /> </p><p> <label for="user">Verify your email address -- please type carefully!</label> <input size="25" name="VerifyEmail" value="<?php echo $row->EmailAddress;?>" /> <br /><br /> </p><p> <label for="user">I heard about Miss Alice from: </label> <input size="25" name="WhereDidYouHearOfMissAlice" value="<?php echo $row->WhereDidYouHearOfMissAlice;?>" /> <br /><br /> </p><p> <label for="user">I am located in:</label> <input size="25" name="Location" value="<?php echo $row->Location;?>" /> <br /><br /> </p><p> <label for="user">How long of a session are you looking for? </label> <input size="25" name="LengthOfSession" value="<?php echo $row->LengthOfSession;?>" /> <br /><br /> </p><p> <label for="user">When would you like to schedule a session (date/time)</label> <input size="25" name="WhenWouldYouLikeaSession" value="<?php echo $row-> WhenWouldYouLikeASession;?>" /> <br /><br /> </p><p> <label for="user"><strong>I am mainly into:</strong> </label><br /> <input type="radio" name="Intoo" value="D/s"<?php if ($row->Intoo == 'D/s') { echo 'checked="checked"'; } ?>>D/s <br /> <input type="radio" name="Intoo" value="Sadism"<?php if ($row->Intoo == 'Sadism') { echo 'checked="checked"'; } ?>>Sadism <br /> <input type="radio" name="Intoo" value="Masochism"<?php if ($row->Intoo == 'Masochism') { echo 'checked="checked"'; } ?>>Masochism <br /> <input type="radio" name="Intoo" value="Bondage"<?php if ($row->Intoo == 'Bondage') { echo 'checked="checked"'; } ?>>Bondage <br /> <input type="radio" name="Intoo" value="Fetish"<?php if ($row->Intoo == 'Fetish') { echo 'checked="checked"'; } ?>>Fetish <br /> <input type="radio" name="Intoo" value="Power Exchange"<?php if ($row->Intoo == 'Power Exchange') { echo 'checked="checked"'; } ?>>Power Exchange <br /><br /> </p><p> <label for="user"><strong>Visible bruises/cuts/marks must be avoided:</strong> </label> <br /> <input type="radio" name="Marks" value="No marks"<?php if ($row->Marks == 'No marks') { echo 'checked="checked"'; } ?>>Yes <br /> <input type="radio" name="Marks" value="Doesnt matter"<?php if ($row->Marks == 'Doesnt matter') { echo 'checked="checked"'; } ?>>No, it doesn't matter if I am marked or not. <br /> <input type="radio" name="Marks" value="Please leave marks"<?php if ($row->Marks == 'Please leave marks') { echo 'checked="checked"'; } ?>>No, I want to have marks. <br /> <br /><br /> </p><p> <label for="user"><strong>Have you taken any medications, including Aspirin within the last 4 - 6 hours.</strong> Please include any prescription medication you are on. </label> <input size="25" name="Medications" value="<?php echo $row->Medications;?>" /> <br /><br /><br /><br /> </p><p> <label for="user"><strong>No hit zone, if any:</strong></label> <input size="25" name="NoHitZone" value="<?php echo $row->NoHitZone;?>" /> <br /><br /> </p><p> <label for="user"><strong>Phobias or any relevant psychological issues:</strong></label> <input size="25" name="Phobias" value="<?php echo $row->Phobias;?>" /> <br /><br /></p><p> <label for="user"><strong>Anything else important you would like to note:</label> <input size="25" name="OtherThoughts" value="<?php echo $row->OtherThoughts;?>" /> <br /><br /></p><p> <label for="user"> Have you done this before? </label><br /> </strong><input type="radio" name="Experience" value="I have seen a pro-Domme"<?php if ($row->Experience == 'I have seen a pro-Domme') { echo 'checked="checked"'; } ?>> I have seen a pro-Domme. <br /> <input type="radio" name="Experience" value="I have played a little privately."<?php if ($row->Experience == 'I have played a little privately.') { echo 'checked="checked"'; } ?>> I have played a little privately. <br /> <input type="radio" name="Experience" value="I have never done this, ever."<?php if ($row->Experience == 'I have never done this, ever. ') { echo 'checked="checked"'; } ?>> I have never done this, ever. <br /><br /></p><p> <label for="user"><strong>I want aftercare.</strong> </label><br /><br /> <input type="radio" name="Aftercare" value="Yes"<?php if ($row->AfterCare == 'Yes') { echo 'checked="checked"'; } ?> /> Yes <input type="radio" name="Aftercare" value="No"<?php if ($row->AfterCare == 'No') { echo 'checked="checked"'; } ?> /> No <br /><br /></p><p> <label for="user"><strong>I like to talk after a scene.</strong> </label><br /> <input type="radio" name="Talkafter" value="Yes"<?php if ($row->TalkAfter == 'Yes') { echo 'checked="checked"'; } ?> />Yes <input type="radio" name="Talkafter" value="No"<?php if ($row->TalkAfter == 'No') { echo 'checked="checked"'; } ?> />No <br /><br /></p><p> <label for="user"><strong>I want extensive verbal communication during a scene.</strong> </label><br /> <input type="radio" name="Communication" value="Yes" <?php if ($row->Communication == 'Yes') { echo 'checked="checked"'; } ?> /> Yes <input type="radio" name="Communication" value="No" <?php if ($row->Communication == 'No') { echo 'checked="checked"'; } ?> /> No <br /><br /></p><p> <label for="user"><strong>I want music during the scene. </strong> </label><br /> <input type="radio" name="Music" value="Yes"<?php if ($row->Music == 'Yes') { echo 'checked="checked"'; } ?> /> Yes <input type="radio" name="Music" value="No"<?php if ($row->Music == 'No') { echo 'checked="checked"'; } ?> /> No <br /><br /></p><p> <label for="user"><strong>Musical preferences:</strong></label> <input size="25" name="MusicalPreferance" value="<?php echo $row->MusicalPreferance;?>" /> <br /><br /></p><p> <label for="user">Any specific types of people that turn you on?</strong> </label><br /> <input type="checkbox" name="Archetypes[]" value="Soldiers, marines, paratroopers" <?php if(in_array("Soldiers, marines, paratroopers", $Archetypes)) {echo ' checked';} ?> /> Soldiers, marines, paratroopers <br /> <input type="checkbox" name="Archetypes[]" value="Sailors, coast guard, merchant marine" <?php if(in_array("Sailors, coast guard, merchant marine', $Archetypes)) {echo 'checked="checked"';} ?>/> Sailors, coast guard, merchant marine <br /> <input type="checkbox" name="Archetypes[]" value="Airmen, pilots" <?php if(in_array("Airmen, pilots', $Archetypes)) {echo 'checked="checked"';} ?>/> Airmen, pilots <br /> <input type="checkbox" name="Archetypes[]" value="Policewomen, security people" <?php if(in_array("Policewomen, security people', $Archetypes)) {echo 'checked="checked"';} ?>/>Policewomen, security people <br /> <input type="checkbox" name="Archetypes[]" value="Truck drivers" <?php if(in_array("Truck drivers', $Archetypes)) {echo 'checked="checked"';} ?>/> Truck drivers <br /> <input type="checkbox" name="Archetypes[]" value="Firemen" <?php if(in_array("Firemen', $Archetypes)) {echo 'checked="checked"';} ?>/> Firemen <br /> <input type="checkbox" name="Archetypes[]" value="Executioners" <?php if(in_array("Executioners', $Archetypes)) {echo 'checked="checked"';} ?>/> Executioners <br /> <input type="checkbox" name="Archetypes[]" value="Nurses, doctors" <?php if(in_array("Nurses, doctors', $Archetypes)) {echo 'checked="checked"';} ?>/> Nurses, doctors <br /> <input type="checkbox" name="Archetypes[]" value="Prostitutes, tramps" <?php if(in_array("Prostitutes, tramps', $Archetypes)) {echo 'checked="checked"';} ?>/> Prostitutes, tramps <br /> <input type="checkbox" name="Archetypes[]" value="Cruel/abusive women" <?php if(in_array("Cruel/abusive women', $Archetypes)) {echo 'checked="checked"';} ?>/> Cruel/abusive women <br /> <input type="checkbox" name="Archetypes[]" value="Cowgirl" <?php if(in_array("Cowgirl', $Archetypes)) {echo 'checked="checked"';} ?>/> Cowgirl <br /> <input type="checkbox" name="Archetypes[]" value="Surfers, life guards" <?php if(in_array("Surfers, life guards', $Archetypes)) {echo 'checked="checked"';} ?>/> Surfers, life guards <br /> <input type="checkbox" name="Archetypes[]" value="Biker chicks" <?php if(in_array("Biker chicks', $Archetypes)) {echo 'checked="checked"';} ?>/> Biker chicks <br /> <input type="checkbox" name="Archetypes[]" value="Warrior/Wrestler" <?php if(in_array("Warrior/Wrestler', $Archetypes)) {echo 'checked="checked"';} ?>/> Warrior/Wrestler <br /> <input type="checkbox" name="Archetypes[]" value="Royalty, nobility" <?php if(in_array("Royalty, nobility', $Archetypes)) {echo 'checked="checked"';} ?>/> Royalty, nobility <br /> <input type="checkbox" name="Archetypes[]" value="Business people. managers, the boss" <?php if(in_array("Business people. managers, the boss', $Archetypes)) {echo 'checked="checked"';} ?>/> Business people, managers, "the boss." <br /> <input type="checkbox" name="Archetypes[]" value="Divas " <?php if(in_array("Divas', $Archetypes)) {echo 'checked="checked"';} ?>/> Divas <br /> <input type="checkbox" name="Archetypes[]" value="Teachers" <?php if(in_array("Teachers', $Archetypes)) {echo 'checked="checked"';} ?>/> Teachers <br /> <input type="checkbox" name="Archetypes[]" value="Daddy" <?php if(in_array("Daddy', $Archetypes)) {echo 'checked="checked"';} ?>/> Daddy <br /> <input type="checkbox" name="Archetypes[]" value="Mommy" <?php if(in_array("Mommy', $Archetypes)) {echo 'checked="checked"';} ?>/> Mommy <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="OtherNames" value="<?php echo $row->OtherNames;?>" /> <br /><br /></p><p> <label for="user">Which of the following scenes would turn you on?</strong> </label><br /> <input type="checkbox" name="Scenes[]" value="Having a romantic dinner by candlelight " /> Having a romantic dinner by candlelight <br /> <input type="checkbox" name="Scenes[]" value="I am spanked because I have been a naughty boy or girl " /> I am spanked because I have been a naughty boy or girl <br /> <input type="checkbox" name="Scenes[]" value="I am in the woods and suddenly an attacker comes from behind and grabs me" /> I am in the woods and suddenly an attacker comes from behind and grabs me <br /> <input type="checkbox" name="Scenes[]" value="A stranger walks into my bedroom and finds me playing with myself " /> A stranger walks into my bedroom and finds me playing with myself <br /> <input type="checkbox" name="Scenes[]" value="I am sold on a slave market " /> I am are sold on a slave market <br /> <input type="checkbox" name="Scenes[]" value="I am a foot slave, forced to care for my Mistress' feet" /> I am a foot slave, forced to care for my Mistress' feet <br /> <input type="checkbox" name="Scenes[]" value="I am a piece for furniture, only useful as a tabletop, etc " /> I am a piece for furniture, only useful as a tabletop, etc <br /> <input type="checkbox" name="Scenes[]" value="I am forced to behave as a gender I am not" /> I am forced to behave as a gender I am not <br /> <input type="checkbox" name="Scenes[]" value="I am a dirty slut and must be punished" /> I am a dirty slut and must be punished <br /> <input type="checkbox" name="Scenes[]" value="I am used as a slave in public " /> I am used as a slave in public <br /> <input type="checkbox" name="Scenes[]" value="I am used as a slave in private" /> I am used as a slave in private <br /> <input type="checkbox" name="Scenes[]" value=" I am ordered to please others" /> I am ordered to please others <br /> <input type="checkbox" name="Scenes[]" value="I am a little schoolgirl or schoolboy " /> I am a little schoolgirl or schoolboy <br /> <input type="checkbox" name="Scenes[]" value="I am sitting/kneeling at my Mistress' feet" /> I am sitting/kneeling at my Mistress' feet <br /> <input type="checkbox" name="Scenes[]" value="I am are tied and teased" /> I am are tied and teased <br /> <input type="checkbox" name="Scenes[]" value="I am grabbed by the hair and dragged into the bedroom" /> I am grabbed by the hair and dragged into the bedroom <br /> <input type="checkbox" name="Scenes[]" value="I am used as a dog, pony or pet" /> I am used as a dog, pony or pet <br /> <input type="checkbox" name="Scenes[]" value="I am verbally humiliated" /> I am verbally humiliated <br /> <input type="checkbox" name="Scenes[]" value=" I am tied, gagged and blindfolded and left alone" /> I am tied, gagged and blindfolded and left alone <br /> <input type="checkbox" name="Scenes[]" value="I am tied, gagged, blindfolded and thoroughly whipped" /> I am tied, gagged, blindfolded and thoroughly whipped <br /> <input type="checkbox" name="Scenes[]" value="My physical limits are tested and stretched" /> My physical limits are tested and stretched <br /> <input type="checkbox" name="Scenes[]" value="My mental limits are tested and stretched" /> My mental limits are tested and stretched <br /> <input type="checkbox" name="Scenes[]" value="I am a total slave every day of the week" /> I am a total slave every day of the week <br /> <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="Otherscenes" value="<?php echo $row->OtherScenes;?>" /> <br /><br /></p><p> <label for="user"> <strong>Is there any particular clothing or fabric that turns you on?</strong> </label><br /> <input type="checkbox" name="Clothing[]" value="Leather " /> Leather <br /> <input type="checkbox" name="Clothing[]" value="Rubber, latex" /> Rubber, latex <br /> <input type="checkbox" name="Clothing[]" value="Patent leather, PVC" /> Patent leather, PVC <br /> <input type="checkbox" name="Clothing[]" value="Sexy lingerie" /> Sexy lingerie <br /> <input type="checkbox" name="Clothing[]" value=" Uniforms" /> Uniforms <br /> <input type="checkbox" name="Clothing[]" value="Denim" /> Denim <br /> <input type="checkbox" name="Clothing[]" value="High Heels" /> High Heels<br /> <input type="checkbox" name="Clothing[]" value="Boots" /> Boots <br /> <input type="checkbox" name="Clothing[]" value="Wet suits" /> Wet suits <br /> <input type="checkbox" name="Clothing[]" value="Servants uniform" /> Servants uniform <br /> <input type="checkbox" name="Clothing[]" value="Masks" /> Masks <br /> <input type="checkbox" name="Clothing[]" value=" Dirty socks or shoes " /> Dirty socks or shoes <br /> <input type="checkbox" name="Clothing[]" value="Worn panties" /> Worn panties <br /> <input type="checkbox" name="Clothing[]" value="Crossdressing" /> Crossdressing <br /> <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="OtherClothing" value="<?php echo $row->OtherClothing;?>" /> <br /><br /></p><p> <label for="user"><strong>Do any of the following environments or scenery turn you on?</strong> </label><br /><br /> <input type="checkbox" name="SceneLocations[]" value="Your bedroom" /> Your bedroom <br /> <input type="checkbox" name="SceneLocations[]" value="A dungeon, castle" /> A dungeon, castle <br /> <input type="checkbox" name="SceneLocations[]" value="Churches and abbeys" /> Churches and abbeys<br /> <input type="checkbox" name="SceneLocations[]" value="Farms and stables" /> Farms and stables <br /> <input type="checkbox" name="SceneLocations[]" value="Barracks" /> Barracks <br /> <input type="checkbox" name="SceneLocations[]" value="Abandoned construction sites" /> Abandoned construction sites<br /> <input type="checkbox" name="SceneLocations[]" value="Back alleys" /> Back alleys <br /> <input type="checkbox" name="SceneLocations[]" value="The red light district" /> The red light district <br /> <input type="checkbox" name="SceneLocations[]" value="A school or a classroom" /> A school or a classroom <br /> <input type="checkbox" name="SceneLocations[]" value="BDSM-clubs" /> BDSM-clubs <br /> <input type="checkbox" name="SceneLocations[]" value="Estates/Mano" /> Estates/Manor <br /> <input type="checkbox" name="SceneLocations[]" value="Junkyards and car dumps" /> Junkyards and car dumps <br /> <input type="checkbox" name="SceneLocations[]" value="Woods and forests" /> Woods and forests <br /> <input type="checkbox" name="SceneLocations[]" value="Medieval scenery" /> Medieval scenery <br /> <input type="checkbox" name="SceneLocations[]" value="Nudist beaches" /> Nudist beaches <br /> <input type="checkbox" name="SceneLocations[]" value="Parking spaces" /> Parking spaces <br /> <input type="checkbox" name="SceneLocations[]" value="Truck stops" /> Truck stops <br /> <input type="checkbox" name="SceneLocations[]" value="The bath room" /> The bath room <br /> <input type="checkbox" name="SceneLocations[]" value="Hospital, dentist" /> Hospital, dentist <br /> <input type="checkbox" name="SceneLocations[]" value="Interrogation room" /> Interrogation room <br /> <input type="checkbox" name="SceneLocations[]" value="The shrink's couch" /> The shrink's couch <br /> <input type="checkbox" name="SceneLocations[]" value="Boot camp" /> Boot camp <br /> <input type="checkbox" name="SceneLocations[]" value="Jail, police station " /> Jail, police station <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="OtherSceneLocations" value="<?php echo $row->OtherSceneLocations;?>" /> <br /><br /></p><p> <label for="user"><strong>I enjoy the following psychological play:</strong> </label> <br /> <input type="checkbox" name="Psychologicalplay[]" value="The dominant talks, the submissive is silent or speaks only when spoken to" /> The dominant talks, the submissive is silent or speaks only when spoken to <br /> <input type="checkbox" name="Psychologicalplay[]" value="Dialogue in normal language" /> Dialogue in normal language <br /> <input type="checkbox" name="Psychologicalplay[]" value="Dialogue in adapted language" /> Dialogue in adapted language (Strict slave protocol) <br /> <input type="checkbox" name="Psychologicalplay[]" value="Obey rules or else" /> Obey rules or else <br /> <input type="checkbox" name="Psychologicalplay[]" value="Reasonable rules" /> Reasonable rules <br /> <input type="checkbox" name="Psychologicalplay[]" value="Unreasonable rules" /> Unreasonable rules <br /> <input type="checkbox" name="Psychologicalplay[]" value="It is OK for the Mistress to lose her temper" /> It is OK for the Mistress to lose her temper <br /> <input type="checkbox" name="Psychologicalplay[]" value="Swearing and filthy talk" /> Swearing and filthy talk <br /> <input type="checkbox" name="Psychologicalplay[]" value="Military/jail type commands" /> Military/jail type commands <br /> <input type="checkbox" name="Psychologicalplay[]" value="Strict training" /> Strict training <br /> <input type="checkbox" name="Psychologicalplay[]" value="Obvious and explicit role play" /> Obvious and explicit role play <br /> <input type="checkbox" name="Psychologicalplay[]" value="Subtle role play" /> Subtle role play <br /> <input type="checkbox" name="Psychologicalplay[]" value="I like to be persuaded, rather than commanded" /> I like to be persuaded, rather than commanded <br /> <input type="checkbox" name="Psychologicalplay[]" value="Make me feel guilty" /> Make me feel guilty <br /> <input type="checkbox" name="Psychologicalplay[]" value="Make me feel cheap" /> Make me feel cheap <br /> <input type="checkbox" name="Psychologicalplay[]" value="Make me feel used" /> Make me feel used <br /> <input type="checkbox" name="Psychologicalplay[]" value="Make me feel owned " /> Make me feel owned <br /> <input type="checkbox" name="Psychologicalplay[]" value="Make me feel useless" /> Make me feel useless <br /> <input type="checkbox" name="Psychologicalplay[]" value="Make me feel frightened" /> Make me feel frightened <br /> <input type="checkbox" name="Psychologicalplay[]" value="Objectify me" /> Objectify me <br /> <input type="checkbox" name="Psychologicalplay[]" value="The dominant must have compassion" /> The dominant must have compassion <br /> <input type="checkbox" name="Psychologicalplay[]" value="The dominant must have no compassion at all" /> The dominant must have no compassion at all <br /> <input type="checkbox" name="Psychologicalplay[]" value="The dominant must only have compassion after the scene" /> The dominant must only have compassion after the scene <br /><br /></p><p> <label for="user"> Others, please specify: </label> <input size="25" name="OtherPsychologicalplay" value="<?php echo $row->OtherPsychologicalplay;?>" /> <br /><br /></p><p> <label for="user"><strong>Sex and sexuality</strong> </label><br /> <input type="checkbox" name="Sexuality[]" value="I need to be sexually aroused when in scene" /> I need to be sexually aroused when in scene <br /> <input type="checkbox" name="Sexuality[]" value=" I need to be sexually aroused before I enter into a scene " /> I need to be sexually aroused before I enter into a scene <br /> <input type="checkbox" name="Sexuality[]" value="An orgasm turns me off" /> An orgasm turns me off <br /> <input type="checkbox" name="Sexuality[]" value="An orgasm must only be allowed as a reward " /> An orgasm must only be allowed as a reward <br /> <input type="checkbox" name="Sexuality[]" value="An orgasm is the best way to end the scene" /> An orgasm is the best way to end the scene<br /> <input type="checkbox" name="Sexuality[]" value="Orgasms are not important, but nice" /> Orgasms are not important, but nice <br /> <input type="checkbox" name="Sexuality[]" value="Orgasms are not important at all" /> Orgasms are not important at all <br /> <input type="checkbox" name="Sexuality[]" value="I want to beg for an orgasm first" /> I want to beg for an orgasm first <br /> <input type="checkbox" name="Sexuality[]" value="I want my sexual abilities to be stretched" /> I want my sexual abilities to be stretched <br /> <input type="checkbox" name="Sexuality[]" value="I desire strap on play as a form of release" /> I desire strap on play as a form of release <br /> <input type="checkbox" name="Sexuality[]" value="I am not comfortable with strap-on play or insertion of any kind" /> I am not comfortable with strap-on play or insertion of any kind <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="OtherSexuality" value="<?php echo $row->OtherSexuality;?>" /> <br /><br /></p><p> <label for="user"><strong>I love the following attributes</strong> </label><br /> <input type="checkbox" name="Equipment[]" value="Ropes" /> Ropes <br /> <input type="checkbox" name="Equipment[]" value="Leather cuffs and belts" /> Leather cuffs and belts <br /> <input type="checkbox" name="Equipment[]" value="Steel cuffs and chains" /> Steel cuffs and chains <br /> <input type="checkbox" name="Equipment[]" value="Ball and chain" /> Ball and chain <br /> <input type="checkbox" name="Equipment[]" value="Blindfold" /> Blindfold <br /> <input type="checkbox" name="Equipment[]" value="Gags" /> Gags <br /> <input type="checkbox" name="Equipment[]" value="Masks" /> Masks <br /> <input type="checkbox" name="Equipment[]" value="Nipple clamps and clothespins" /> Nipple clamps and clothespins <br /> <input type="checkbox" name="Equipment[]" value="Whips" /> Whips <br /> <input type="checkbox" name="Equipment[]" value="Riding crops" /> Riding crops <br /> <input type="checkbox" name="Equipment[]" value="Canes" /> Canes <br /> <input type="checkbox" name="Equipment[]" value="Silk to be tied with" /> Silk to be tied with <br /> <input type="checkbox" name="Equipment[]" value="Sex toys (vibrators, butt plugs)" /> Sex toys (vibrators, butt plugs) <br /> <input type="checkbox" name="Equipment[]" value="Needles and pins" /> Needles and pins <br /> <input type="checkbox" name="Equipment[]" value="Cross, rack" /> Cross, rack <br /> <input type="checkbox" name="Equipment[]" value="Bondage table" /> Bondage table <br /> <input type="checkbox" name="Equipment[]" value="Cage" /> Cage <br /> <input type="checkbox" name="Equipment[]" value="Sling" /> Sling <br /> <input type="checkbox" name="Equipment[]" value="Body bag" /> Body bag <br /> <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="OtherEquipment" value="<?php echo $row->OtherEquipment;?>" /> <br /><br /></p><p> <label for="user"><strong>The following scenes appeal to me:</strong> </label><br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up, caressed and loved" /> Being tied up, caressed and loved <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being in a public place and dominated in a subtle way" /> Being in a public place and dominated in a subtle way <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being taken out with collar and leash" /> Being taken out with collar and leash <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being locked up and left alone" /> Being locked up and left alone <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up in a comfortable position" /> Being tied up in a comfortable position<br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up in discomfort" /> Being tied up in discomfort <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up and (in a sexual way) exposed" /> Being tied up and (in a sexual way) exposed <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up and tickled" /> Being tied up and tickled <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up and teased" /> Being tied up and teased <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied up and whipped, flogged or caned" /> Being tied up and whipped, flogged or caned <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Mild CBT" /> Mild CBT <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Extreme CBT" /> Extreme CBT <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Not being tied up, but verbally commanded into certain positions and having to maintain these" /> Not being tied up, but verbally commanded into certain positions and having to maintain these <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Caned, flogged or whipped without being tied or cuffe" /> Caned, flogged or whipped without being tied or cuffed <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being spanked in the traditional way" /> Being spanked in the traditional way <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Rough sex/being play-raped" /> Rough sex/being "raped" <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Used as a servant" /> Used as a servant <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tied and tortured" /> Being tied and tortured <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being tortured without being tied or cuffed" /> Being tortured without being tied or cuffed <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Being used by more than one dominant" /> Being used by more than one dominant <br /> <input type="checkbox" name="ScenesEnjoyed[]" value="Playing in combination with other slaves" /> Playing in combination with other slaves <br /><br /></p><p><br /> <label for="user"> Others, please specify: </label> <input size="25" name="OtherScenesEnjoyed" value="<?php echo $row->OtherScenesEnjoyed;?>" /> <br /><br /></p><p> <label for="user"><strong>Safe words and signals</strong> </label><br /> <input type="checkbox" name="Safewords[]" value="The dominant should establish one or more safe words" /> The dominant should establish one or more safe words <br /> <input type="checkbox" name="Safewords[]" value="When I cry, the scene should stop" /> When I cry, the scene should stop <br /> <input type="checkbox" name="Safewords[]" value="I should be able to communicate in plain language" /> I should be able to communicate in plain language <br /> <input type="checkbox" name="Safewords[]" value="The dominant should be able to read my body language" /> The dominant should be able to read my body language <br /> <input type="checkbox" name="Safewords[]" value="I want to be tested until I use a safe word or signal" /> I want to be tested until I use a safe word or signal <br /> <input type="checkbox" name="Safewords[]" value="All activity should stop immediately when I use a safe word or signal" /> All activity should stop immediately when I use a safe word or signal <br /> <input type="checkbox" name="Safewords[]" value="I do not want to use any safe word at all and my signals should be ignored completely" /> I do not want to use any safe word at all and my signals should be ignored completely <br /> <input type="checkbox" name="Safewords[]" value="When I use a safe word or signal the dominant should establish if the scene can continue" /> When I use a safe word or signal the dominant should establish if the scene can continue <br /> <input type="checkbox" name="Safewords[]" value="A scene should go on up to the point where I use a safe word or signal" /> A scene should go on up to the point where I use a safe word or signal <br /> <input type="checkbox" name="Safewords[]" value="The use of safe words and signals should be avoided as much as possible" /> The use of safe words and signals should be avoided as much as possible <br /><br /></p><p> <label for="user">Others, please specify: </label> <input size="25" name="OtherSafeWords" value="<?php echo $row->OtherSafewords;?>" /> <br /><br /></p><p> <label for="user"><strong>To me erotic power exchange is:</strong> </label><br /> <input type="checkbox" name="PowerExchange[]" value="Something I like incidentally, just as a kick" /> Something I like incidentally, just as a kick <br /> <input type="checkbox" name="PowerExchange[]" value="Something I like, but not too often" /> Something I like, but not too often <br /> <input type="checkbox" name="PowerExchange[]" value="Something I want as much as possible " /> Something I want as much as possible <br /> <input type="checkbox" name="PowerExchange[]" value="A lifestyle that I consider important and want to practice as much as possible " /> A lifestyle that I consider important and want to practice as much as possible <br /> <input type="checkbox" name="PowerExchange[]" value="A lifestyle that should be present at all times" /> A lifestyle that should be present at all times <br /> <input type="checkbox" name="PowerExchange[]" value="My way of life " /> My way of life <br /> <input type="checkbox" name="PowerExchange[]" value="The most important thing I can think of " /> The most important thing I can think of <br /> <input type="checkbox" name="PowerExchange[]" value="Something I want exercised at all times and no matter what the consequences are. " /> Something I want exercised at all times and no matter what the consequences are. <br /><br /></p><p> <label for="user"> Others, please specify: </label> <input size="25" name="OtherPowerExchange" value="<?php echo $row->OtherPowerExchange;?>" /> <br /><br /></p><p> <label for="user"> List any absolute turn offs </label> <input size="25" name="TurnOffs" value="<?php echo $row->TurnOffs;?>" /> <br /><br /></p><p> <div style="margin-left:175px;"> <input type="submit" value="Submit" /> <input type="reset" value="reset" /> </div><br /></p> </form> Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 31, 2008 Share Posted October 31, 2008 Let's make your life easier and put all the options in an array as well: <?php $checkOptions = array ( 'Soldiers, marines, paratroopers', 'Sailors, coast guard, merchant marine', 'Airmen, pilots', 'Policewomen, security people', 'Truck drivers', 'Firemen', 'Executioners', 'Nurses, doctors', 'Prostitutes, tramps', 'Cruel/abusive women', 'Cowgirl', 'Surfers, life guards', 'Biker chicks', 'Warrior/Wrestler', 'Royalty, nobility', 'Business people. managers, the boss', 'Divas', 'Teachers', 'Daddy', 'Mommy' ); foreach ($checkOptions as $option) { $selected = (in_array($option, $row->Archetypes)) ? ' selected="selected"' : ''; echo "<input type=\"checkbox\" name=\"Archetypes[]\" value=\"$option\"$selected />$option<br />\n"; } ?> Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 31, 2008 Author Share Posted October 31, 2008 wow thats going to be way eaiser to navigate my code once i do all of them it didnt select them i hate to ask this but you think you could tag one up in working order from that db just so i have something to work from whats yours did was just display all the check boxes none selected Airmen, pilots,Policewomen, security people,Truck drivers are the selected options in the db for the Userid ive been at this all day and i am going insane not having it right yet Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 31, 2008 Share Posted October 31, 2008 Sorry, I forgot you were working with a serialized array - and I had some typos. Here is a working piece of code using the value you posted in the beginning: <?php //Create the array of selected values $selected_values_serial = 'a:4:{i:0;s:31:"Soldiers, marines, paratroopers";i:1;s:37:"Sailors, coast guard, merchant marine";i:2;s:14:"Airmen, pilots";i:3;s:28:"Policewomen, security people";}'; $selected_values = unserialize($selected_values_serial); $checkOptions = array ( 'Soldiers, marines, paratroopers', 'Sailors, coast guard, merchant marine', 'Airmen, pilots', 'Policewomen, security people', 'Truck drivers', 'Firemen', 'Executioners', 'Nurses, doctors', 'Prostitutes, tramps', 'Cruel/abusive women', 'Cowgirl', 'Surfers, life guards', 'Biker chicks', 'Warrior/Wrestler', 'Royalty, nobility', 'Business people. managers, the boss', 'Divas', 'Teachers', 'Daddy', 'Mommy' ); foreach ($checkOptions as $option) { $selected = (in_array($option, $selected_values))?' checked="checked"':''; echo "<input type=\"checkbox\" name=\"Archetypes[]\" value=\"$option\"$selected />$option<br />\n"; } ?> However, based on the large piece of code you posted previously I would make this into a function that takes two parameters. The array of all values and the array of selected values. Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 31, 2008 Author Share Posted October 31, 2008 your awesome ty Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.