Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(!isset($_SESSION['key'])){
- die("Das Quiz können sie erst bearbeiten, wenn sie ihre Daten eingegeben haben.");
- }
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
- <input type="submit" name="refresh" value="Wiederherstellen">
- <input type="submit" name="admin" value="Admin-Login">
- <h3>Hören sie sich die 4 Lieder an und geben sie ihre Stimme dazu ab. Wenn sie sich überhaupt nicht sicher sind dann wählen sie bitte unsicher.
- </h3>
- <h4>Das erste Lied</h4>
- <audio id="audio_with_controls"
- controls
- src="misc/music/m1.mp3"
- type="audio/mp3"
- >
- </audio>
- <br>
- <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
- <input type="hidden" name="high1" value="0">
- <input type="radio" value="1" name="high1"> Highland cathedral 
- <input type="hidden" name="ag1" value="0">
- <input type="radio" value="1" name="ag1"> Amazing Grace 
- <input type="hidden" name="tg1" value="0">
- <input type="radio" value="1" name="tg1"> The Gael 
- <input type="hidden" name="ca1" value="0">
- <input type="radio" value="1" name="ca1"> Canon 
- <input type="hidden" name="trp1" value="0">
- <input type="radio" value="1" name="trp1"> The Rebel Piper 
- <input type="hidden" name="un1" value="0">
- <input type="radio" value="1" name="un1">Unsicher
- <br>
- <h4> Das zweite Lied </h4>
- <audio id="m2.mp3"
- controls
- src="misc/music/m2.mp3"
- type="audio/mp3"
- >
- </audio>
- <br>
- <input type="hidden" name="high2" value="0">
- <input type="radio" value="1" name="high2"> Highland cathedral 
- <input type="hidden" name="ag2" value="0">
- <input type="radio" value="1" name="ag2"> Amazing Grace 
- <input type="hidden" name="tg2" value="0">
- <input type="radio" value="1" name="tg2"> The Gael 
- <input type="hidden" name="ca2" value="0">
- <input type="radio" value="1" name="ca2"> Canon 
- <input type="hidden" name="trp2" value="0">
- <input type="radio" value="1" name="trp2"> The Rebel Piper 
- <input type="hidden" name="un2" value="0">
- <input type="radio" value="1" name="un2">Unsicher
- <br>
- <h4> Das dritte Lied </h4>
- <audio id="m3.mp3"
- controls
- src="misc/music/m3.mp3"
- type="audio/mp3"
- >
- </audio>
- <br>
- <input type="hidden" name="high3" value="0">
- <input type="radio" value="1" name="high3"> Highland cathedral 
- <input type="hidden" name="ag3" value="0">
- <input type="radio" value="1" name="ag3"> Amazing Grace 
- <input type="hidden" name="tg3" value="0">
- <input type="radio" value="1" name="tg3"> The Gael 
- <input type="hidden" name="ca3" value="0">
- <input type="radio" value="1" name="ca3"> Canon 
- <input type="hidden" name="trp3" value="0">
- <input type="radio" value="1" name="trp3"> The Rebel Piper 
- <input type="hidden" name="un3" value="0">
- <input type="radio" value="1" name="un3">Unsicher
- <br>
- <h4> Das vierte Lied </h4>
- <audio id="m4.mp3"
- controls
- src="misc/music/m4.mp3"
- type="audio/mp3"
- >
- </audio>
- <br>
- <input type="hidden" name="high4" value="0">
- <input type="radio" value="highland" name="high4"> Highland cathedral 
- <input type="hidden" name="ag4" value="0">
- <input type="radio" value="amazing" name="ag4"> Amazing Grace 
- <input type="hidden" name="tg4" value="0">
- <input type="radio" value="thegael" name="tg4"> The Gael 
- <input type="hidden" name="ca4" value="0">
- <input type="radio" value="canon" name="ca4"> The Canon 
- <input type="hidden" name="trp4" value="0">
- <input type="radio" value="rebel" name="trp4"> The Rebel Piper 
- <input type="hidden" name="un4" value="0">
- <input type="radio" value="unsure" name="un4">Unsicher<br>
- <input type="submit" name="confirm" value="Bestätigen">
- </form>
- <?php
- if (isset($_POST["confirm"])){
- $high1=$_POST["high1"];
- $ag1=$_POST["ag1"];
- $tg1=$_POST["tg1"];
- $ca1=$_POST["ca1"];
- $trp1=$_POST["trp1"];
- $un1=$_POST["un1"];
- $high2=$_POST["high2"];
- $ag2=$_POST["ag2"];
- $tg2=$_POST["tg2"];
- $ca2=$_POST["ca2"];
- $trp2=$_POST["trp2"];
- $un2=$_POST["un2"];
- $high3=$_POST["high3"];
- $ag3=$_POST["ag3"];
- $tg3=$_POST["tg3"];
- $ca3=$_POST["ca3"];
- $trp3=$_POST["trp3"];
- $un3=$_POST["un3"];
- $high4=$_POST["high4"];
- $ag4=$_POST["ag4"];
- $tg4=$_POST["tg4"];
- $ca4=$_POST["ca4"];
- $trp4=$_POST["trp4"];
- $un4=$_POST["un4"];
- if (mysql_connect('localhost','root',''))
- echo ("");
- else {
- die("Konnte keine Verbindung aufbauen:"
- .mysql_error());
- }
- if(mysql_select_db('umfrage'))
- echo ("");
- else {
- die("Keine Datenbank vorhanden".mysql_error());
- }
- $m1=mysql_query("SELECT * FROM m1");
- if($m1){
- while($kntk=mysql_fetch_object($m1)){
- $h1 = $kntk -> high;
- $a1 = $kntk -> ag;
- $t1 = $kntk -> tg;
- $c1 = $kntk -> ca;
- $tr1 = $kntk -> trp;
- $u1 = $kntk -> un;
- }
- }
- $h1=$h1+$high1;
- $a1=$a1+$ag1;
- $t1=$t1+$tg1;
- $c1=$c1+$ca1;
- $tr1=$tr1+$trp1;
- $u1=$u1+$un1;
- $daten= "UPDATE m1 SET high='$h1', ag='$a1', tg='$t1', ca='$c1', trp='$tr1', un='$u1';";
- if (mysql_query($daten))
- echo (" Datensätze erfolgreich angelegt.");
- else {
- die ("FEHLER!".mysql_error());
- }
- // DONE M1!
- $m2=mysql_query("SELECT * FROM m2");
- if($m2){
- while($kntk=mysql_fetch_object($m2)){
- $h2 = $kntk -> high;
- $a2 = $kntk -> ag;
- $t2 = $kntk -> tg;
- $c2 = $kntk -> ca;
- $tr2 = $kntk -> trp;
- $u2 = $kntk -> un;
- }
- }
- $h2=$h2+$high2;
- $a2=$a2+$ag2;
- $t2=$t2+$tg2;
- $c2=$c2+$ca2;
- $tr2=$tr2+$trp2;
- $u2=$u2+$un2;
- $daten= "UPDATE m2 SET high='$h2', ag='$a2', tg='$t2', ca='$c2', trp='$tr2', un='$u2';";
- if (mysql_query($daten))
- echo (" Datensätze erfolgreich angelegt.");
- else {
- die ("FEHLER!".mysql_error());
- }
- // DONE M2!
- $m3=mysql_query("SELECT * FROM m3");
- if($m3){
- while($kntk=mysql_fetch_object($m3)){
- $h3 = $kntk -> high;
- $a3 = $kntk -> ag;
- $t3 = $kntk -> tg;
- $c3 = $kntk -> ca;
- $tr3 = $kntk -> trp;
- $u3 = $kntk -> un;
- }
- }
- $h3=$h3+$high3;
- $a3=$a3+$ag3;
- $t3=$t3+$tg3;
- $c3=$c3+$ca3;
- $tr3=$tr3+$trp3;
- $u3=$u3+$un3;
- $daten= "UPDATE m3 SET high='$h3', ag='$a3', tg='$t3', ca='$c3', trp='$tr3', un='$u3';";
- if (mysql_query($daten))
- echo (" Datensätze erfolgreich angelegt.");
- else {
- die ("FEHLER!".mysql_error());
- }
- $m4=mysql_query("SELECT * FROM m4");
- if($m4){
- while($kntk=mysql_fetch_object($m4)){
- $h4 = $kntk -> high;
- $a4 = $kntk -> ag;
- $t4 = $kntk -> tg;
- $c4 = $kntk -> ca;
- $tr4 = $kntk -> trp;
- $u4 = $kntk -> un;
- }
- }
- $h4=$h4+$high4;
- $a4=$a4+$ag4;
- $t4=$t4+$tg4;
- $c4=$c4+$ca4;
- $tr4=$tr4+$trp4;
- $u4=$u4+$un4;
- $daten= "UPDATE m4 SET high='$h4', ag='$a4', tg='$t4', ca='$c4', trp='$tr4', un='$u4';";
- if (mysql_query($daten))
- echo (" Datensätze erfolgreich angelegt.");
- else {
- die ("FEHLER!".mysql_error());
- }
- header ("Location: test2.php?seskey=$key");
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement