Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- include ("pw.php"); //til að tengja á password skjalið
- $output="";
- $link = mysql_connect("localhost","sigu0916",$pw);
- mysql_select_db("sigu0916", $link);
- $query = "select * from question";
- $result = mysql_query($query);
- /*$result = mysql_query("select * from question");*/
- $output .="<from method=\"get\" action=\"checkquiz.php\">";
- while($data = mysql_fetch_assoc($result))
- {
- $output .= "<h3>" .$data["question"] ."</h3>\n";
- $output .= "<input type=\"radio\" name=\"" .$data["question_id"] ."\" . value=\"" . $data["right_answer"] . "\">" . $data["right_answer"] . "<br />";
- $output .= "<input type=\"radio\" name=\"" .$data["question_id"] ."\" . value=\"" . $data["wrong_answer1"] . "\">" . $data["wrong_answer1"] . "<br />";
- $output .= "<input type=\"radio\" name=\"" .$data["question_id"] ."\" . value=\"" . $data["wrong_answer2"] . "\">" . $data["wrong_answer2"] . "<br />";
- /*$output .= $data["question_id"]." ". $data["question"]." ". $data["right_answer"];
- $output .= "<br />";*/
- }
- $output .="<input type=\"submit\" value=\"submit answer\">";
- $output .="</form>";
- ?>
- <html>
- <head>
- <meta http-equiv="Conten-Type" content=text/htmnl;
- <title></title>
- </head>
- <body>
- <?php
- echo $output;
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment