06-22-2002, 02:58 PM
when i post form to .php file, does my text in variable have ENTER sign, becouse when i post something like this:
i get something like this:
BLA BLA BLA BLA
instead of new line, i get 2 spaces. is this wrong to php, or to html?
06-22-2002, 03:17 PM
This is because carriage return line feed (Enter or CRLF) in the text that you posted are real, character based sets. However, in HTML, the code for a CRLF is <BR>. So simply replace all instances of Chr$(10) & Chr$(13) with a <BR>.
06-22-2002, 03:19 PM
Where are you seeing the BLA BLA BLA BLA? Are you just sending
the value of the variable back to the browser? What do the tags
look like where you include the textarea in the form?
06-23-2002, 07:54 AM
when i send variable $Komentar here it goes code for textbox
<input type="text" name="email" size="38" maxlenght="18" tabindex="3"></font></p>
<p align="center"><font face="Verdana" size="1"> <b>Komentar<font color="#FF0000">*</font></b> ( npr.
Vaše mišljenje o sajtu ) : <br>
and i put in text box something like
and then, i send it to this php file
fputs($fajl, " <font face=\"Verdana\" size=\"1\">\r\n");
fputs($fajl, " <td width=\"100%\"><font face=\"Verdana\" size=\"1\">$Komentar</font><br><br></td>\r\n");
fputs($fajl, " </font></tr>\r\n");
fputs($fajl, " </table>\r\n");
fputs($fajl, " </center>\r\n");
and then, my output is
BLA BLA BLA BLA
so , i don't have new line, how to do that, or i have to replace that char10 with <br>, and how to do that?
06-23-2002, 05:08 PM
I could be very wrong, but I believe if you want multiline text
posted back you need to use a textarea. Something like...
<textarea name="email" rows="4" cols="20" wrap="hard" tabindex="3"></textarea>
06-24-2002, 06:43 AM
Thinker is correct, an INPUT of type "TEXT" will not allow multilines. Why on earth would you want a multiline email address anyway? Ah, maybe you want them to enter more than one email? I see....
Ok, change from an INPUT to a TEXTAREA as Thinker suggested above, but I'm pretty sure you'll still need to replace all the CRLF characters with a "<BR>".
06-27-2002, 04:58 PM
what is code for changinf ENTER (character i dont know :)) to <br> ???
06-27-2002, 09:42 PM
Look up the nl2br(string) function.
06-28-2002, 02:59 PM
thanks, i made it with str_replace command.
07-01-2002, 08:57 PM
You can use the nl2br function to translate newlines to <BR>'s.