Thursday, 31 December 2015

HTML AND PHP MAKE QUIZ

HTML-AND-PHP-MAKE-QUIZ


--------------------------------------------------------------------------------------------------------------------
1) MAKE QUIZ FOLDER
2) SAVE ALL FILES ON BY ON IN FOLDER
3) KEEP THIS FOLDER IN WAMP WWW FOLDER



-------------------------------------------------------------------------------------------------------------------
2) SAVE BELOW CODE AS Index.html
-------------------------------------------------------------------------------------------------------------------

<!-- saved from url=(0028)http://localhost/P/index.php -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<style type="text/css">
#wrapper {
width:950px;
height:auto;
padding: 13px;
margin-right:auto;
margin-left:auto;
background-color:#fff;
}
</style>
</head>
<body bgcolor="#e1e1e1">
1
<div id="wrapper">
<center><font face="Andalus" size="5">PHP Quiz App. by <b>WebTutsHD</b></font></center>
<br>
<br>
<br><br>
<form action='process.php?id=1' method='post' id='quizForm' id='1'>
<ol>
<li>
<h3>What does HTML Stands For ?</h3>
<div>
<input type="radio" name="answerOne" id="answerOne" value="A">
<label for="answerOneA">A) Hyper text markup language</label>
</div>
<div>
<input type="radio" name="answerOne" id="answerOne" value="B">
<label for="answerOneB">B) Hyper turn mark lingo</label>
</div>
<div>
<input type="radio" name="answerOne" id="answerOne" value="C">
<label for="answerOneC">C) Happy tissue mahatma life</label>
</div>
</li>
<li>
<h3>What is Youtube?</h3>
<div>
<input type="radio" name="answerTwo" id="answerTwo" value="A">
<label for="answerTwoA">A) A Search Engine </label>
</div>
<div>
<input type="radio" name="answerTwo" id="answerTwo" value="B">
<label for="answerTwoB">B) Video sharing website</label>
</div>
<div>
<input type="radio" name="answerTwo" id="answerTwo" value="C">
<label for="answerTwoC">C) None of the above</label>
</div>
</li>
<li>
<h3>What is your favorite Tutor?</h3>
<div>
<input type="radio" name="answerThree" id="answerThree" value="A">
<label for="answerThreeA">A)WebTuts </label>
</div>
<div>
<input type="radio" name="answerThree" id="answerThree" value="B">
<label for="answerThreeB">B) WebSpider</label>
</div>
<div>
<input type="radio" name="answerThree" id="answerThree" value="C">
<label for="answerThreeC">C) WebTutsHD (Choose this to Win $200)</label>
</div>
</li>
</ol>
<input type="submit" value="Submit Quiz">
</form>
</div>
<!--- end of wrapper div --->
</body>
</html>

--------------------------------------------------------------------------------------------------------------------
2) SAVE BELOW CODE AS process.php
--------------------------------------------------------------------------------------------------------------------

<?php
####################################################################################################################################################
# SCRIPT CREATED BY ANDY @ WEBTUTSHD (youtube.com/WebTutsHD) [PHP QUIZ APP PROCESS PAGE ]                                                         #
####################################################################################################################################################
?>
<html>
<head>
<style type="text/css">
#wrapper {
width:950px;
height:auto;
padding: 13px;
margin-right:auto;
margin-left:auto;
background-color:#fff;
}
</style>
</head>
<?php
$fid = $_GET['id'];
?>
<body bgcolor="#e1e1e1">
<div id="wrapper">
<center><font face="Andalus" size="5">Your Score</font></center>
<br />
<br />
<?php
$answer1= $_POST['answerOne'];
$answer2= $_POST['answerTwo'];
$answer3= $_POST['answerThree'];
$score = 0;
if ($answer1 == "A"){$score++;}
if ($answer2 == "B"){$score++;}
if ($answer3 == "C"){$score++;}
echo "<center><font face='Berlin Sans FB' size='8'>Your Score is <br> $score/3</font></center>";
?>
</div><!--- end of wrapper div --->
</body>
</html>

1 comments:

FB Gadgets | Template Designed by Fatakat PhotosCoolBThemes.com
Code by : paid web directory

https://www.google.co.uk/search?q=site%3Ablogspot.com+fbgadgets