Jump to content

krishnadaspc

Members
  • Posts

    2
  • Joined

  • Last visited

krishnadaspc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello Mytdred, You don't put any submit field on your form. That is why you are not getting the values I believe. Add the below code at the end of your form. Also add the comment field and other needed fields to your form. <input type="submit" name="submit" value="submit"> Regards, Krishnadas
  2. I have a quiz program, it is working but it shows the options of the questions in the same order ie currently the correct answer of each of the question will be displayed as the last option only. Is there anyway to display the options randomly?. Am a newbie; This is my first post here and your suggestions are sincerely appreciated. Here is my code which shows the questions and answers from the DB. mysql_select_db("quiz_k"); $exam="SELECT * FROM php"; $result=mysql_query($exam); for($i=1;$i<=20;$i++) { while($row=mysql_fetch_assoc($result)) { echo $row['id'].")"; $x=$row['id']; echo $row['question']."<br>"; ?> <input type="radio" required='required' name="<?php echo $row['id'] ?>" value="<?php echo $row['option1'] ?>"> <?php echo $row['option1'].'<br>'; ?> <input type="radio" required='required' name="<?php echo $row['id'] ?>" value="<?php echo $row['option2'] ?>"> <?php echo $row['option2'].'<br>'; ?> <input type="radio" required='required' name="<?php echo $row['id'] ?>" value="<?php echo $row['option3'] ?>"> <?php echo $row['option3'].'<br>'; ?> <input type="radio" required='required' name="<?php echo $row['id'] ?>" value="<?php echo $row['answer'] ?>"> <?php echo $row['answer'].'<br>'; } } ?> <br> <input type="submit" name="submit" value="submit" > </form> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.