php-general Digest 28 Feb 2004 09:47:38 -0000 Issue 2616

Topics (messages 179027 through 179058):

arrays and sessions
        179027 by: Kermit Short
        179030 by: Chris W. Parker
        179032 by: Kermit Short
        179037 by: Chris W. Parker
        179040 by: Justin Patrin

Re: List files in a dir
        179028 by: Justin Patrin
        179041 by: Raditha Dissanayake

Re: read it immediately
        179029 by: Justin Patrin

Math weirdness with doubles...
        179031 by: jon roig
        179033 by: Daniel Clark
        179034 by: D. Wokan
        179035 by: jon roig
        179036 by: Daniel Clark
        179038 by: Marek Kilimajer

PHP application design with WAE UML.
        179039 by: Lukasz Karapuda

Timestamp query...
        179042 by: Ryan A
        179043 by: Michal Migurski
        179044 by: Robert Cummings
        179045 by: Ryan A
        179050 by: Jason Wong

php package
        179046 by: edwardspl.ita.org.mo

to more fields in register
        179047 by: devil_online
        179051 by: Jason Wong
        179052 by: devil_online
        179053 by: Jason Wong
        179054 by: devil_online

Text cleaning?
        179048 by: Karl Timmermann
        179055 by: Five
        179056 by: Karl Timmermann
        179057 by: Jason Wong

What's your favorite PHP weather code?
        179049 by: Karl Timmermann

PHP5 only configures mysql 4.1 source with mysqli
        179058 by: electroteque

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 ---
Uh, sorry, I'm Kermit, not news.php.net


OK gurus, I'm trying to create a page that allows me to create a table in my
MSSQL database.  I'm accepting the field info one by one in a form using a
PHP_SELF action.  This information is supposed to be collected in an array
that's to be stored as a session variable for semi-permanance, until the
array contains all the fields and information for the table.  A second form
will contain an action that sends the sql code for creating the table to the
database server, and viola, I've got myself a new table.  Or not.  If anyone
has any suggestions on how I can get this done I'd appreciate it!  I'd
really rather not post my whole code file, as it's really big and long, and
emphasizes how novice I am at PHP.  Thanks in advance for your help!

-Kermit

--- End Message ---
--- Begin Message ---
Kermit Short <mailto:[EMAIL PROTECTED]>
    on Friday, February 27, 2004 1:47 PM said:

> A second form will contain an action that
> sends the sql code for creating the table to the database server, and
> viola, I've got myself a new table.

i prefer the violin, but viola's are cool too. ;)

> If anyone has any
> suggestions on how I can get this done I'd appreciate it!

wait.. i don't understand. you're asking us for a method to accomplish
what you describe or are you looking for help with a problem you're
having?? if the former, your method *sounds* ok to me. if the latter
please post the error you're getting.

> I'd really
> rather not post my whole code file, as it's really big and long, and
> emphasizes how novice I am at PHP.

good choice.


> Thanks in advance for your help!

no problem.


> -Kermit

is your real name Kermit?




chris.

--- End Message ---
--- Begin Message ---
I've got some code and it simply isn't working.  I thought it might be
because each time the form submits data, the array I'm storing information
in is being re-initialized.  If this is the case, I don't have the
multidimensional array I'm trying to get, but just a vector array with the
most recent submission data.  I tried making the array a session variable,
but I'm not even sure the session part of it is working.  So, if you have
any methods that you think might work better than what I'm trying to do, I'd
love to hear about it.  Basically, my file is structured like this:

1. Pull in POST data, and store them in php variables
2. If the POST data is null, display the first form and get the table name,
field name, field type, primary key, and null allowed information.  On
submit, the information is stored in an array.
3. If the POST data is not null, again display the entry form in case the
user needs to add more fields, and step through the array to display the
existing table info that the user has already entered.  A button in a second
form is also displayed.  When clicked, it actually creates the table.

My problems are that when I try to step through the array and display its
current contents, I get index not defined errors on my for loop indices
(?!).  The second problem is, when I try to use the print_r function to
display my array, it only displays one set of data.  This might be because
I'm trying to do a C++ type 2 dimensional array concept when PHP arrays are
associative by nature, and I'm not sure how to get around this.
Suggestions?

(Yes, Kermit is my real name.  Miss Piggy is well, and sends her regards.)

-Kermit

"Chris W. Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Kermit Short <mailto:[EMAIL PROTECTED]>
    on Friday, February 27, 2004 1:47 PM said:

> A second form will contain an action that
> sends the sql code for creating the table to the database server, and
> viola, I've got myself a new table.

i prefer the violin, but viola's are cool too. ;)

> If anyone has any
> suggestions on how I can get this done I'd appreciate it!

wait.. i don't understand. you're asking us for a method to accomplish
what you describe or are you looking for help with a problem you're
having?? if the former, your method *sounds* ok to me. if the latter
please post the error you're getting.

> I'd really
> rather not post my whole code file, as it's really big and long, and
> emphasizes how novice I am at PHP.

good choice.


> Thanks in advance for your help!

no problem.


> -Kermit

is your real name Kermit?




chris.

--- End Message ---
--- Begin Message ---
Kermit Short <mailto:[EMAIL PROTECTED]>
    on Friday, February 27, 2004 2:10 PM said:

> I've got some code and it simply isn't working.  I thought it might be
> because each time the form submits data, the array I'm storing
> information in is being re-initialized.  If this is the case, I don't
> have the multidimensional array I'm trying to get, but just a vector
> array with the most recent submission data.

here are some thoughts...

sounds like you're just not keeping track of each iteration. i mean,
within the session variable you need to somehow differentiate between
each subsequent form submittal.

<?php

  $iteration = ++$_POST['iteration'];

  $_SESSION['post_data'][$iteration] = $_POST;

  // include $iteration in the post data
  // so that next time it comes around
  // it can be incremented.
  echo <<<QQQ

<form method="post" action="myself">
 ...
 <input type="hidden" name="iteration" value="$iteration" />
 ...
</form>

?>

you should then see a multi-dimensional array with
'print_r($_SESSION);'.

this code is untested and not very complete. ;) but maybe it will give
you some ideas?


hth,
chris.

--- End Message ---
--- Begin Message --- First of all, make sure you're doing session_start() before reading/writing any session data and before you do any output.

Second, You likely need to just do something like this:

session_start();
if(post data) {
  $_SESSION['formArray'][] = $_POST;
}

This will save each POST array as-is in the session.

Chris W. Parker wrote:

Kermit Short <mailto:[EMAIL PROTECTED]>
    on Friday, February 27, 2004 2:10 PM said:


I've got some code and it simply isn't working.  I thought it might be
because each time the form submits data, the array I'm storing
information in is being re-initialized.  If this is the case, I don't
have the multidimensional array I'm trying to get, but just a vector
array with the most recent submission data.


here are some thoughts...

sounds like you're just not keeping track of each iteration. i mean,
within the session variable you need to somehow differentiate between
each subsequent form submittal.

<?php

$iteration = ++$_POST['iteration'];

$_SESSION['post_data'][$iteration] = $_POST;

  // include $iteration in the post data
  // so that next time it comes around
  // it can be incremented.
  echo <<<QQQ

<form method="post" action="myself">
 ...
 <input type="hidden" name="iteration" value="$iteration" />
 ...
</form>

?>

you should then see a multi-dimensional array with
'print_r($_SESSION);'.

this code is untested and not very complete. ;) but maybe it will give
you some ideas?


hth, chris.


--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message --- Shaun wrote:

Hi,

is it possible to have a file that lists all of the files in the current so
that users can download them - this would be useful for a collection of
images I have?

Thanks for your help


Try opendir() and readdir(). http://us4.php.net/opendir

--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message --- Shaun wrote:

Hi,

is it possible to have a file that lists all of the files in the current so
that users can download them - this would be useful for a collection of
images I have?

Thanks for your help



it's only a few lines of code and you will find it here: http://www.raditha.com/php/dir.php


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar.

--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:

kill the writer of this document!

Thanks Rosencrantz....


--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Ok... It's Friday and maybe my brain is dead, but I'm having a weird
problem with some basic math.

Here's a little snippet of the code I'm working with:

---------------------------
echo "<p>Current:$currentAmount:".gettype($currentAmount)." -
Paid:$paidAmount:".gettype($paidAmount)."</p>";

$currentAmount = $currentAmount-$paidAmount;
echo "<p>Final Current: $currentAmount";
-----------------

Straightforward... Yeah?

Here's a sample of the output:
Current:97.6:double - Paid:97.6:double
Final Current: 1.42108547152E-014

Now if both $currentAmount and $paidAmount are doubles, subtracting them
should yield a zero, shouldn't it?

        -- jon

-------------------
jon roig
web developer
email: [EMAIL PROTECTED]
phone: 888.230.7557

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
 

--- End Message ---
--- Begin Message ---
Looks like the Doubles are not exactly zero.  Must be some precision
points not displaying.


> Ok... It's Friday and maybe my brain is dead, but I'm having a weird
> problem with some basic math.
>
> Here's a little snippet of the code I'm working with:
>
> ---------------------------
> echo "<p>Current:$currentAmount:".gettype($currentAmount)." -
> Paid:$paidAmount:".gettype($paidAmount)."</p>";
>
> $currentAmount = $currentAmount-$paidAmount;
> echo "<p>Final Current: $currentAmount";
> -----------------
>
> Straightforward... Yeah?
>
> Here's a sample of the output:
> Current:97.6:double - Paid:97.6:double
> Final Current: 1.42108547152E-014
>
> Now if both $currentAmount and $paidAmount are doubles, subtracting them
> should yield a zero, shouldn't it?
>
>       -- jon
>
> -------------------
> jon roig
> web developer
> email: [EMAIL PROTECTED]
> phone: 888.230.7557
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message --- They are not the same amount. They each got a different rounding error. Double values only display a small number of decimal places (relatively speaking). If you look at the difference you're getting, it's 0.0000000000000142108547152 (I may be off by a zero or two), so given you're working with a currency, I'd say you can safely round to about 4 or 8 decimal places to get a reasonably accurate result. I typically use 4 since most money types I've seen only go out 4 decimal places to begin with.
--
D. Wokan
(Sorry for the double reply, Jon. Didn't realise this list doesn't set the reply-to until it was too late.)


jon roig wrote:

Ok... It's Friday and maybe my brain is dead, but I'm having a weird
problem with some basic math.

Here's a little snippet of the code I'm working with:

---------------------------
echo "<p>Current:$currentAmount:".gettype($currentAmount)." -
Paid:$paidAmount:".gettype($paidAmount)."</p>";

$currentAmount = $currentAmount-$paidAmount;
echo "<p>Final Current: $currentAmount";
-----------------

Straightforward... Yeah?

Here's a sample of the output:
Current:97.6:double - Paid:97.6:double
Final Current: 1.42108547152E-014

Now if both $currentAmount and $paidAmount are doubles, subtracting them
should yield a zero, shouldn't it?

-- jon

-------------------
jon roig
web developer
email: [EMAIL PROTECTED]
phone: 888.230.7557

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004



--- End Message ---
--- Begin Message ---
Thank you so much for the help, folks. That turned out to be weird, but
correct. Rounding off to 4 decimal point places solved the problem quite
nicely.

        -- jon



-----Original Message-----
From: Daniel Clark [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 3:16 PM
To: jon roig
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Math weirdness with doubles...


Looks like the Doubles are not exactly zero.  Must be some precision
points not displaying.


> Ok... It's Friday and maybe my brain is dead, but I'm having a weird 
> problem with some basic math.
>
> Here's a little snippet of the code I'm working with:
>
> ---------------------------
> echo "<p>Current:$currentAmount:".gettype($currentAmount)." - 
> Paid:$paidAmount:".gettype($paidAmount)."</p>";
>
> $currentAmount = $currentAmount-$paidAmount;
> echo "<p>Final Current: $currentAmount";
> -----------------
>
> Straightforward... Yeah?
>
> Here's a sample of the output:
> Current:97.6:double - Paid:97.6:double
> Final Current: 1.42108547152E-014
>
> Now if both $currentAmount and $paidAmount are doubles, subtracting 
> them should yield a zero, shouldn't it?
>
>       -- jon
>
> -------------------
> jon roig
> web developer
> email: [EMAIL PROTECTED]
> phone: 888.230.7557
>
> ---


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
 

--- End Message ---
--- Begin Message ---
Cool.

There must be a way to display out the full doubles precision huh.



> Thank you so much for the help, folks. That turned out to be weird, but
> correct. Rounding off to 4 decimal point places solved the problem quite
> nicely.
>
>       -- jon
>
>
>
> -----Original Message-----
> From: Daniel Clark [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 27, 2004 3:16 PM
> To: jon roig
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Math weirdness with doubles...
>
>
> Looks like the Doubles are not exactly zero.  Must be some precision
> points not displaying.
>
>
>> Ok... It's Friday and maybe my brain is dead, but I'm having a weird
>> problem with some basic math.
>>
>> Here's a little snippet of the code I'm working with:
>>
>> ---------------------------
>> echo "<p>Current:$currentAmount:".gettype($currentAmount)." -
>> Paid:$paidAmount:".gettype($paidAmount)."</p>";
>>
>> $currentAmount = $currentAmount-$paidAmount;
>> echo "<p>Final Current: $currentAmount";
>> -----------------
>>
>> Straightforward... Yeah?
>>
>> Here's a sample of the output:
>> Current:97.6:double - Paid:97.6:double
>> Final Current: 1.42108547152E-014
>>
>> Now if both $currentAmount and $paidAmount are doubles, subtracting
>> them should yield a zero, shouldn't it?
>>
>>      -- jon
>>
>> -------------------
>> jon roig
>> web developer
>> email: [EMAIL PROTECTED]
>> phone: 888.230.7557
>>
>> ---
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message --- jon roig wrote:
Ok... It's Friday and maybe my brain is dead, but I'm having a weird
problem with some basic math.

Here's a little snippet of the code I'm working with:

---------------------------
echo "<p>Current:$currentAmount:".gettype($currentAmount)." -
Paid:$paidAmount:".gettype($paidAmount)."</p>";

$currentAmount = $currentAmount-$paidAmount;
echo "<p>Final Current: $currentAmount";
-----------------

Straightforward... Yeah?

Here's a sample of the output:
Current:97.6:double - Paid:97.6:double
Final Current: 1.42108547152E-014

Now if both $currentAmount and $paidAmount are doubles, subtracting them
should yield a zero, shouldn't it?


No, because they are doubles. If they were integers it would yield a zero. Try to compare the doubles and you find out they are not equal:


if($currentAmount == $paidAmount) echo "equal<br>";
else echo "not equal<br>";

You need to know how are floats and doubles represented. They are in fact something like 97.5999989 or 97.6000001, so you should never compare doubles and floats if they are equal, or you should round them before.
--- End Message ---
--- Begin Message ---
I have recently started to put more emphasis on PHP web application design and
the documenting techniques that are associated with that (UML, flowcharting). I
fairly well acquainted with UML diagraming techniques in general. 

I was not successful in finding a lot of resources on Web that would relate to
proven practices of web application design for PHP. I considered the use of the
"Web Application Extension for UML" standard. It seems however that in order to
sucessfully utilize that standard, there is a need to adopt a certain framework
for application development and assume the use of it for the design process.

I would appreciate any input on proven design/diagramming techniques for PHP web
application design.

-- 
Lukasz Karapuda









----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--- End Message ---
--- Begin Message ---
Hi,
I have a couple of records in the DB with timestamp(14) values.

The field is join_date_time and the values are something like:
20040222000015
20040223015329

Everything is working fine and dandy except now that the client wants a
search functionality
in his "control panel" where he can enter the day, month, year and see all
the people who
have joined on that particular date...

I have created 3 text boxes in the html form named mm,dd,yyyy....but how do
i search on that?

I have been looking at both the PHP and MySql manual for this and
google..the closest solution
I could find was to select all the records from the database then convert
them to a unix timestamp
with mktime and then compare them....which is a long process and pretty
resource wasteful (IMHO)
as there will most probably be hundreds if not thousands of records...

Any suggestions?

Thanks,
-Ryan

--- End Message ---
--- Begin Message ---
>The field is join_date_time and the values are something like:
>20040222000015
>20040223015329
>
>Everything is working fine and dandy except now that the client wants a
>search functionality in his "control panel" where he can enter the day,
>month, year and see all the people who have joined on that particular
>date...
>
>I have created 3 text boxes in the html form named mm,dd,yyyy....but how
>do i search on that?

All you need is substr() and the mysql keyword 'like', and you should be
all set. Why didn't you make join_date_time a datetime in the first place?

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

--- End Message ---
--- Begin Message ---
On Fri, 2004-02-27 at 22:43, Michal Migurski wrote:
> >The field is join_date_time and the values are something like:
> >20040222000015
> >20040223015329
> >
> >Everything is working fine and dandy except now that the client wants a
> >search functionality in his "control panel" where he can enter the day,
> >month, year and see all the people who have joined on that particular
> >date...
> >
> >I have created 3 text boxes in the html form named mm,dd,yyyy....but how
> >do i search on that?
> 
> All you need is substr() and the mysql keyword 'like', and you should be
> all set. Why didn't you make join_date_time a datetime in the first place?

There's several MySQL functions for retrieving aspects of the date. Look
into YEAR(), MONTH(), and DAYOFMONTH().

For more information:

http://www.mysql.com/documentation/mysql/bychapter/manual_Functions.html#Date_and_time_functions

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 ---
On 2/28/2004 4:43:48 AM, Michal Migurski ([EMAIL PROTECTED]) wrote:
> >The field is join_date_time and the values are something like:
> >20040222000015
> >20040223015329
> >
> >Everything is working fine and dandy except now that the client wants a
> >search functionality in his "control panel" where he can enter the day,
> >month, year and see all the people who have joined on that particular
> >date...
> >
> >I have created 3 text boxes in the html form named mm,dd,yyyy....but how
> >do i search on that?

> All you need is substr() and the mysql keyword 'like', and you should be
> all set. Why didn't you make join_date_time a datetime in the first place?

Hey,
Thanks for replying.

We needed a timestamp there because of other calcalations from other scripts
that access the
same table. Regarding your solution, can you give me a quick example please?
its 5am and i'm
pretty braindead....

I am familier with the LIKE command with the % operator as I use it often to
search for words,
but am just a bit puzzled with what you wrote...

Thanks,
-Ryan

--- End Message ---
--- Begin Message ---
On Saturday 28 February 2004 12:08, Ryan A wrote:

> We needed a timestamp there because of other calcalations from other
> scripts that access the
> same table. Regarding your solution, can you give me a quick example
> please? its 5am and i'm
> pretty braindead....
>
> I am familier with the LIKE command with the % operator as I use it often
> to search for words,
> but am just a bit puzzled with what you wrote...

   ... LIKE '20040222%' ...

-- 
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
------------------------------------------
/*
If they can make penicillin out of moldy bread, they can sure make
something out of you.
                -- Muhammad Ali
*/

--- End Message ---
--- Begin Message ---
Dear All,

Is there ( www.php.net )  RPM / SRPMS packages can be downloaded ?

Thank a lots.

Edward.

--- End Message ---
--- Begin Message ---
Hi I have a register form that have 2 fields user and pass. Now I would like
to put two more fields city and email. How can I do it? thanks

--- End Message ---
--- Begin Message ---
On Saturday 28 February 2004 12:32, devil_online wrote:
> Hi I have a register form that have 2 fields user and pass. Now I would
> like to put two more fields city and email. How can I do it? thanks

The same way that you did the first two?

-- 
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
------------------------------------------
/*
It may be bad manners to talk with your mouth full, but it isn't too
good either if you speak when your head is empty.
*/

--- End Message ---
--- Begin Message ---
ok, how do we do an field?
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 28 February 2004 12:32, devil_online wrote:
> > Hi I have a register form that have 2 fields user and pass. Now I would
> > like to put two more fields city and email. How can I do it? thanks
>
> The same way that you did the first two?
>
> -- 
> 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
> ------------------------------------------
> /*
> It may be bad manners to talk with your mouth full, but it isn't too
> good either if you speak when your head is empty.
> */

--- End Message ---
--- Begin Message ---
On Saturday 28 February 2004 14:12, devil_online wrote:
> ok, how do we do an field?

Assuming you're not a troll, and assuming that you're a complete beginner, and 
assuming that the above is "how do I add a field to an existing table in a 
database?" then I strongly suggest that you search for some basic tutorials, 
work on them and understand them before proceeding.

-- 
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
------------------------------------------
/*
If truth is beauty, how come no one has their hair done in the library?
                -- Lily Tomlin
*/

--- End Message ---
--- Begin Message ---
ok...good awser
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 28 February 2004 14:12, devil_online wrote:
> > ok, how do we do an field?
>
> Assuming you're not a troll, and assuming that you're a complete beginner,
and
> assuming that the above is "how do I add a field to an existing table in a
> database?" then I strongly suggest that you search for some basic
tutorials,
> work on them and understand them before proceeding.
>
> -- 
> 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
> ------------------------------------------
> /*
> If truth is beauty, how come no one has their hair done in the library?
> -- Lily Tomlin
> */

--- End Message ---
--- Begin Message --- Does anyone have some PHP code to remove incorrect carriage returns?

Example:

Sentence should be "Hi, my name is Karl and I like PHP."
but is: "Hi, my name is Karl and I like
PHP."

or
"Hi my name is Karl and
I like PHP."

I think I saw some code before that does it, but can't find it anywhere.

Thanks!
Karl

--- End Message ---
--- Begin Message ---
You mean something like this?

$message = ereg_replace( "\n", " ", $message);

It seems to replace all new line instances with a blank space.



"Karl Timmermann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Does anyone have some PHP code to remove incorrect carriage returns?
>
> Example:
>
> Sentence should be "Hi, my name is Karl and I like PHP."
> but is: "Hi, my name is Karl and I like
> PHP."
>
> or
> "Hi my name is Karl and
> I like PHP."
>
> I think I saw some code before that does it, but can't find it anywhere.
>
> Thanks!
> Karl

--- End Message ---
--- Begin Message --- Opps, I failed to mention there can be more paragraphs with legit new lines, like:

Hello, my name is Karl.
Hello, my name
is Dave.
This is some more example text.

Yes, this is yet some more.




On Feb 27, 2004, at 11:56 PM, Five wrote:


You mean something like this?

$message = ereg_replace( "\n", " ", $message);

It seems to replace all new line instances with a blank space.



"Karl Timmermann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Does anyone have some PHP code to remove incorrect carriage returns?

Example:

Sentence should be "Hi, my name is Karl and I like PHP."
but is: "Hi, my name is Karl and I like
PHP."

or
"Hi my name is Karl and
I like PHP."

I think I saw some code before that does it, but can't find it anywhere.

Thanks!
Karl

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


--- End Message ---
--- Begin Message ---
On Saturday 28 February 2004 16:15, Karl Timmermann wrote:
> Opps, I failed to mention there can be more paragraphs with legit new
> lines, like:
>
> Hello, my name is Karl.
> Hello, my name
> is Dave.
> This is some more example text.
>
> Yes, this is yet some more.

So what is your criteria for "incorrect carriage returns" ?

-- 
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
------------------------------------------
/*
The PILLSBURY DOUGHBOY is CRYING for an END to BURT REYNOLDS movies!!
*/

--- End Message ---
--- Begin Message --- I'm looking for some code to get the latest weather and put it on my webpage, and have it very customizable. What are your favorites?

Thanks
Karl

--- End Message ---
--- Begin Message ---
Hi i dont know who to tell, please forward it on, I'm running Solaris 9,
PHP5 only seems to configure mysql 4.1 using the mysqli, i tried the binary
distribution and it complained about the wrong library version so i compiled
the source and it was fine. Just letting people know, i also had to do
a --disable-mysql so the full configure was

./configure --with-apxs2=/usr/local/httpd/bin/apxs --without-mysql --with-my
sqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir=/usr/local/libxml/s
parcv9 --with-zlib-dir=/opt/csw

--- End Message ---

Reply via email to