I am creating a survey form which will have several different types of questions (freetext, slider1-10, multiple choice).
I need a way of recording in the database the question type.
An example form:
<input type="text" name="1731|textarea">
<input type="hidden" name="32|multichoice">
<input type="hidden" name="108|slider">
I then use PHP to separate questionnumber|questiontyp
e using the pipe (|)
$question = explode("|", $question);
$questionID = $question;
$questionType = $question;
One of the problems I have is if someone uses the pipe (|) within the textbox it causes me problems. Also if the user has the option of multiple choice selecting several options i may seperate the value in a similar way (value="3|13|21").
I know this isn't the best way to achieve what I want but don't know another method.
Could someone help.