Re: Grabbing ALL $_POST var at once.
| From: | 1LT John W. Holmes | Date: | Mon, 06 May 2002 18:49:41 +0000 |
| Subject: | Re: Grabbing ALL $_POST var at once. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96305@lists.php.net to get a copy of this message | ||
> <?php
> $From = $_POST['from'];
> $Two = $_POST['two'];
> $Subject = $_POST['sub_ject'];
> $Comments = $_POST['comments'];
> echo "<b>$From</b>";print "\n";
> echo $Two;print "\n";
> echo $Subject;print"\n";
> echo $Comments;print "\n";
> ?>
> <?php mail($Two,$Subject,$Comments) ?>
Why do you waste time assigning a variable to a variable...Is it really that
hard to just use the $_POST array?
<?php
echo "<b>" . $_POST["from"] . "</b>\n";
echo $_POST["two"] . "\n";
echo $_POST["sub_ject"] . "\n";
echo $_POST["comments"] . "\n";
mail($_POST["two"],$_POST["sub_ject"],$_POST["comments"]);
?>
If that's too hard to understand, use extract().
---John Holmes...