Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

HTML, PHP, formating a text area when emailed

Hello,

I am using an html text area box and I would like it so that when it is emailed using my php script it keeps the returns.

Any idea of how to do that without java?
0
movieprodw
Asked:
movieprodw
  • 2
1 Solution
 
Dean OBrienCommented:
Post your code
0
 
movieprodwAuthor Commented:
       $entry = mysql_real_escape_string($_POST['entry']);


if(isset($_POST['email'])){

mysql_query("update notes set entry='$entry', list_date='$list_date' where userid='$userid'")or die(mysql_error());


        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 
             $to = $email2;
 

        $message = $message . $entry;


 
 
        //echo("The value received is " . $to .  "<BR>" . $subject .  "<BR>" . $message .  "<BR>" .$headers );
        mail ($to, $subject, $message, $headers);
        header("target: _self");
 echo 'emailed';
 header("Location: control_panel_notebook.php?msg=Your entry has been sent.");

0
 
Dean OBrienCommented:
Its not really clear what you mean, keeps and returns... does the above script send an email correctly? please be more specific.
0
 
NerdsOfTechTechnology ScientistCommented:
use nl2br
http://us2.php.net/manual/en/function.nl2br.php
$entry = mysql_real_escape_string($_POST['entry']);
 
 
if(isset($_POST['email'])){
 
mysql_query("update notes set entry='$entry', list_date='$list_date' where userid='$userid'")or die(mysql_error());
 
 
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
 
             $to = $email2;
 
 
        $message = $message . $entry;
        $message = nl2br($message);
 
 
 
 
        //echo("The value received is " . $to .  "<BR>" . $subject .  "<BR>" . $message .  "<BR>" .$headers );
        mail ($to, $subject, $message, $headers);
        header("target: _self");
 echo 'emailed';
 header("Location: control_panel_notebook.php?msg=Your entry has been sent.");

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now