remitdlo Posted February 25, 2009 Share Posted February 25, 2009 I have been working on a script and it all works, I am doing an email, but the user wants it also to print out on their screen. I can get it to print but it all runs together. I would like each print line to be seperate. <?php $EmailFrom = "[email protected]"; $EmailTo = "[email protected]"; $Subject = Trim(stripslashes($_POST['Subject'])); $Name = Trim(stripslashes($_POST['Name'])); $Submitted = Trim(stripslashes($_POST['Submitted'])); $Email = Trim(stripslashes($_POST['Email'])); $Date = Trim(stripslashes($_POST['Date'])); $Rates = Trim(stripslashes($_POST['Rates'])); $Messages = Trim(stripslashes($_POST['Messages'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Property Number: "; $Body .= $Subject; $Body .= "\n"; $Body .= "Origin of Request: "; $Body .= $Name; $Body .= "\n"; $Body .= "Submitted By: "; $Body .= $Submitted; $Body .= "\n"; $Body .= "Email Address: "; $Body .= $Email; $Body .= "\n"; $Body .= "Request Date: "; $Body .= $Date; $Body .= "\n"; $Body .= "Rate Changes: "; $Body .= $Rates; $Body .= "\n"; $Body .= "Amenity Added or Corrections: "; $Body .= $Messages; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // Also Print info to screen print "Property Number: $Subject"; print "Origin of Request: $Name"; print "Submitted By: $Submitted"; print "Email Address: $Email"; print "Request Date: $Date"; // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"15;URL=contactthanks.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> Link to comment https://forums.phpfreaks.com/topic/146900-solved-self-taught-newbie-cant-figure-out-how-to-move-to-the-next-line-using-print/ Share on other sites More sharing options...
premiso Posted February 25, 2009 Share Posted February 25, 2009 Basic html, you need to use <br> to "break" and go to the next line. Read up on html, as it is seems you are in need of doing so. Link to comment https://forums.phpfreaks.com/topic/146900-solved-self-taught-newbie-cant-figure-out-how-to-move-to-the-next-line-using-print/#findComment-771244 Share on other sites More sharing options...
remitdlo Posted February 25, 2009 Author Share Posted February 25, 2009 <br />\n Thank you, I couldn't find in any helps and didn't know that I could intermix html and php. Link to comment https://forums.phpfreaks.com/topic/146900-solved-self-taught-newbie-cant-figure-out-how-to-move-to-the-next-line-using-print/#findComment-771264 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.