well, it is time for some fine tuning of my application, after adding
that banner script for which I needed percentage solution, I would like
to fix my forum scripts...
when someone write some text in form's textarea and then
enter
new line (btw, is that \r or \n or combination?) I'm not "getting" that
new line but space. what can I do to "recieve" and store (in mysql db)
text with newlines instead of spaces. and, even better, to replace that
newline with </p>\n<p>...
tnx again
--
Ja NE http://fotozine.org/?omen=janimir
-- 3 1611
Ja NE <hi****@mail.zz> wrote:
....ok.
have it ;-))
$tekst = preg_replace("/\r\n/", "\n", $tekst);
$tekst = preg_replace("/\n/", "</p>\n<p>", $tekst);
thank you "manual" ;-) well, it is time for some fine tuning of my application, after adding that banner script for which I needed percentage solution, I would like to fix my forum scripts... when someone write some text in form's textarea and then enter new line (btw, is that \r or \n or combination?) I'm not "getting" that new line but space. what can I do to "recieve" and store (in mysql db) text with newlines instead of spaces. and, even better, to replace that newline with </p>\n<p>...
tnx again
--
Ja NE http://fotozine.org/?omen=janimir
--
Ja NE wrote: when someone write some text in form's textarea and then enter new line (btw, is that \r or \n or combination?) I'm not "getting" that new line but space. what can I do to "recieve" and store (in mysql db) text with newlines instead of spaces. and, even better, to replace that newline with </p>\n<p>...
I've just done something very similar:
$description=$_POST['textarea'];
$description = strip_tags($description); // Remove any HTML tags
$description = "<p>".$description; // Add <p> to start
$description = str_replace("\r\n","</p><p>", $description); // Replace
new lines with paragraph
if(substr($description,-3)=="<p>") // Remove last <p> from description
$description = substr($description,0,-3);
Ja NE wrote: well, it is time for some fine tuning of my application, after adding that banner script for which I needed percentage solution, I would like to fix my forum scripts... when someone write some text in form's textarea and then enter new line (btw, is that \r or \n or combination?) I'm not "getting" that new line but space. what can I do to "recieve" and store (in mysql db) text with newlines instead of spaces. and, even better, to replace that newline with </p>\n<p>...
tnx again
Jane,
That's the way HTML works - if you look at the page source and you'll
see the newlines in there. But processing the HTML gets rid of them.
You need to use something like PHP's nl2br() function to convert newline
characters to html breaks.
It can get very confusing when a newline "isn't" a newline!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
================== This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Katrin Limp?ck |
last post by:
Hi all,
is there a possiblity to count the lines in a sub report?
Background: I have a form, where to put data, in this form there is a
fixed place, where I put the sub report. I know, that I...
|
by: Rolf |
last post by:
I have a form with about 15 to 20 lines. Their names are LineXXX. What code
can I put in the click event of a button to delete all the lines?
Thanks!
Rolf
|
by: Brian |
last post by:
Hello all..
Am working on an Air Hockey game... have an table loaded into a
picture box. The borders of the table are slightly slanted. Am using
hit testing lines with GDI+ to manipulate the...
|
by: George |
last post by:
Dear colleagues,
I refer to your help with specific graphic problem. It is
necessary to create a viewfinder in graphic application.
It seems that the algorithm is simple: just draw lines
in...
|
by: Paul Mars |
last post by:
I need to limit multiline textbox to 3 lines of text and if there are less
then 3 lines when leaving, add empty line holders. How can I do this??
Thanks,
paul
|
by: Mark |
last post by:
Hello all -
I'm creating an application that uses a datagridview control. My
development environment is an HP Laptop with a NVIDIA Geforce 4 440 Go
64M.
While using this object, a queer...
|
by: davetelling |
last post by:
I am not a programmer, I'm an engineer trying to make an interface to a
product I'm designing. I have used C# to make a form that interrogates the
unit via the serial port and receives the data. I...
|
by: =?Utf-8?B?TG9zdEluTUQ=?= |
last post by:
Hi All :)
I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView.
True DBGrid has a MultipleLines property that controls whether individual
records span multiple lines. Is...
|
by: =?Utf-8?B?R2lkaQ==?= |
last post by:
Hi,
I've windows form, in this form i've a panel.
I want to draw lines inside the panel using the panel coordinates( meaing
that the left upper corner of the panel is 0,0), how can i do it?
...
|
by: Gustaf |
last post by:
Hi all,
Just for fun, I'm working on a script to count the number of lines in source files. Some lines are auto-generated (by the IDE) and shouldn't be counted. The auto-generated part of files...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |