I’m trying to send a collection of data to the database I’m using check boxes below is my code.
<label>Description</label><br />
<textarea name="desc" id="desc" rows="8" cols="50"></textarea> <br />
</div>
<div class="margin">
<fieldset>
<legend style="font-weight: normal; font-size: medium; text-align: left">Standard Services</legend>
<input type="checkbox" name="stdService[]" value="Sensual Massage" />
<label>Sensual Massage</label><br />
<input type="checkbox" name="stdService[]" value="French" />
<label>French</label><br />
<input type="checkbox" name="stdService[]" value="Foreplay" />
<lable>Foreplay</lable><br />
<input type="checkbox" name="stdService[]" value="GFE" />
<lable>GFE</lable><br />
<input type="checkbox" name="stdService[]" value="Toys" />
<lable>Toys</lable><br />
<input type="checkbox" name="stdService[]" value="Spanish" />
<lable>Spanish</lable><br />
<input type="checkbox" name="stdService[]" value="Swedish" />
<lable>Swedish</lable><br />
<input type="checkbox" name="stdService[]" value="Sex" />
<lable>Sex</lable><br />
<input type="checkbox" name="stdService[]" value="Ladies" />
<lable>Ladies</lable><br />
<input type="checkbox" name="stdService[]" value="Couples" />
<lable>Couples</lable><br />
<input type="checkbox" name="stdService[]" value="Bi" />
<lable>Bi</lable><br />
<input type="checkbox" name="stdService[]" value="Golden Showers" />
<lable>Golden Showers</lable><br />
<input type="checkbox" name="stdService[]" value="Private Strips" />
<lable>Private Strips</lable><br />
<input type="checkbox" name="stdService[]" value="Lap Dances" />
<lable>Lap Dances</lable><br />
<input type="checkbox" name="stdService[]" value="Topless Witressing" />
<lable>Topless Waitressing</lable><br />
<input type="checkbox" name="stdService[]" value="Fantasies" />
<lable>Fantasies</lable><br />
<input type="checkbox" name="stdService[]" value="Fetish" />
<lable>Fetish</lable><br />
<input type="checkbox" name="stdService[]" value="Dress Ups" />
<lable>Dress Ups</lable><br />
<input type="checkbox" name="stdService[]" value="Goes Twice" />
<lable>Goes Twice</lable><br />
<input type="checkbox" name="stdService[]" value="Dating" />
<lable>Dating</lable><br />
<label>Other:</label>
<input type="text" name="stdService[]" />
</fieldset>
</div>
Process.php
$stdService = $_REQUEST["stdService"];
//Loop for the stdService
$std = "";
$flag = 0;
foreach($stdService as $stdServ){
$std = $stdServ."' ";
$flag = 1;
}
if($flag == 1){
$std = rtrim($std);
}
//Loop for the othService
$oth = "";
$flagOth = 0;
foreach($othService as $othServ){
$oth = $othServ."' ";
$flagOth = 1;
}
if($flagOth == 1){
$oth = rtrim($oth);
}
text input get entered but check box value doesn’t get submitted or my function is not working can some one help me please.