Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //admin.php
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Adminbereich</title>
- </head>
- <form action="checked.php" method = "POST">
- Index: <input type= "text" name="index" />
- Frage: <input type="text" name="frage" />
- Antwort 1: <input type="text" name="a1" />
- Antwort 2: <input type="text" name="a2" />
- Antwort 3: <input type="text" name="a3" />
- Antwort 4: <input type="text" name="a4" />
- Richtige Antwort: <input type="text" name="ra" />
- <input type="submit" name="set" />
- </form>
- <body>
- </body>
- </html>
- //checked.php
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Unbenanntes Dokument</title>
- <link href="style.css" rel="stylesheet" type="text/css" />
- </head>
- <h1>Frage eingefügt!</h1>
- <?php
- $index=$_POST ['index'];
- $frage=$_POST ['frage'];
- $a1=$_POST ['a1'];
- $a2=$_POST ['a2'];
- $a3=$_POST ['a2'];
- $a4=$_POST ['a4'];
- $ra=$_POST ['ra'];
- $con = mysql_connect("localhost","root");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("quiz", $con);
- if (isset($_POST['set'])) {
- mysql_query("INSERT INTO `fragen`(`index`, `Frage`, `Antwort1`, `Antwort2`, `Antwort3`, `Antwort4`, `Richtige Antwort`) VALUES ($index,$frage,$a1,$a2,$3,$a4,$ra)");
- }
- mysql_close ($con);
- ?>
- <form style="text-align: center;" action="index.php">
- <input type="submit" name="Startseite"/>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment