Hi there,
On one of my forms, there is a section where users can put images etc..and
then it is displayed on my php pages. My question is how do I make it so
that the html formatting is automatically done. For example when someone is
typing something, and wants to start a new paragraph although they press
return when typing when the data is displayed from the MySQL database on a
website it's just continuous text. For it to start a new paragraph they have
to put
in when they are typing in this box. They do not know all the
html formatting codes, and so I need someway of making so that it is easy
for them to have formatted text without doing all the html.
Also things like changing colours, bold, italic and things would be good.
Something like on forums, where when you enter a new post you have all the
formatting options.
Hope this makes sense,
Regards,
Alex.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Formatting a form box
am 12.01.2006 17:36:50 von Bastien Koert
use the nl2br() function to convert the newlines to
bastien
>From: Alex Major
>To:
>Subject: [PHP-DB] Formatting a form box
>Date: Thu, 12 Jan 2006 16:33:01 +0000
>
>Hi there,
>On one of my forms, there is a section where users can put images etc..and
>then it is displayed on my php pages. My question is how do I make it so
>that the html formatting is automatically done. For example when someone is
>typing something, and wants to start a new paragraph although they press
>return when typing when the data is displayed from the MySQL database on a
>website it's just continuous text. For it to start a new paragraph they
>have
>to put
in when they are typing in this box. They do not know all the
>html formatting codes, and so I need someway of making so that it is easy
>for them to have formatted text without doing all the html.
>Also things like changing colours, bold, italic and things would be good.
>Something like on forums, where when you enter a new post you have all the
>formatting options.
>
>Hope this makes sense,
>Regards,
>Alex.
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Formatting a form box
am 12.01.2006 17:47:01 von MIGUEL ANTONIO GUIRAO AGUILAR
One approach is to ask the user to input a text delimiter, like a "@", for
example, in every point where there should be a new line or paragraph.
Then, you should parse the text, and at every point you find a "@", tu place
a " " or "
" or any other HTML tag that best suits your need!!
This is just one solution, but I'm pretty sure there others!!
Mike Guirao
-----Original Message-----
From: Alex Major [mailto:alex.major@allydm.co.uk]
Sent: Jueves, 12 de Enero de 2006 10:33 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] Formatting a form box
Hi there,
On one of my forms, there is a section where users can put images etc..and
then it is displayed on my php pages. My question is how do I make it so
that the html formatting is automatically done. For example when someone is
typing something, and wants to start a new paragraph although they press
return when typing when the data is displayed from the MySQL database on a
website it's just continuous text. For it to start a new paragraph they have
to put
in when they are typing in this box. They do not know all the
html formatting codes, and so I need someway of making so that it is easy
for them to have formatted text without doing all the html.
Also things like changing colours, bold, italic and things would be good.
Something like on forums, where when you enter a new post you have all the
formatting options.
Hope this makes sense,
Regards,
Alex.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos.
This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may b
e used or reproduced in any manner whatsoever.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Formatting a form box
am 12.01.2006 18:41:18 von Trevor Gryffyn
What? Nobody said "This has nothing to do with PHP and databases?" Sheesh... someone must be sleeping. :) Ok, so it sorta does relate..
But yeah... no2br() will do it for you. Textarea input types DO send a newline and/or carriage return (didn't test and might be system specific), so if you just take your form $_POST data and use nl2br() before you store it in the database (or probably after... should be able to store a newline/carriage return in the database) it should produce the results you desire.
test.php:
if (isset($_POST['testarea'])) {
echo nl2br($_POST['testarea']);
}
?>
Look at the source code after you submit if you have any doubts/questions.
-TG
= = = Original message = = =
use the nl2br() function to convert the newlines to
bastien
>From: Alex Major
>To:
>Subject: [PHP-DB] Formatting a form box
>Date: Thu, 12 Jan 2006 16:33:01 +0000
>
>Hi there,
>On one of my forms, there is a section where users can put images etc..and
>then it is displayed on my php pages. My question is how do I make it so
>that the html formatting is automatically done. For example when someone is
>typing something, and wants to start a new paragraph although they press
>return when typing when the data is displayed from the MySQL database on a
>website it's just continuous text. For it to start a new paragraph they
>have
>to put
in when they are typing in this box. They do not know all the
>html formatting codes, and so I need someway of making so that it is easy
>for them to have formatted text without doing all the html.
>Also things like changing colours, bold, italic and things would be good.
>Something like on forums, where when you enter a new post you have all the
>formatting options.
>
>Hope this makes sense,
>Regards,
>Alex.
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Formatting a form box
am 12.01.2006 20:19:05 von El Bekko
Miguel Guirao wrote:
>
> One approach is to ask the user to input a text delimiter, like a "@", for
> example, in every point where there should be a new line or paragraph.
> Then, you should parse the text, and at every point you find a "@", tu place
> a " " or "
" or any other HTML tag that best suits your need!!
>
> This is just one solution, but I'm pretty sure there others!!
>
> Mike Guirao
>
> -----Original Message-----
> From: Alex Major [mailto:alex.major@allydm.co.uk]
> Sent: Jueves, 12 de Enero de 2006 10:33 a.m.
> To: php-db@lists.php.net
> Subject: [PHP-DB] Formatting a form box
>
>
> Hi there,
> On one of my forms, there is a section where users can put images etc..and
> then it is displayed on my php pages. My question is how do I make it so
> that the html formatting is automatically done. For example when someone is
> typing something, and wants to start a new paragraph although they press
> return when typing when the data is displayed from the MySQL database on a
> website it's just continuous text. For it to start a new paragraph they have
> to put
in when they are typing in this box. They do not know all the
> html formatting codes, and so I need someway of making so that it is easy
> for them to have formatted text without doing all the html.
> Also things like changing colours, bold, italic and things would be good.
> Something like on forums, where when you enter a new post you have all the
> formatting options.
>
> Hope this makes sense,
> Regards,
> Alex.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos.
>
> This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may
be used or reproduced in any manner whatsoever.
The nl2br() function is way better because you don't change email adressess.
And for the colours and stuff... just put a small note on the bottom of
your post page what HTML tags they are allowed to use.
Greets, El Bekko
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Formatting a form box
am 12.01.2006 20:42:33 von Alex Major
Thanks for the suggestions, the nl2br has been a common suggestion and think
that I have found more of what the problem is. (And it is kinda php specific
cause its php pages). Basically its not displaying it correctly on the page,
the text in the database is now being stored correctly (with lines / breaks
where they are supposed to be) but for some reason when that info is then
pulled from the database, the lines get removed.
Any ideas why?
On 12/1/06 17:41, "tg-php@gryffyndevelopment.com" wrote:
> What? Nobody said "This has nothing to do with PHP and databases?" Sheesh...
> someone must be sleeping. :) Ok, so it sorta does relate..
>
> But yeah... no2br() will do it for you. Textarea input types DO send a
> newline and/or carriage return (didn't test and might be system specific), so
> if you just take your form $_POST data and use nl2br() before you store it in
> the database (or probably after... should be able to store a newline/carriage
> return in the database) it should produce the results you desire.
>
> test.php:
>
>
>
>
> if (isset($_POST['testarea'])) {
>
> echo nl2br($_POST['testarea']);
>
> }
> ?>
>
> Look at the source code after you submit if you have any doubts/questions.
>
> -TG
>
> = = = Original message = = =
>
> use the nl2br() function to convert the newlines to
>
>
> bastien
>
>> From: Alex Major
>> To:
>> Subject: [PHP-DB] Formatting a form box
>> Date: Thu, 12 Jan 2006 16:33:01 +0000
>>
>> Hi there,
>> On one of my forms, there is a section where users can put images etc..and
>> then it is displayed on my php pages. My question is how do I make it so
>> that the html formatting is automatically done. For example when someone is
>> typing something, and wants to start a new paragraph although they press
>> return when typing when the data is displayed from the MySQL database on a
>> website it's just continuous text. For it to start a new paragraph they
>> have
>> to put
in when they are typing in this box. They do not know all the
>> html formatting codes, and so I need someway of making so that it is easy
>> for them to have formatted text without doing all the html.
>> Also things like changing colours, bold, italic and things would be good.
>> Something like on forums, where when you enter a new post you have all the
>> formatting options.
>>
>> Hope this makes sense,
>> Regards,
>> Alex.
>
>
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Formatting a form box
am 12.01.2006 22:35:48 von Bastien Koert
show the code bit relevant to the nl2br issue and conversion
bastien
>From: Alex Major
>To: ,
>Subject: Re: [PHP-DB] Formatting a form box
>Date: Thu, 12 Jan 2006 19:42:33 +0000
>
>Thanks for the suggestions, the nl2br has been a common suggestion and
>think
>that I have found more of what the problem is. (And it is kinda php
>specific
>cause its php pages). Basically its not displaying it correctly on the
>page,
>the text in the database is now being stored correctly (with lines / breaks
>where they are supposed to be) but for some reason when that info is then
>pulled from the database, the lines get removed.
>Any ideas why?
>
>
>On 12/1/06 17:41, "tg-php@gryffyndevelopment.com"
> wrote:
>
> > What? Nobody said "This has nothing to do with PHP and databases?"
>Sheesh...
> > someone must be sleeping. :) Ok, so it sorta does relate..
> >
> > But yeah... no2br() will do it for you. Textarea input types DO send a
> > newline and/or carriage return (didn't test and might be system
>specific), so
> > if you just take your form $_POST data and use nl2br() before you store
>it in
> > the database (or probably after... should be able to store a
>newline/carriage
> > return in the database) it should produce the results you desire.
> >
> > test.php:
> >
> >
> >
> >
> > if (isset($_POST['testarea'])) {
> >
> > echo nl2br($_POST['testarea']);
> >
> > }
> > ?>
> >
> > Look at the source code after you submit if you have any
>doubts/questions.
> >
> > -TG
> >
> > = = = Original message = = =
> >
> > use the nl2br() function to convert the newlines to
> >
> >
> > bastien
> >
> >> From: Alex Major
> >> To:
> >> Subject: [PHP-DB] Formatting a form box
> >> Date: Thu, 12 Jan 2006 16:33:01 +0000
> >>
> >> Hi there,
> >> On one of my forms, there is a section where users can put images
>etc..and
> >> then it is displayed on my php pages. My question is how do I make it
>so
> >> that the html formatting is automatically done. For example when
>someone is
> >> typing something, and wants to start a new paragraph although they
>press
> >> return when typing when the data is displayed from the MySQL database
>on a
> >> website it's just continuous text. For it to start a new paragraph they
> >> have
> >> to put
in when they are typing in this box. They do not know all
>the
> >> html formatting codes, and so I need someway of making so that it is
>easy
> >> for them to have formatted text without doing all the html.
> >> Also things like changing colours, bold, italic and things would be
>good.
> >> Something like on forums, where when you enter a new post you have all
>the
> >> formatting options.
> >>
> >> Hope this makes sense,
> >> Regards,
> >> Alex.
> >
> >
> > ___________________________________________________________
> > Sent by ePrompter, the premier email notification software.
> > Free download at http://www.ePrompter.com.
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php