Re: Parse error
| From: | Kondwani Spike Mkandawire | Date: | Mon, 22 Jul 2002 16:52:06 +0000 |
| Subject: | Re: Parse error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108895@lists.php.net to get a copy of this message | ||
>
> <?php
> If ('GET' == $HTTP_SERVER_VARS['REQUEST_METHOD']) {
> $MailToAddress = 'dean@gisites.com';
> $MailSubject = 'Get Involved List';
> ?>
>
> <?php
> exit;
> }
> ?>
You appear to be moving in and out of PHP Mode that could be pretty
tough to follow... I've practically been looking at php Code 8 hours
a day for the past 3 months with a good deal of former CGI Scripting
experience and I'm still scared of learning this tactic... However I have
never had to use it before so the circumstances may be different...
> <?
> If ('POST' == $HTTP_SERVER_VARS['REQUEST_METHOD']) {
> if (isset($HTTP_POST_VARS['email'])) {
> $MailFromAddress = $HTTP_POST_VARS['email']; // I'm assuming the
> vars were posted from a form
> } else {
> $MailFromAddress = 'dean@gisites.com'; // vars don't expand in
> single quotes, but we don't have any here.
> }
>
> $Message = $HTTP_POST_VARS['Message']; // should single quote
> associative array indexes
> if (isset($HTTP_POST_VARS['Header'])) {
> $Message = $HTTP_POST_VARS['Header'] . "\n\n$Message"; // need to
> wrap arrays in double quotes in {} to parse
> }
>
> if (isset($HTTP_POST_VARS['Footer'])) {
> $Message .= "\n\n$HTTP_POST_VARS[Footer]";
> }
>
> mail($MailToAddress,$MailSubject,$Message,$MailFromAddress); // don't
> have to quote vars on parms } ?>
>