webmaster1 Posted December 7, 2008 Share Posted December 7, 2008 Hi All, Where is the correct place to add my paragraph tags in the following sentence? <?php $message_successa="Thank you "; $message_name=$_POST['name']; $message_successb= "for your interest! Your message has been recieved and will be replied to shortly."; $message_successc= "IP Address: "; $message_ipaddress=getenv('REMOTE_ADDR'); $message_successd="Date Sent: "; $message_now_datetime = date('Y-m-d h:i:s'); echo "$message_successa $message_name $message_successb $message_successc $message_ipaddress $message_successd $message_now_datetime"; ?> Do I add to the variable declaration or the echo? I want to wrap certain variables in <p> so I can style them with an external CSS sheet. Link to comment https://forums.phpfreaks.com/topic/135860-basic-help-php-string-and-echo/ Share on other sites More sharing options...
jnerotrix Posted December 7, 2008 Share Posted December 7, 2008 <?php $message_successa="Thank you "; $message_name=$_POST['name']; $message_successb= "for your interest! Your message has been recieved and will be replied to shortly."; $message_successc= "IP Address: "; $message_ipaddress=getenv('REMOTE_ADDR'); $message_successd="Date Sent: "; $message_now_datetime = date('Y-m-d h:i:s'); echo "<p>$message_successa $message_name $message_successb $message_successc $message_ipaddress $message_successd $message_now_datetime</p>"; ?> That will put all the Text in paragraph format Link to comment https://forums.phpfreaks.com/topic/135860-basic-help-php-string-and-echo/#findComment-708218 Share on other sites More sharing options...
jnerotrix Posted December 7, 2008 Share Posted December 7, 2008 also if you want to make it easier just add <?php $message_successa="Thank you "; $message_name=$_POST['name']; $message_successb= "for your interest! Your message has been recieved and will be replied to shortly."; $message_successc= "IP Address: "; $message_ipaddress=getenv('REMOTE_ADDR'); $message_successd="Date Sent: "; $message_now_datetime = date('Y-m-d h:i:s'); $message = "$message_successa $message_name $message_successb $message_successc $message_ipaddress $message_successd $message_now_datetime"; echo "<p> $message </p>"; ?> Link to comment https://forums.phpfreaks.com/topic/135860-basic-help-php-string-and-echo/#findComment-708220 Share on other sites More sharing options...
webmaster1 Posted December 7, 2008 Author Share Posted December 7, 2008 Ah, that makes sense, cheers. I also made the mistake of using double quotes when calling my class: p class='errorstandardtext' I'll leave this thread open until I'm finished. Link to comment https://forums.phpfreaks.com/topic/135860-basic-help-php-string-and-echo/#findComment-708225 Share on other sites More sharing options...
jnerotrix Posted December 7, 2008 Share Posted December 7, 2008 if you need any css help let me know Link to comment https://forums.phpfreaks.com/topic/135860-basic-help-php-string-and-echo/#findComment-708226 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.