Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


MySQL in HTML format?

  • Please log in to reply
2 replies to this topic

#1 JacobHall


  • Members
  • 300 posts
  • Local time:12:07 AM

Posted 07 May 2011 - 04:34 AM

Hello there,

Getting straight to the point, all emails sent from a script on my server are logged into the database. Now, they are logged into the database in exactly the same format as I have sent them(so with the link breaks, not<br /> just white space)

So, when I fetch them from the database the white space is ignored, I am sure theres a way to have them linebreaks actually break it up and not be lost when being fetched, anyone have any ideas?


BC AdBot (Login to Remove)


#2 ngм


  • Members
  • 98 posts
  • Gender:Male
  • Local time:05:07 PM

Posted 07 May 2011 - 04:41 AM

Can you post the script? It'll make it easier to see what's going on, here.
Nosce te ipsum.

#3 JacobHall

  • Topic Starter

  • Members
  • 300 posts
  • Local time:12:07 AM

Posted 07 May 2011 - 04:47 AM

function replyform($email, $name)
		echo('<div class="notification info">
					<div class="messages">All sent messages are logged, no funny buisness!<div class="close"><img src="img/icon/close.png" alt="close" /></div></div>
		 echo('<div class="text"><div class="form"><form action="main.php?a=sndms" method="post">
		<p><input type="text" class="text medium" id="to" name="to" value="'.$email.'" /> - <b>Email</b><br />
		<input type="text" class="text medium" id="subj" name="subj" value="RE: " /> - <b>Subject</b><br />
		<textarea rows="5" cols="200" class="text big" id="message" name="message">Delete this, and put your message here...</textarea> <br />
		<br /><input type="submit" class="submit" value="Send Email!" /></form></div>');

$email & $name are posted from another page, they are fine

function mail($to, $subject, $message)
	  		mail( $to, $subject, $message, "From: \REDACTED\" <REDACTED>\nReply-To: \"REDACTED\" <REDACTED>\nX-Mailer: PHP/" . phpversion() );
		$logquery = "INSERT INTO `emails` (`id`, `ip`, `date`, `username`, `email`, `subject`, `message`) VALUES (NULL, '".$_SERVER['REMOTE_ADDR']."', '".date('d.m.Y')."', '".$_SESSION['username']."', '".$to."', '".$subject."', '".$message."');";
		$logsql = mysql_query($logquery) or die( mysql_error() );
		echo('<divid="text"><p>You have successfully sent a message to <b>'.$to.'</b>. The contents of the message can be found below<br /><br />
		<b>Receiver:</b> '.$to.'<br />
		<b>Subject:</b> '.$subject.'<br /><br />

So thats how its entered into the database, $logquery


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users