On Mon, 22 Nov 2004 21:57:23 +0100, Perry J�nsson <[EMAIL PROTECTED]> wrote:
>
> Maybe a daft question but why would you like to check for a specific value?
>
> Can you give an example when this is a good thing to do?
A forum. You have two submit buttons, one labeled 'draft' and one
labeled 'final'.
If the user uses the draft button, the forum displays a preview of the
user's post for them to edit. If they use the 'final' button, then
their post gets put straight into the forum, typos and all.
<form name="myForumPost">
<textarea name="text"></textarea>
<input name="submit" name="submit" value="draft">
<input name="submit" name="submit" value="final">
</form>
<?php
switch ($_POST['submit']) {
case 'draft': // display draft of the post for the user to review.
break;
case 'submit': // save final version of post in forum.
break;
default: // someone's being silly.
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php