php-general Digest 30 Nov 2003 06:29:41 -0000 Issue 2445

Topics (messages 171364 through 171388):

Re: Problem loading fonts in gd()
        171364 by: Jason Wong
        171366 by: Eric
        171367 by: Jason Wong

Re: Checking if a host is online
        171365 by: Duncan
        171370 by: Jason Giangrande
        171374 by: jacob.keystreams.com

php blog site for 123php.com
        171368 by: Ryan A
        171369 by: Boaz Yahav
        171383 by: Ryan A

completely stumped by ereg()
        171371 by: Greg Beaver
        171372 by: sophie.sitadelle.com

Problem in the output of an array
        171373 by: orlandopozo.icnet.com.ve
        171375 by: orlandopozo.icnet.com.ve
        171376 by: sophie.sitadelle.com
        171377 by: sophie.sitadelle.com
        171378 by: Robert Cummings
        171379 by: Greg Beaver
        171380 by: Robert Cummings
        171381 by: john
        171384 by: Robert Cummings

move_uploaded_file, umask, and permissions
        171382 by: David T-G

entering in text data and losing the \n
        171385 by: Randy  Johnson
        171386 by: John Nichel
        171387 by: Chris Shiflett
        171388 by: Randy  Johnson

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Saturday 29 November 2003 23:15, Eric wrote:

> I have a small problem about loading fonts with imageloadfont()
>
> I have copyed fonts with the extension .fon or .ttf to the same directory
> as my script, and i give them the font as an argument:
>
> $font = imageloadfont('arial.ttf');
>
> But i just keep getting the message:
> Warning: imageloadfont(): Error reading font in c:\program files\apache
> group\apache\htdocs\gd_test.php on line 35
>
> Does anyone know how to properly load fonts into gd, without getting this
> error message?

Try using the full, absolute path to the font.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
There is no such thing as the "right feed
                -- Murphy's Horse Laws n18
*/

--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 29 November 2003 23:15, Eric wrote:
>
> > I have a small problem about loading fonts with imageloadfont()
> >
> > I have copyed fonts with the extension .fon or .ttf to the same
directory
> > as my script, and i give them the font as an argument:
> >
> > $font = imageloadfont('arial.ttf');
> >
> > But i just keep getting the message:
> > Warning: imageloadfont(): Error reading font in c:\program files\apache
> > group\apache\htdocs\gd_test.php on line 35
> >
> > Does anyone know how to properly load fonts into gd, without getting
this
> > error message?
>
> Try using the full, absolute path to the font.
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> There is no such thing as the "right feed
> -- Murphy's Horse Laws n18
> */

I have already tried that:

imageloadfont("C:/WINDOWS/Fonts/arial.ttf");

i also tried:

imageloadfont("C:\\WINDOWS\\Fonts\\arial.ttf");

I ALSO tried this:

imageloadfont($_SERVER['DOCUMENT_ROOT'].'/gd_test.php');

and that didn't work either....

So I'm unfortunately still stuck.


Eric

--- End Message ---
--- Begin Message ---
On Sunday 30 November 2003 03:59, Eric wrote:
> I have already tried that:
>
> imageloadfont("C:/WINDOWS/Fonts/arial.ttf");
>
> i also tried:
>
> imageloadfont("C:\\WINDOWS\\Fonts\\arial.ttf");
>
> I ALSO tried this:
>
> imageloadfont($_SERVER['DOCUMENT_ROOT'].'/gd_test.php');
>
> and that didn't work either....
>
> So I'm unfortunately still stuck.

If you're using TTF fonts then you should be using imagettftext().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Peers's Law:
        The solution to a problem changes the nature of the problem.
*/

--- End Message ---
--- Begin Message ---
Jason Giangrande said:

> command (ping -c 1 $host), and while I could get that to work, since it
> returns non-zero status if the host can not be contacted, it takes quite
> a while to execute for even a few hosts at once.

fping may help.

Running a background job that just monitors ping status and updates a record
somewhere is probably the best way.  The PHP script needs only read the
records to understand the status of the 'world'.  As mentioned, this is what
big brother does, to a certain extent.

--- End Message ---
--- Begin Message ---
On Sat, 2003-11-29 at 12:32, David T-G wrote:
> 3) At the very least, cut your ping timeout down to the smallest
> acceptable; in general, a full second is plenty of time to get nearly
> anywhere on your continent (ain't it great? :-) and so your intranet
> should be more than happy with that allowance.
> 
> HTH & HAND
> 
> :-D

Thanks for your help guys.  Cutting the ping timeout helped speed things
up quite a bit.  I will also look into BigBrother and your other
suggestions.  Thanks again.
-- 
Jason Giangrande <[EMAIL PROTECTED]>
http://www.giangrande.org
http://www.dogsiview.com

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---

This may be OT but have you looked at Netsaint (http://www.netsaint.org/ and http://www.netsaint.org/indexold.php), now called Nagios (http://www.nagios.org/) by the looks of it. Note: It's not written in PHP from what I remember. You may be able to get some ideas from it or even use it. I've used it in the past to monitor a small web cluster and it worked nicely. Additionally, freshmeat has a bunch of network monitors listed written in PHP.

Jason Giangrande wrote:
I'm creating an application for an Intranet that, among other things, is
supposed to check to see if particular hosts are online, and if so, what
their IP address is. Anyone know how I can accomplish this? I tried
using exec("host $host"); (where $host is the hostname) and while this
gets the IP it gets the IP address sometimes even if the host is not
active, because a DNS record for the system still exists. I also looked
into the gethostbyname() function, but that has similar problems to
using the external host command. I also tried to use an external ping
command (ping -c 1 $host), and while I could get that to work, since it
returns non-zero status if the host can not be contacted, it takes quite
a while to execute for even a few hosts at once.

Anyone ever do this king=d of thing before or have any suggestions on
what might work?

-- "No, mon, let's go home to Jamaica. I and I been in Babylon too long." -- Homer Simpson

--- End Message ---
--- Begin Message ---
Hi,
Can anyone recomend a good blog software that does the following:

1. Have differient articles on the first page and show the first x ( or 10)
words then a link to the rest
eg
Php make leaps and bounds in the field of ... click here to read article

2. Users have to register to post replies/comments (or if possible to read
the whole article)

3. makes search engine friendly urls
eg
123php.com/blog/article777

I have checked hotscripts:
http://www.hotscripts.com/cgi-bin/search.cgi?bool=AND&query=blog&catid=2

and these ones seems a bit good,
http://dev2.bblog.com/item/19/
http://www.acervus.ca/

Any URLs/ideas/suggestions etc are most welcome.

Thanks,
-Ryan

--- End Message ---
--- Begin Message ---
Have a look at http://www.weberblog.com.
If the site does what you need, you can follow the powered by link on
the bottom of every page.

Sincerely
 
berber
 
Visit http://www.weberdev.com/ & http://www.weberblog.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Share your thoughts : http://www.weberblog.com/submit.php?type=story


-----Original Message-----
From: Ryan A [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 29, 2003 10:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php blog site for 123php.com


Hi,
Can anyone recomend a good blog software that does the following:

1. Have differient articles on the first page and show the first x ( or
10) words then a link to the rest eg Php make leaps and bounds in the
field of ... click here to read article

2. Users have to register to post replies/comments (or if possible to
read the whole article)

3. makes search engine friendly urls
eg
123php.com/blog/article777

I have checked hotscripts:
http://www.hotscripts.com/cgi-bin/search.cgi?bool=AND&query=blog&catid=2

and these ones seems a bit good,
http://dev2.bblog.com/item/19/
http://www.acervus.ca/

Any URLs/ideas/suggestions etc are most welcome.

Thanks,
-Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,
Nope, installed the 26 megs but still its not all that good...at least I
couldnt get it to work...

one last requirment i forgot to mention was...I need to ask the user if the
article was good and to rate it from 1-10 like hotscripts etc

Any ideas?

All we will have on 123php.com is articles.

Thanks,
-Ryan



----- Original Message ----- 
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "Ryan A" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, November 29, 2003 10:19 PM
Subject: RE: [PHP] php blog site for 123php.com


Have a look at http://www.weberblog.com.
If the site does what you need, you can follow the powered by link on
the bottom of every page.

Sincerely

berber

Visit http://www.weberdev.com/ & http://www.weberblog.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Share your thoughts : http://www.weberblog.com/submit.php?type=story


-----Original Message-----
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 29, 2003 10:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php blog site for 123php.com


Hi,
Can anyone recomend a good blog software that does the following:

1. Have differient articles on the first page and show the first x ( or
10) words then a link to the rest eg Php make leaps and bounds in the
field of ... click here to read article

2. Users have to register to post replies/comments (or if possible to
read the whole article)

3. makes search engine friendly urls
eg
123php.com/blog/article777

I have checked hotscripts:
http://www.hotscripts.com/cgi-bin/search.cgi?bool=AND&query=blog&catid=2

and these ones seems a bit good,
http://dev2.bblog.com/item/19/
http://www.acervus.ca/

Any URLs/ideas/suggestions etc are most welcome.

Thanks,
-Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message --- Why doesn't this match?

var_dump(ereg('C:\\\\W', 'C:\\\\WINNT\\\\TEMP\\tst5B.tmp'));

should print int(1), prints bool(false)

Thanks,
Greg

--- End Message ---
--- Begin Message ---
You should try

var_dump(ereg('C:\\\\W', 'C:\\WINNT\\TEMP\tst5B.tmp'));

The reason is that in simple quotes, antislashes don't have to be
escaped. Still, they need to be escaped in a regular epr ie in the first
argument of ereg() (the first and the secon argument are both string,
but in the reakity they are not really the same type)

> Why doesn't this match?
>
> var_dump(ereg('C:\\\\W', 'C:\\\\WINNT\\\\TEMP\\tst5B.tmp'));
>
> should print int(1), prints bool(false)
>
> Thanks,
> Greg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I have this code, I would like, if this could be done

<?
$array['dim1']['dim2']['dim3'][3] = "value";

$dim1 = 'dim1';
$dim2 = 'dim2';
$dim3 = 'dim3';
$dim4 = 3;

$test = "[$dim1][$dim2][$dim3][$dim4]";  
$result = "$array$test";

echo $result;
?>

The output is : Array[dim1][dim2][dim3][3]

I need that the output was: value

Thanks in advanced for any help.

--- End Message ---
--- Begin Message ---
I have this code, I would like, if this could be done

<?
$array['dim1']['dim2']['dim3'][3] = "value";

$dim1 = 'dim1';
$dim2 = 'dim2';
$dim3 = 'dim3';
$dim4 = 3;

$test = "[$dim1][$dim2][$dim3][$dim4]";  
$result = "$array$test";

echo $result;
?>

The output is : Array[dim1][dim2][dim3][3]

I need that the output was: value

Thanks in advanced for any help.

--- End Message ---
--- Begin Message ---
I'm soory but your code doesn't make me understand what you want to do...
Be more precise, it will help you to get some help

> I have this code, I would like, if this could be done
>
> <?
> $array['dim1']['dim2']['dim3'][3] = "value";
>
> $dim1 = 'dim1';
> $dim2 = 'dim2';
> $dim3 = 'dim3';
> $dim4 = 3;
>
> $test = "[$dim1][$dim2][$dim3][$dim4]";
> $result = "$array$test";
>
> echo $result;
> ?>
>
> The output is : Array[dim1][dim2][dim3][3]
>
> I need that the output was: value
>
> Thanks in advanced for any help.

--- End Message ---
--- Begin Message ---
now i understand your pb but have no idea to solve it
good luck...

> I'm soory but your code doesn't make me understand what you want to
> do... Be more precise, it will help you to get some help
>
> I have this code, I would like, if this could be done
>
>> > <?
>> > $array['dim1']['dim2']['dim3'][3] = "value";
>> >
>> > $dim1 = 'dim1';
>> > $dim2 = 'dim2';
>> > $dim3 = 'dim3';
>> > $dim4 = 3;
>> >
>> > $test = "[$dim1][$dim2][$dim3][$dim4]";
>> > $result = "$array$test";
>> >
>> > echo $result;
>> > ?>
>
> The output is : Array[dim1][dim2][dim3][3]
>
> I need that the output was: value
>
> Thanks in advanced for any help.
>
> ----------------------------------------------------------------------------
> ---------
>
> This situation above was presented in a class that I have been
> developing, I want the value of the array, that is "value", but the
> script print Array[dim1][dim2][dim3][3], I don't if there is another way
> to do that but as the way above, I hope
> you can understand my problem, thanks for any help :).

--- End Message ---
--- Begin Message ---
On Sat, 2003-11-29 at 19:29, [EMAIL PROTECTED] wrote:
> I'm soory but your code doesn't make me understand what you want to do...
> Be more precise, it will help you to get some help
> 
> > I have this code, I would like, if this could be done
> >
> > <?
> > $array['dim1']['dim2']['dim3'][3] = "value";
> >
> > $dim1 = 'dim1';
> > $dim2 = 'dim2';
> > $dim3 = 'dim3';
> > $dim4 = 3;
> >
> > $test = "[$dim1][$dim2][$dim3][$dim4]";
> > $result = "$array$test";
> >
> > echo $result;
> > ?>
> >
> > The output is : Array[dim1][dim2][dim3][3]
> >
> > I need that the output was: value

$test = $array[$dim1][$dim2][$dim3][$dim4];

or:

$test = 'some text '.$array[$dim1][$dim2][$dim3][$dim4].' more text.';

or (untested since I never use this style):

$test = "some text {$array[$dim1][$dim2][$dim3][$dim4]} more text.";

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
<?php
$array['dim1']['dim2']['dim3'][3] = "value";

$dim1 = 'dim1';
$dim2 = 'dim2';
$dim3 = 'dim3';
$dim4 = 3;

$result = "{$array[$dim1][$dim2][$dim3][$dim4]}";

echo $result;
?>

Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org

[EMAIL PROTECTED] wrote:
I have this code, I would like, if this could be done

<?
$array['dim1']['dim2']['dim3'][3] = "value";

$dim1 = 'dim1';
$dim2 = 'dim2';
$dim3 = 'dim3';
$dim4 = 3;

$test = "[$dim1][$dim2][$dim3][$dim4]"; $result = "$array$test";

echo $result;
?>

The output is : Array[dim1][dim2][dim3][3]

I need that the output was: value

Thanks in advanced for any help.


--- End Message ---
--- Begin Message ---
On Sat, 2003-11-29 at 19:47, Robert Cummings wrote:
> On Sat, 2003-11-29 at 19:29, [EMAIL PROTECTED] wrote:
> > I'm soory but your code doesn't make me understand what you want to do...
> > Be more precise, it will help you to get some help
> > 
> > > I have this code, I would like, if this could be done
> > >
> > > <?
> > > $array['dim1']['dim2']['dim3'][3] = "value";
> > >
> > > $dim1 = 'dim1';
> > > $dim2 = 'dim2';
> > > $dim3 = 'dim3';
> > > $dim4 = 3;
> > >
> > > $test = "[$dim1][$dim2][$dim3][$dim4]";
> > > $result = "$array$test";
> > >
> > > echo $result;
> > > ?>
> > >
> > > The output is : Array[dim1][dim2][dim3][3]
> > >
> > > I need that the output was: value
> 

Ignore my last answer, I read your problem wrong. Answer below:

<?
$array['dim1']['dim2']['dim3'][3] = "value";

$dim1 = 'dim1';
$dim2 = 'dim2';
$dim3 = 'dim3';
$dim4 = 3;

$test = '[$dim1][$dim2][$dim3][$dim4]';

$result = eval( 'return $array'.$test.';' );
echo $result;
?>

HTH,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
$result = eval( 'return $array'.$test.';' );

Um...

echo $array[$dim1][$dim2][$dim3][$dim4];

eval == evil. I can't think of a single legimiate reason why you'd want/need to make a string "[$dim1]...." first, and if you have to I'd suspect that something is very wrong with the way you are writing your script.

Feel free to prove me wrong, though :)

John



Robert Cummings writes:

On Sat, 2003-11-29 at 19:47, Robert Cummings wrote:
On Sat, 2003-11-29 at 19:29, [EMAIL PROTECTED] wrote:
> I'm soory but your code doesn't make me understand what you want to do...
> Be more precise, it will help you to get some help
> > > I have this code, I would like, if this could be done
> >
> > <?
> > $array['dim1']['dim2']['dim3'][3] = "value";
> >
> > $dim1 = 'dim1';
> > $dim2 = 'dim2';
> > $dim3 = 'dim3';
> > $dim4 = 3;
> >
> > $test = "[$dim1][$dim2][$dim3][$dim4]";
> > $result = "$array$test";
> >
> > echo $result;
> > ?>
> >
> > The output is : Array[dim1][dim2][dim3][3]
> >
> > I need that the output was: value


Ignore my last answer, I read your problem wrong. Answer below:

<?
$array['dim1']['dim2']['dim3'][3] = "value";

$dim1 = 'dim1';
$dim2 = 'dim2';
$dim3 = 'dim3';
$dim4 = 3;

$test = '[$dim1][$dim2][$dim3][$dim4]';

$result = eval( 'return $array'.$test.';' );
echo $result;
?>

HTH,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
On Sat, 2003-11-29 at 21:25, john wrote:
> > $result = eval( 'return $array'.$test.';' );
> 
> Um... 
> 
> echo $array[$dim1][$dim2][$dim3][$dim4]; 
> 
> eval == evil. I can't think of a single legimiate reason why you'd want/need 

Eval is not evil, but it is often insecurely used. It has it's purpose
otherwise it wouldn't exist.

> to make a string "[$dim1]...." first, and if you have to I'd suspect that 
> something is very wrong with the way you are writing your script. 

*shrug* I merely answered what appeared to be the posed problem. I never
indicated why one might do what the original poster was doing, nor was
it an issue for my answer. That said, there are definitely uses whether
you happen to have one handy or not.

> Feel free to prove me wrong, though :) 

Different strokes for different folks :)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hi, all --

I have set my umask to 117 (and I change it when making a directory) and
I use move_uploaded_file to handle submitted files.

The temporary file is mode 600 when it lands in /var/tmp but somehow gets
changed to 666 during the move.  It seems that move_uploaded_file changes
the file perms and yet does not honor the umask.

Must I really run chmod() on every move_uploaded_file() I process?  Isn't
there a better way?


TIA & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
I have a form with a text area.

When the user submits the data it is saved to a mysql database in a field of type text.

When I extract the data from the database and display it in php it loses the line 
return and the data is all crammed together.   Here is an example

This is line 1
This is line 2
This is line 3

Here is what it would be after I extracted it and displayed it to the screen

This is line 1 This is line 2 This is line 3
 
What do I need to do to get it to retain the line feeds?

Thanks

Randy

--- End Message ---
--- Begin Message --- Randy Johnson wrote:

I have a form with a text area.

When the user submits the data it is saved to a mysql database in a field of type text.

When I extract the data from the database and display it in php it loses the line return and the data is all crammed together. Here is an example

This is line 1
This is line 2
This is line 3

Here is what it would be after I extracted it and displayed it to the screen

This is line 1 This is line 2 This is line 3

Displayed to the screen, as in....browser window, or terminal?

What do I need to do to get it to retain the line feeds?

Thanks

Randy


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
--- Randy  Johnson <[EMAIL PROTECTED]> wrote:
> I have a form with a text area.
> 
> When the user submits the data it is saved to a mysql database in a
> field of type text.
> 
> When I extract the data from the database and display it in php it
> loses the line return and the data is all crammed together.

It doesn't lose it. In HTML, a newline isn't rendered as a newline by a
browser unless it is surrounded by pre tags. You probably want to use the
br tag instead. PHP has a function to help with this:

http://www.php.net/nl2br

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

--- End Message ---
--- Begin Message ---
Yep that was it.  

Thank you very much.

Randy
----- Original Message ----- 
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Randy Johnson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, November 30, 2003 1:17 AM
Subject: Re: [PHP] entering in text data and losing the \n


> --- Randy  Johnson <[EMAIL PROTECTED]> wrote:
> > I have a form with a text area.
> > 
> > When the user submits the data it is saved to a mysql database in a
> > field of type text.
> > 
> > When I extract the data from the database and display it in php it
> > loses the line return and the data is all crammed together.
> 
> It doesn't lose it. In HTML, a newline isn't rendered as a newline by a
> browser unless it is surrounded by pre tags. You probably want to use the
> br tag instead. PHP has a function to help with this:
> 
> http://www.php.net/nl2br
> 
> Hope that helps.
> 
> Chris
> 
> =====
> Chris Shiflett - http://shiflett.org/
> 
> PHP Security Handbook
>      Coming mid-2004
> HTTP Developer's Handbook
>      http://httphandbook.org/
> 
> 

--- End Message ---

Reply via email to