Jump to content

breaking line..


corillo181

Recommended Posts

how do i make text come out the wayt hat the user send type it in the typing box.. cuz when they type comething in to the box like this


hi!
i got a question.
how can i make this work?
thank you.

it come out like this

hi! i got a question. how can i make this work? thank you.

when i echo the text out from the query.
Link to comment
https://forums.phpfreaks.com/topic/34367-breaking-line/
Share on other sites

insert
[code]
<?
include_once'../includes/header.php';
include_once'../includes/db.php';

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

$mess=$_POST['message'];
$sub=$_POST['sub'];
$rusername=$_POST['username'];
$mess=htmlspecialchars($mess);
$sub=htmlspecialchars($sub);
$mess=mysql_real_escape_string($mess);
$sub=mysql_real_escape_string($sub);
$mess=stripslashes($mess);
$sub=stripslashes($sub);
$mess=nlbr
date("F j, Y, g:i a");

$mem=mysql_query("SELECT user_id FROM tra_users WHERE username='$rusername'")or die(mysql_error());
$ruser_id=mysql_fetch_array($mem);
$today = date("F j, Y, g:i a");   

$sql = mysql_query("INSERT INTO tra_users_pms (to_id,from_id,to_username,from_username,time_sent,subject,message,opened,time_opened) VALUES ('".$ruser_id['user_id']."', '$user_id', '$rusername','$username','$today','$sub','$mess', 'no','')") or die(mysql_error());
if($sql){
echo "done";
}

}
?>
[/code]
output
[code]
<tr>
    <td>
<?
$querypms=mysql_query("SELECT * FROM tra_users_pms WHERE to_username='$username' AND pms_id='".$_GET['viewm']."' ORDER BY pms_id DESC")or die(mysql_error());

if($querypms){
$update=mysql_query("UPDATE tra_users_pms SET opened='yes' WHERE pms_id=".$_GET['viewm'])or die (mysql_error());
}
$echopm=mysql_fetch_array($querypms);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="tfs">
      <tr bgcolor="#606060">
        <td>From:  <a href="member.php?un=<?=$echopm['from_username']?>"><?=$echopm['from_username']?></a>      | Reply | Subject:<?=$echopm['subject']?></td>
      </tr>
      <tr class="infotxt">
        <td><?=$echopm['message']?></td>
      </tr>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/34367-breaking-line/#findComment-161734
Share on other sites

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.