shenmue232 Posted August 22, 2007 Share Posted August 22, 2007 Hi i need help on adding a space between each word for example Fist Name: PHP Second name: Code Phone Number: 123456789 Subject: PHP Message: HELP!!! what i get is Fist Name: PHP <p> </p> Second name: Code Phone Number: 123456789 Subject: PHP Message: HELP!!! the codes below can anyone help Thanks <?php $email =$_REQUEST['email']; $firstname = $_REQUEST['firstname']; $secondname =$_REQUEST['secondname']; $phonenumber =$_REQUEST['phonenumber']; $subject = $_REQUEST['subject']; $comment =$_REQUEST['comment']; //email address mess is sent to subject of email mail ( "myemail@hotmail.com" ,"Email From Customer", "Fist Name: $firstname <p> </p> Second name: $secondname Phone Number: $phonenumber Subject: $subject Message: $comment", "From: $firstname $secondname At: $email" ); header ( "Location: thanks.html" ); ?> Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/ Share on other sites More sharing options...
mattison Posted August 22, 2007 Share Posted August 22, 2007 i have also recived this via my comments line, i dont know what it is, at first i thaught it was a spammer, but now i have read your post it could be an error Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-330787 Share on other sites More sharing options...
jodm Posted August 22, 2007 Share Posted August 22, 2007 Hi. The reason you are getting this as an output is that you have not specified the content type as HTML in the mail() function. You can do this like this: $body = "<HTML><HEAD></HEAD><BODY><STRONG>HELLO</STRONG><P>THIS IS A TEST</P><BR><BR>A NEW LINE</BODY></HTML>"; mail("EMAILTO", "SUBJECT", $body, "From: FROM NAME <EMAIL@ADDRESS.COM> \nContent-Type: text/html; charset=iso-8859-1"); Hope this helps.... James Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-330790 Share on other sites More sharing options...
shenmue232 Posted August 22, 2007 Author Share Posted August 22, 2007 i get this message now its because of the header is there another way to display the thanks.html page Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/e/w/newman100/html/brentwoodcomputerrepairs/brentwoodcomputerrepairs/sendmail.php:2) in /home/content/n/e/w/newman100/html/brentwoodcomputerrepairs/brentwoodcomputerrepairs/sendmail.php on line 16 current code <html> <?php $email =$_REQUEST['email']; $firstname = $_REQUEST['firstname']; $secondname =$_REQUEST['secondname']; $phonenumber =$_REQUEST['phonenumber']; $subject = $_REQUEST['subject']; $comment =$_REQUEST['comment']; //email address mess is sent to subject of email mail ( "mortalsombat@hotmail.com" ,"Email From Customer", "Fist Name: $firstname <p> Second name: $secondname <p> Phone Number: $phonenumber <p> Subject: $subject <p> Message: $comment", "From: $firstname $secondname At: $email \nContent-Type: text/html; charset=iso-8859-1"); header ( "Location: thanks.html" ); ?> </html> Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-330881 Share on other sites More sharing options...
xyn Posted August 22, 2007 Share Posted August 22, 2007 at the top of your page use this! <?php ob_start(); ?> then at the bottom of the page (very bottom)<? ob_end_flush(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-330886 Share on other sites More sharing options...
shenmue232 Posted August 22, 2007 Author Share Posted August 22, 2007 like this? <?php ob_start();?> <html> $email =$_REQUEST['email']; $firstname = $_REQUEST['firstname']; $secondname =$_REQUEST['secondname']; $phonenumber =$_REQUEST['phonenumber']; $subject = $_REQUEST['subject']; $comment =$_REQUEST['comment']; //email address mess is sent to subject of email mail ( "mortalsombat@hotmail.com" ,"Email From Customer", "Fist Name: $firstname <p> Second name: $secondname <p> Phone Number: $phonenumber <p> Subject: $subject <p> Message: $comment", "From: $firstname $secondname At: $email \nContent-Type: text/html; charset=iso-8859-1"); header ( "Location: thanks.html" ); ?> </html> <? ob_end_flush();?> Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-330901 Share on other sites More sharing options...
xyn Posted August 22, 2007 Share Posted August 22, 2007 yes [: liek that Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-330903 Share on other sites More sharing options...
shenmue232 Posted August 23, 2007 Author Share Posted August 23, 2007 This code does not work when i load it into dreamweaver this code: $email =$_REQUEST['email']; $firstname = $_REQUEST['firstname']; $secondname =$_REQUEST['secondname']; $phonenumber =$_REQUEST['phonenumber']; $subject = $_REQUEST['subject']; $comment =$_REQUEST['comment']; //email address mess is sent to subject of email mail ( "mortalsombat@hotmail.com" ,"Email From Customer", "Fist Name: $firstname <p> Second name: $secondname <p> Phone Number: $phonenumber <p> Subject: $subject <p> Message: $comment", "From: $firstname $secondname At: $email \nContent-Type: text/html; charset=iso-8859-1"); header ( "Location: thanks.html" ); is all black indicating that its showing as text not php code what have i done wrong Regards shenmue232 Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-331703 Share on other sites More sharing options...
Fjerpje Posted August 23, 2007 Share Posted August 23, 2007 Put some PHP tags arround it <?php ?> And store your receive information in some variables to keep the code understandable Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-331714 Share on other sites More sharing options...
xyn Posted August 23, 2007 Share Posted August 23, 2007 change _REQUEST to _POST Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-331724 Share on other sites More sharing options...
shenmue232 Posted August 23, 2007 Author Share Posted August 23, 2007 Thanks guys that done the trick Quote Link to comment https://forums.phpfreaks.com/topic/66132-php-mail/#findComment-331745 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.