I have a facebook application that consists of a form which values i want to store in my database.
my form method is POST, but in the action method, i cannot get any data sent be the form i use. below the form:
<form enctype="application/x-www-form-urlencoded" action="take_test.php" method="POST">
<table>
<tr>
<td style = "padding-top: 50px; padding-left: 44px; font-size: 13px; color: #50729F;" > <span style = "font-weight:bold;"> some question?</span> <br>
<fieldset class='radios'>
<label class='label_radio' for="radio-01"><input id="radio-01" type="radio" name='q1' value='1'> some answer</label>
<label class='label_radio' for="radio-02"><input id="radio-02" type="radio" name='q1' value='2'> some answer 2</label>
<label class='label_radio' for="radio-03"><input id="radio-02" type="radio" name='q1' value='3'> some answer3 </label>
</fieldset>
</td>
<input type="text" name="signed_request" value="<? echo $_REQUEST['signed_request']; ?>">
<input type="submit" class="input_but" value="submit" />
</form>
and in the take_test.php i have
if ($_POST) {
$b = $_POST['q1'];
}
but it says that index ‘q1’ is not defined and so $b is not set.
is there any special method for sending data through post in facebook page tabs?
thank you
As mentioned by DMCS, you have two input elements with the same ID attribute.
Furthermore, the third radio button label is “for” a non-existent ID. Facebook may have strict HTML rules which prevent the form from working properly for errors such as these.