Jump to content

[SOLVED] Self taught newbie, can't figure out how to move to the next line using print


remitdlo

Recommended Posts

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\">";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.