Guest User

Untitled

a guest
Jan 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3. include ("pw.php"); //til að tengja á password skjalið
  4. $output="";
  5. $link = mysql_connect("localhost","sigu0916",$pw);
  6. mysql_select_db("sigu0916", $link);
  7.  
  8. $query = "select * from question";
  9. $result = mysql_query($query);
  10. /*$result = mysql_query("select * from question");*/
  11.  
  12. $output .="<from method=\"get\" action=\"checkquiz.php\">";
  13. while($data = mysql_fetch_assoc($result))
  14. {
  15. $output .= "<h3>" .$data["question"] ."</h3>\n";
  16. $output .= "<input type=\"radio\" name=\"" .$data["question_id"] ."\" . value=\"" . $data["right_answer"] . "\">" . $data["right_answer"] . "<br />";
  17. $output .= "<input type=\"radio\" name=\"" .$data["question_id"] ."\" . value=\"" . $data["wrong_answer1"] . "\">" . $data["wrong_answer1"] . "<br />";
  18. $output .= "<input type=\"radio\" name=\"" .$data["question_id"] ."\" . value=\"" . $data["wrong_answer2"] . "\">" . $data["wrong_answer2"] . "<br />";
  19.  
  20. /*$output .= $data["question_id"]." ". $data["question"]." ". $data["right_answer"];
  21. $output .= "<br />";*/
  22. }
  23. $output .="<input type=\"submit\" value=\"submit answer\">";
  24. $output .="</form>";
  25.  
  26. ?>
  27. <html>
  28. <head>
  29. <meta http-equiv="Conten-Type" content=text/htmnl;
  30. <title></title>
  31. </head>
  32. <body>
  33. <?php
  34. echo $output;
  35. ?>
  36. </body>
  37. </html>
Add Comment
Please, Sign In to add comment