Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

line break between $massage = $HTTP_POST_VARS

Status
Not open for further replies.

lynque

IS-IT--Management
Sep 30, 2004
124
CA
It's been some time since I've used PHP and I've ran into a formatting issue in the body of an email I'm trying to send.
The email works and the data is passed just fine but it all ends up on one line.

What is the correct syntax for inserting a line break between my two html form values after they are passed to my php mailer?

$message = $HTTP_POST_VARS["name"]."<br/>";
$message .= $HTTP_POST_VARS["address"];

Any help is very much appreciated
 
Ok,
I've made some progress with this but now I'm only getting 6 VARS passed into the email when there are way more than that???
Is there some sort of limit on $HTTP_POST_VARS?

I'm using this to loop through my $message

$message = "";
foreach($HTTP_POST_VARS as $key => $value)
{
$message .= $key . ":" . $value . "\n";
}

I could really use some help on this one...
 
First, you should stop using the $HTTP_POST_VARS variable as its been deprecated and there is no guarantee it will continue to exists in future versions of PHP, which may cause your script to fail in the future.

Use the superglobal Variable $_POST instead.


Your foreach loops looks fine. Perhaps echoing out the variable may help you identify what is not getting through.

Code:
echo "<pre>";
print_r($_POST);
echo "</pre>";




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks Vacunita,
Thanks for the tip on superglobal Variable $_POST

I did manage to sort out my issue as well.

Thanks for your help

 
Glad you sorted it out however, I'd encourage you to post the solution so others may benefit from it as well.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top