I'm trying to create a pastebine type I've got my php code
< Code> & lt ;? Php printf ("uniqid ():% s \ r \ n", uniqid ()); ? & Gt; & Lt ;! DOCTYPE html & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "style.css" & gt; & Lt; Title & gt; Xdev - CodeShare & lt; / Title & gt; & Lt; / Head & gt; & Lt; Form method = "post" action = "cslink.php" & gt; & Lt; Textarea cols = "100" rows = "20" name = "text box" & gt; & Lt; / Textarea & gt; & Lt; Br / & gt; & Lt; Input type = "submit" value = "submit now" /> & Lt; / Form & gt;
and to store my php file in my mysql database
& lt; Php requires 'connect.php'; // Connecting to a MySQL database $ conn = mysql_connect ($ host, $ user, $ pass); Mysql_select_db ($ Database); $ Username = $ _POST ['Textbox']; Include $ Sql = "` text` (`id`,` text`) VALUES (NULL, '$ username'); "; $ Revualcle = misc_query ($ sql, $ conn); If (! $ Retval) {dead ('data could not be entered:'. Mysql_error ()); } Echo "Successfully recorded data \ n"; Mysql_close ($ Conn); ? & Gt;
and my view file (also in php)
So if I type:
Hello world test
( Each
will appear in this form: Hello world test
- all in one line
I want to know how I and how to separate it as separate lines As is mentioned by @Itachi, nl2br should resolve this problem.
P>
Comments
Post a Comment