NameSilo

New code based off an old one I made.

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

Coolprogram

Established Member
Impact
7
here is the code it is still a quiz this is whatever.php

PHP:
here is the code it is still a quiz this is whatever.php
<html>
<body>
<center>
<h1>Quiz</h1>
</center>
<h3>Which is the correct spelling?</h3>
<br>

<form action="whatever.php" method="POST">
<input type="radio" name="cool" value="Wrong"> heel
<br>
<input type="radio" name="quiz" value="Correct"> heal
<br>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset All">
</form>

<?php

if($_POST['submit'])
{
$quiz = $_POST['quiz'];

if($quiz == "Correct")
{
echo 'You are Correct click <a href="next.php">here</a> to move on.';
}
else
{
echo '<h2><font color="red">Wrong.</font> try again!!';
}
}
?>
</body>
</html>

I hope you like this code it is great for quizes, I need to learn a little MySQL to show percents and that.
-CP
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
0
Close
hmmm... basic but effective anyway... can't heel used as the heel of a foot
 
0
Close
there is an error in my other code here is the one without the error.
PHP:
<html>
<body>
<center>
<h1>Quiz</h1>
</center>
<h3>Which is the correct spelling?</h3>
<br>

<form action="whatever.php" method="POST">
<input type="radio" name="quiz" value="Correct"> sise
<br>
<input type="radio" name="quiz" value="Wrong"> sise
<br>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset All">
</form>

<?php

if($_POST['submit'])
{
$quiz = $_POST['quiz'];

if($quiz == "Correct")
{
echo 'You are Correct click <a href="next.php">here</a> to move on.';
}
else
{
echo '<h2><font color="red">Wrong.</font> try again!!';
}
}
?>
Sorry about that,
-CP
P.S. You can spelll heal like heel to so I changed it to size. TY Please check it out again I fixed a few errors.
 
Last edited:
0
Close
thanx dude ! you rock at programming
 
0
Close
you put sise and sise

Code:
<html>
<body>
<center>
<h1>Quiz</h1>
</center>
<h3>Which is the correct spelling?</h3>
<br>

<form action="whatever.php" method="POST">
<input type="radio" name="quiz" value="Correct"> size
<br>
<input type="radio" name="quiz" value="Wrong"> sise
<br>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset All">
</form>

<?php

if($_POST['submit'])
{
$quiz = $_POST['quiz'];

if($quiz == "Correct")
{
echo 'You are Correct click <a href="next.php">here</a> to move on.';
}
else
{
echo '<h2><font color="red">Wrong.</font> try again!!';
}
}
?>


That should work :)
 
0
Close
oops, sorry about that, I forgot about that, I eddited the code before I added it to my site, so I made a typo.
TY
-CP
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back