Jump to content

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


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 = "crx@obx.net";

$EmailTo = "tim@thelucian.org";

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

}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.