Mail() problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I can't get the following code snippet to stop throwing errors except to
modify it exactly as shown here by adding the single quote to the end of
the first line and commenting out all but the first line:

<?php <========= This is line 108 mentioned in the error msg
$header="Return-Path: ".$mailuser." \r\n";
$header .="From: Bad Link<".$mailuser.">\r\n";
$header .="Content-Type: text/html;";

$mail_body = '
<br>User:  ' . $email .' submitted a form re: BAD LINK  '<===this line
will work
//<br>Zip: ' . $_POST['zipcode2'] . '<br>
//<br>City: '. $_POST['city'] . '<br>
//<br>Link: '. $_POST['page'] . '<br>
//<br/>Link Wording: ' . $_POST['wording'] . '<br/>
//<br/>Details: ' $_POST[;details'] ' . <br/>
//<br/>Response? ' $_POST['respond'] . '<br/> '
//mail($mailuser, 'Form Sent', $header, $mail_body );
Parse error: syntax error, unexpected T_VARIABLE in
C:\xampp\htdocs\ContactUs\badLinkCheck.php on line 108

By inserting/deleting blank lines, I've determined the error is in the
'$mail_body =' section, not the $headers area. But that's as close as I
can get it.  I thought the $_POST was wrong, but it's identical to the
format used in another, fully functional form.  In fact, the first 3
lines of the mail body are identical to the working form.  Not that that
proves the other form is "right"!<G>

Moving the single quote indicated above to the second line, say, and
uncommenting the second line, in addition to the first line (or
without), throws an error.  As it does with any of the $_POST lines.
But darned if I can see anything wrong with it.  I'ver read/reread the
manual & a few other articles til I'm blue in the face without success.
   The $_POST names are all available; just before the mail() section
because I echo them all to the screen to be certain they existed and
they display as expected.

Any comments or advice?



Re: Mail() problem

Twayne wrote:
Quoted text here. Click to load it

Looks like you have mismatched single quotes earlier in the file.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Mail() problem

Quoted text here. Click to load it

[ Sigh ] That's entirely possible I suppose; I'll go look again; sounds



Resolved Re: Mail() problem

Quoted text here. Click to load it

Thanks Jerry, that was the push I needed.  Knowing there wasn't anything
obviously wrong about the snip I posted helped an awful lot.

For any newbies reading, yes, I know there is also a "." missing before
the variable in each of the two last lines, just in case anyone noticed;
that wasn't the issue.



Re: Resolved Re: Mail() problem

Greetings, Twayne.
In reply to Your message dated Wednesday, July 9, 2008, 3:50:54,

Quoted text here. Click to load it

Get an editor with decent code highlighting engine, seriously.
Then your error will light up your code until you fix it.


Site Timeline