whats wrong with this code?
Posted: Sat Oct 01, 2005 4:52 pm
im trying to make a basic script that has a input box for their name and two radio buttons and when you submit it will say something like:
radio 1 checked:
haha, NAME, get a life
radio 2 checked:
good job, NAME, you have a life
this is what i have so far:
Page 1:
Page 2:
any help?
radio 1 checked:
haha, NAME, get a life
radio 2 checked:
good job, NAME, you have a life
this is what i have so far:
Page 1:
Code: Select all
<html>
<head>
<title>Testing Page</title>
</head>
<body>
<form action="tail2.php" method="POST">
Enter your name: <input type="text" name="name" /><br><br>
<p>Do you have a life?<br><br>
yes
<input name="button1" value="yes" type="radio" id="button1"></p>
<p>no<input name="button1" value="no" type="radio" id="button1"></p>
<input name="Get Code!" type="submit" id="Get Code!" value="Find out what I have to say" />
</form>
</body>
</html>Code: Select all
<html>
<head>
<title>Testing Page 2</title>
</head>
<body>
<?php
if($button1 == "yes"){
$no1="haha, ["name"], get a life";}
echo"$no1";
?><br><br>
<?php
if($button1 == "no"){
$b2="good job, ["name"], you have a life";}
echo"$b2";
?>
<?php
if($button1 == ""){
$b3="Select something homo";}
echo"$b3";
?>
</html>