newbie question about switch, form and table
From: Peter Brause (saugruessel_at_x-mail.net)
Date: 07/12/04
- Next message: Tim Van Wassenhove: "Re: newbie question about switch, form and table"
- Previous message: Henk Verhoeven: "Re: OO in PHP"
- Next in thread: Tim Van Wassenhove: "Re: newbie question about switch, form and table"
- Reply: Tim Van Wassenhove: "Re: newbie question about switch, form and table"
- Reply: Pedro Graca: "Re: newbie question about switch, form and table"
- Reply: William Holroyd: "Re: newbie question about switch, form and table"
- Reply: Matthias Esken: "Re: newbie question about switch, form and table"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 12 Jul 2004 21:44:08 +0200
Hello,
I want to run a simple script which returns the user's input:
<html>
<head>
<title>Project Aswitch</title>
</head>
<body>
<p>Please enter the name of a color (yellow, green, blue) </p>
<table border ="1">
<tr>
<td><input type="TEXT" name="Wert">
</tr>
<tr>
<td align="CENTER"><input type="SUBMIT"></td>
</tr>
<form method="POST" action="aswitch.php">
<?php
switch ($Wert)
{
case "yellow":
echo "<br>Your input: yellow";
break;
case "blue":
echo "<br>Your input: blue";
break;
case "green":
echo "<br>Your input: green";
break;
case "":
echo "<br>Your input: nothing<br>";
default:
echo "<br>Your input: neither empty nor yellow nor blue nor green";
}
?>
</form>
</table>
</body>
</html>
When this script runs the first time, it shows
<quote>
Your input: nothing
Your input: neither empty nor yellow nor blue nor green
</quote>
When I enter "green" and click on the Submit button, the response is the
same.
1. What's wrong with my code?
2. How do I get the responses not inside, but below of the table?
Thanks for helping
Peter
- Next message: Tim Van Wassenhove: "Re: newbie question about switch, form and table"
- Previous message: Henk Verhoeven: "Re: OO in PHP"
- Next in thread: Tim Van Wassenhove: "Re: newbie question about switch, form and table"
- Reply: Tim Van Wassenhove: "Re: newbie question about switch, form and table"
- Reply: Pedro Graca: "Re: newbie question about switch, form and table"
- Reply: William Holroyd: "Re: newbie question about switch, form and table"
- Reply: Matthias Esken: "Re: newbie question about switch, form and table"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|