Faye Principe
New member
it keeps reading the semicolons as text, plus the codes starting from the else statement. here's the code:
<html>
<head><title>Excercise D4-38</title></head>
<body>
<table border = "1" align = "CENTER">
<form name = "form1" action = <?php echo $_SERVER['PHP_SELF']?> method = "POST" />
<?php
if (!$_POST['btn1'])
{<tr><td> Full name:</td><td><input type = "text" name = "txt1"></br></td></tr>;
<tr><td>Password:</td><td> <input type = "password" name = "txt2"></br></tr></td>;
<tr><td>E-mail Address:</td><td> <input type = "text" name = "txt"></br></tr></td>;
<tr><td>Gender:</td><td> <input type = "radio" name = "txt3[]" value = "Male">Male<input type = "radio" name = "txt3[]" value = "Female">Female</br></tr></td>;
<tr><td>Civil Status:</td><td><select name="item[]" >
<option>Single</option>
<option>Married</option>
<option>Widowed</option>
<option>In an Open Relationship</option>
<option>Its Complicated<option>
</select></tr></td>;
<tr><td>Age:</td><td> <input type = "radio" name = "txt4[]" value = "Below 18">Below 18</br>
<input type = "radio" name = "txt4[]" value = "18-25">18-24</br>
<input type = "radio" name = "txt4[]" value = "26-40">26-40</br>
<input type = "radio" name = "txt4[]" value = "41-60">41-60</br>
<input type = "radio" name = "txt4[]" value = "61-75">61-75</br>
<input type = "radio" name = "txt4[]" value = "Above BINGO digits">Above BINGO digits</br></tr></td>;
<tr><td>Favorite TV Shows:</td><td> <input type = "checkbox" name = "txt5[]" value = "Oh my MOMAY!">Oh my MOMAY!</br>
<input type = "checkbox" name = "txt5[]" value = "Magkaribal">Magkaribal</br>
<input type = "checkbox" name = "txt5[]" value = "Ilumina">Ilumina</br>
<input type = "checkbox" name = "txt5[]" value = "Queen Seon Deok">Queen Seon Deok</br>
<input type = "checkbox" name = "txt5[]" value = "Agua Bendita">Agua Bendita</br>
<input type = "checkbox" name = "txt5[]" value = "Kristine">Kristine</br></tr></td>;
<tr><td>Suggestions:</td><td><textarea rows = "10" columns = "10" wrap = "physical" name = "txt6">
Comments. . .</textarea></td></tr>;
<tr><td>Send to:</td><td><input type = "submit" name = "btn1" value = "Your Favorite Network"></td></tr>;
}
else
{
$fullname = $_POST['txt1'];
$email = $_POST['txt'];
echo 'Your name is '.$fullname.'!</br>';
echo 'Your email address is '.$email.'!</br>';
if(is_array($_POST['txt3']))
{
echo("Your Gender :");
foreach($_POST['txt3'] as $y)
{
echo("$y<br/>");
}
}
else
{
echo("Nothing chosen");
}
if(is_array($_POST['item']))
{
echo("Your Civil Status :");
foreach($_POST['item'] as $z)
{
echo("$z<br/>");
}
}
else
{
echo("Nothing chosen");
}
if(is_array($_POST['txt4']))
{
echo("Your Age :");
foreach($_POST['txt4'] as $w)
{
echo("$w<br/>");
}
}
else
{
echo("Nothing chosen");
}
if(is_array($_POST['txt5']))
{
echo("Your Favorite TV show/s:<br/>");
foreach($_POST['txt5'] as $x)
{
echo("$x<br/>");
}
}
else
{
echo("Nothing chosen");
}
$Suggestion = $_POST['txt6'];
echo 'We\'ll consider your Suggestion/s: '.$Suggestion;
}
}
?>
</form>
</table>
</body>
</html>
hope you can help. tnx.
<html>
<head><title>Excercise D4-38</title></head>
<body>
<table border = "1" align = "CENTER">
<form name = "form1" action = <?php echo $_SERVER['PHP_SELF']?> method = "POST" />
<?php
if (!$_POST['btn1'])
{<tr><td> Full name:</td><td><input type = "text" name = "txt1"></br></td></tr>;
<tr><td>Password:</td><td> <input type = "password" name = "txt2"></br></tr></td>;
<tr><td>E-mail Address:</td><td> <input type = "text" name = "txt"></br></tr></td>;
<tr><td>Gender:</td><td> <input type = "radio" name = "txt3[]" value = "Male">Male<input type = "radio" name = "txt3[]" value = "Female">Female</br></tr></td>;
<tr><td>Civil Status:</td><td><select name="item[]" >
<option>Single</option>
<option>Married</option>
<option>Widowed</option>
<option>In an Open Relationship</option>
<option>Its Complicated<option>
</select></tr></td>;
<tr><td>Age:</td><td> <input type = "radio" name = "txt4[]" value = "Below 18">Below 18</br>
<input type = "radio" name = "txt4[]" value = "18-25">18-24</br>
<input type = "radio" name = "txt4[]" value = "26-40">26-40</br>
<input type = "radio" name = "txt4[]" value = "41-60">41-60</br>
<input type = "radio" name = "txt4[]" value = "61-75">61-75</br>
<input type = "radio" name = "txt4[]" value = "Above BINGO digits">Above BINGO digits</br></tr></td>;
<tr><td>Favorite TV Shows:</td><td> <input type = "checkbox" name = "txt5[]" value = "Oh my MOMAY!">Oh my MOMAY!</br>
<input type = "checkbox" name = "txt5[]" value = "Magkaribal">Magkaribal</br>
<input type = "checkbox" name = "txt5[]" value = "Ilumina">Ilumina</br>
<input type = "checkbox" name = "txt5[]" value = "Queen Seon Deok">Queen Seon Deok</br>
<input type = "checkbox" name = "txt5[]" value = "Agua Bendita">Agua Bendita</br>
<input type = "checkbox" name = "txt5[]" value = "Kristine">Kristine</br></tr></td>;
<tr><td>Suggestions:</td><td><textarea rows = "10" columns = "10" wrap = "physical" name = "txt6">
Comments. . .</textarea></td></tr>;
<tr><td>Send to:</td><td><input type = "submit" name = "btn1" value = "Your Favorite Network"></td></tr>;
}
else
{
$fullname = $_POST['txt1'];
$email = $_POST['txt'];
echo 'Your name is '.$fullname.'!</br>';
echo 'Your email address is '.$email.'!</br>';
if(is_array($_POST['txt3']))
{
echo("Your Gender :");
foreach($_POST['txt3'] as $y)
{
echo("$y<br/>");
}
}
else
{
echo("Nothing chosen");
}
if(is_array($_POST['item']))
{
echo("Your Civil Status :");
foreach($_POST['item'] as $z)
{
echo("$z<br/>");
}
}
else
{
echo("Nothing chosen");
}
if(is_array($_POST['txt4']))
{
echo("Your Age :");
foreach($_POST['txt4'] as $w)
{
echo("$w<br/>");
}
}
else
{
echo("Nothing chosen");
}
if(is_array($_POST['txt5']))
{
echo("Your Favorite TV show/s:<br/>");
foreach($_POST['txt5'] as $x)
{
echo("$x<br/>");
}
}
else
{
echo("Nothing chosen");
}
$Suggestion = $_POST['txt6'];
echo 'We\'ll consider your Suggestion/s: '.$Suggestion;
}
}
?>
</form>
</table>
</body>
</html>
hope you can help. tnx.