OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: php3 Digest 26 Feb 2000 18:00:01 -0000 Issue 1503
From: php3-digest-helplists.php.net
Date: Sat Feb 26 2000 - 12:00:01 CST


php3 Digest 26 Feb 2000 18:00:01 -0000 Issue 1503

Topics (messages 78465 through 78505):

timestamps
        78465 by: Zak Greant <zaknucleus.com>
        78471 by: KevinWaterson <hatemailoceania.net>

[PHP] Creating a link list in PHP
        78466 by: "Niranjan Kulkarni" <niranjancnpl.co.in>
        78479 by: Ulf Wendel <ulfredsys.de>
        78483 by: eschmid <eschmid+sics.netic.de>

imap_delete problem
        78467 by: Chuck Hagenbuch <chagenbuwso.williams.edu>

mail function doesn't work
        78468 by: "Yannis Tsakiris" <yannispathfinder.gr>
        78469 by: "Leon Mergen" <leonsolatis.com>
        78498 by: Richard Lynch <rlynchignitionstate.com>

replace text in file
        78470 by: Kim Shrier <kimtinker.com>

php 3.0.14 and apache-mod_ssl
        78472 by: <moebiusip-solutions.net>

Trying to save time....
        78473 by: CDitty <mailredhotsweeps.com>
        78501 by: "Mark Maggelet" <maggeletmminternet.com>
        78502 by: "Chris Gray" <graychrishome.com>
        78505 by: CDitty <mailredhotsweeps.com>

Amazon Patents another internet idea
        78474 by: CDitty <mailredhotsweeps.com>

RH6.1 php query
        78475 by: "Andrew Harrowing" <andyvirtualpresence.co.uk>
        78487 by: "Henry F. Marquardt" <hankyerpso.net>
        78495 by: <moebiusip-solutions.net>

Sort an array of arrays on an array item?
        78476 by: "Lucas Baltes" <lucasthink-ahead.nl>
        78486 by: "Henry F. Marquardt" <hankyerpso.net>

fopen & ereg_replace + valid File-Handle
        78477 by: "Dread" <Dreadgmx.net>

postgresql
        78478 by: Peter Mount <petermountit.maidstone.gov.uk>

[Re: [PHP3] strange problem in imap_fetchstructure...]
        78480 by: niranjan venkatachary <ninja_vusa.net>

Neverending PHP-processes under NT
        78481 by: David So <david.sotwc-asia.com>

mhash compiling problem
        78482 by: Simon Ng <simonngsitna.com>

problem in imap_mail_move()
        78484 by: niranjan venkatachary <ninja_vusa.net>

Auto go back and reload!!
        78485 by: Mark Lo <marklokynetvigator.com>

Cursors in Oracle
        78488 by: "Florian Clever" <cleveraracnet.com>

Output speed
        78489 by: "Kevin Beckford" <kbeckforddgdgroup.com>
        78503 by: "Mark Maggelet" <maggeletmminternet.com>

printing certain variables
        78490 by: Martin Hicks <mortachilles.net>

retrieve known record #?
        78491 by: Paul DuBois <paulsnake.net>
        78497 by: Richard Lynch <rlynchignitionstate.com>

[[PHP3] printing certain variables]
        78492 by: niranjan venkatachary <ninja_vusa.net>

Photo Album
        78493 by: Tin Le <tinnetimages.com>

News server interface to this list is down?
        78494 by: Tin Le <tinnetimages.com>

replace text in file - SOLUTION!
        78496 by: Lawrence Blades <lrbladesclarksdale.com>

Database question
        78499 by: Alexandre Maneu i Victòria <nexus.mansoftctv.es>

R: [PHP3] Help for a small script
        78500 by: "Avenuesaint di M.L." <avenuesaintavenuesaint.com>

PERL -> PHP question
        78504 by: David Pollack <davidda3.net>

Administrivia:

To subscribe to the digest, e-mail:
        php3-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php3-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php3lists.php.net

----------------------------------------------------------------------

attached mail follows:


At 03:58 AM 2/26/00 +1100, you wrote:
>I have a result of a query which returns a value in seconds
>I print this to a web page like this..
>echo "<td>";
>echo $row["AcctSessionTime"];
>echo "</td>";
>
>AcctSessionTime is in seconds but I need it to read in hours and mins.
>How can this be done in php?

About the same way that it would be done in any programming language! ;~]

1 hour = 60 minutes = 3600 seconds...
so, convert your seconds to minutes
figure out how many units of 60 minutes (hours) go evenly into the number
of minutes you have
if you have a remainder, then that is the number of minutes

i.e.
If you have 37200 seconds
Then that converts to 620 minutes
620 / 60 = 10 20/60
So you have 10 hours and 20 minutes

A snippet of code that would do this is:

# Convert seconds to minutes
$total_minutes = $row["AcctSessionTime"] / 60;

# Use the round function to convert the number of minutes to an integer
$total_minutes = ROUND( $minutes );

# Divide the number of minutes by 60
$hours = $total_minutes / 60;

# Use the FLOOR function to discard the fractional remainder
$hours = FLOOR( $hours );

# Use the modulus operator to return the number of minutes
# Modulus acts like the division operator, except
# it returns only the remainder (fractional amount) from the division
operation
$minutes = $total_minutes % 60;

# Use printf to print the number of hours and minutes
PRINTF( '%2s:%02d', $hours, $minutes );

Hope this helps! :)

Zak

attached mail follows:


Zak Greant wrote:

> $total_minutes = $row["AcctSessionTime"] / 60;
>
> # Use the round function to convert the number of minutes to an integer
> $total_minutes = ROUND( $minutes );
>
> # Divide the number of minutes by 60
> $hours = $total_minutes / 60;
>
> # Use the FLOOR function to discard the fractional remainder
> $hours = FLOOR( $hours );
>
> # Use the modulus operator to return the number of minutes
> # Modulus acts like the division operator, except
> # it returns only the remainder (fractional amount) from the division
> operation
> $minutes = $total_minutes % 60;
>
> # Use printf to print the number of hours and minutes
> PRINTF( '%2s:%02d', $hours, $minutes );
>

This helps alot in my understanding, however the above code returns and error at

$minutes = $total_minutes % 60;

Kind regards

Kevin

attached mail follows:


hello,
 
                I am having the problem in PHP. I want to create a tree
structure and also I got the suggestion that implements the tree
structure using the array. But the arrays are not dynamic and I want to
have the structure such that which will grow as and when required. So it
is clear that I have to use the link list structure. But I dont know the
way of creating  the same. If you have some ideas regarding this Pl. Let
me know.  
 

Niranjan Kulkarni,
Cybertech Networks Pvt. Ltd.
Nasik.

 


attached mail follows:


Niranjan Kulkarni wrote:
>
> hello,
>
> I am having the problem in PHP. I want to create a tree
> structure and also I got the suggestion that implements the tree
> structure using the array. But the arrays are not dynamic and I want to
> have the structure such that which will grow as and when required. So it

Nasik,

this is an german language mailinglist. Many of our members qhave
choosed this list over the english one because of their difficulties
with the english language.

You're wrong if you think arrays are not dynamic. PHP arrays can grow
dynamically, but they won't shrink on their own. Neighter do you have to
mention the number of elements an array must provide before you start
programming, nor do you have to care on index numbers.

<?php

$data = array(); # this line is optional and only for the
sake of good style
while (count($data)<100)
 $data[] = rand(1); # php automatically computes the indicies
0..99

?>

As soon as the array has gone partly obsolete you can unset single
elements:

<?php

$i = 0;
while (count($data)>10) {
 $i++;
 unset($data[$i]);
}

echo "Number of remaining elements : ", count($data), "<br>\n";

?>

Unsetting the elements will free memory for the php interpreter, telling
him that this memory can be reused withing this programm invokation. The
memory is not released so that the system can reuse it. That's the
reason why it's uncommon to care about the memory consumption of an
array and unset parts of it.

Ulf

attached mail follows:


On Sat, 26 Feb 2000, Ulf Wendel wrote:

> Niranjan Kulkarni wrote:
> > I am having the problem in PHP. I want to create a tree
> > structure and also I got the suggestion that implements the tree
> > structure using the array. But the arrays are not dynamic and I want to
> > have the structure such that which will grow as and when required. So it

> this is an german language mailinglist. Many of our members qhave
> choosed this list over the english one because of their difficulties
> with the english language.

Hi Ulf, this is the english mailing list.

-Egon

--
   Besuchen Sie Six auf der CeBIT (24.2.-1.3.) in Halle 10, Stand 425,
     und auf der Hannover-Messe (20.-25.3.) in Halle 14, Stand J50!

attached mail follows:


Quoting listsikrsna.com <listsikrsna.com>:

> When trying to use the imap_delete function under this new compilation I get the error: > > Warning: Wrong parameter count for imap_delete() in /var/www/mail/view.php3 on line 67

A change introduced just before 3.0.15 made the 3rd "flags" parameter required, not optional. I've fixed it in CVS for php3 and 4 now.

-chuck

--
Charles Hagenbuch, <chagenbuwso.williams.edu>
--
"Every new beginning comes from some other beginning's end." - Semisonic

attached mail follows:


Hello, I'm working on a form that will automaticaly send mail with the data given by the user. I use the mail function to send the mail but the mail is never be sent. The machine is capable of sending mail (at least I can send mail using the bsd mailer or directly sendmail). I check the value that is returned by mail() and it is true. I have checked several addresses but it didn't worked to any of them. Please help me...

--Yannis T.

attached mail follows:


What's the exact command you've executed ?

Carpe Diem,

Leon Mergen http://www.solatis.com/ (leonsolatis.com) http://www.coolguest.com/ (leoncoolguest.com) ----- Original Message ----- From: Yannis Tsakiris <yannispathfinder.gr> To: <php3lists.php.net> Sent: Saturday, February 26, 2000 8:17 AM Subject: [PHP3] mail function doesn't work

> Hello, > I'm working on a form that will automaticaly send mail with > the data given by the user. I use the mail function to send > the mail but the mail is never be sent. > The machine is capable of sending mail (at least I can send > mail using the bsd mailer or directly sendmail). > I check the value that is returned by mail() and it is true. > I have checked several addresses but it didn't worked to any > of them. > Please help me... > > --Yannis T. > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


At 09:17 AM 2/26/00 +0200, you wrote: >Hello, >I'm working on a form that will automaticaly send mail with >the data given by the user. I use the mail function to send >the mail but the mail is never be sent. >The machine is capable of sending mail (at least I can send >mail using the bsd mailer or directly sendmail). >I check the value that is returned by mail() and it is true. >I have checked several addresses but it didn't worked to any >of them. >Please help me...

What's your php.ini setting for sendmail?

Can you determine from the sendmail logs if the mail ever got to sendmail?

-- 
"TANSTAAFL"
We're looking for PHP/ASP hacker: http://ignitionstate.com/jobs/index.html
Need Work? Printer Driver: http://L-I-E.com/jobs.htm#PrinterDriver
I will be offline from March 8th through April 2nd.
http://CHaTMusic.com                       http://EmphasisEntertainment.com
http://L-I-E.com                           http://JadeMaze.com
http://CatCatalani.com                     http://MGMH.com
http://VoodooKings.net                     http://UncommonGround.com

attached mail follows:


Lawrence Blades wrote: > > Now THIS works in the vi editor. > Any way to make a php script do it? >

Have you tried ereg_replace?

$modified_line = ereg_replace ("\r", "", $line);

Kim

-- 
 Kim Shrier - principal, Shrier and Deihl - mailto:kimtinker.com
Remote Unix Network Admin, Security, Internet Software Development
  Tinker Internet Services - Superior FreeBSD-based Web Hosting
                     http://www.tinker.com/

attached mail follows:


Hello All, I have successfully installed apache, mod_ssl, php3.0.14. I can start apache immediately but as soon as I uncomment the add/load module statements apache craps out. I enable logging and it seems as though apache can't find the lib/apache/libphp3.so. I checked and it's there with the same permissions as all the other modules. Any help would be greatly appreciated. Thanks,

Harry Hoffman Product Systems Specialist Restaurants Unlimited Inc. 206.634.3082 x. 270

attached mail follows:


I have a form that has 80 (yes 80) check boxes. On the next page, I am trying to save a little time and space by looping instead of typing 80 lines of code. Anyhow, it must be the late hour as I cannot seem to get this correct. Below is my code, does anyone have any suggestions?

I have my forms named on the previous page as pick1, pick2, pick3.........

$i = 1; $pick = 1; while ($i <= 80){ $choice = $pick . $i; if (IsSet($choice)){ $br = "<br>"; $choice = $choice . $br; } print "$choice"; $i++; $pick++; }

TIA

CDitty

attached mail follows:


call them pick[1],pick[2],etc... and loop through like this:

while (list($key, $val) = each($pick)) { echo "key => val"; }

don't forget to reset $pick if you use it again.

- Mark

***********************************************

On 2/26/00 at 2:02 AM CDitty wrote:

>I have a form that has 80 (yes 80) check boxes. On the next page, I am >trying to save a little time and space by looping instead of typing 80 >lines of code. Anyhow, it must be the late hour as I cannot seem to get >this correct. Below is my code, does anyone have any suggestions? > >I have my forms named on the previous page as pick1, pick2, pick3......... > >$i = 1; >$pick = 1; >while ($i <= 80){ >$choice = $pick . $i; > if (IsSet($choice)){ > $br = "<br>"; > $choice = $choice . $br; > } > print "$choice"; > $i++; > $pick++; >} > >TIA > >CDitty > > >-- >PHP 3 Mailing List <http://www.php.net/> >To unsubscribe, send an empty message to php3-unsubscribelists.php.net >To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net >To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 >To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Instead of > $choice = $pick . $i;

try... $choyce = "pick" . $i; $choice = $$choyce;

Chris

----- Original Message ----- From: "CDitty" <mailredhotsweeps.com> To: <php3lists.php.net> Sent: Saturday, February 26, 2000 3:02 AM Subject: [PHP3] Trying to save time....

> I have a form that has 80 (yes 80) check boxes. On the next page, I am > trying to save a little time and space by looping instead of typing 80 > lines of code. Anyhow, it must be the late hour as I cannot seem to get > this correct. Below is my code, does anyone have any suggestions? > > I have my forms named on the previous page as pick1, pick2, pick3......... > > $i = 1; > $pick = 1; > while ($i <= 80){ > $choice = $pick . $i; > if (IsSet($choice)){ > $br = "<br>"; > $choice = $choice . $br; > } > print "$choice"; > $i++; > $pick++; > } > > TIA > > CDitty >

attached mail follows:


Thanks. That got it.

CDitty

At 11:27 AM 2/26/00, Chris Gray wrote: >Instead of > > $choice = $pick . $i; > >try... >$choyce = "pick" . $i; >$choice = $$choyce; > >Chris > >----- Original Message ----- >From: "CDitty" <mailredhotsweeps.com> >To: <php3lists.php.net> >Sent: Saturday, February 26, 2000 3:02 AM >Subject: [PHP3] Trying to save time.... > > > > I have a form that has 80 (yes 80) check boxes. On the next page, I am > > trying to save a little time and space by looping instead of typing 80 > > lines of code. Anyhow, it must be the late hour as I cannot seem to get > > this correct. Below is my code, does anyone have any suggestions? > > > > I have my forms named on the previous page as pick1, pick2, pick3......... > > > > $i = 1; > > $pick = 1; > > while ($i <= 80){ > > $choice = $pick . $i; > > if (IsSet($choice)){ > > $br = "<br>"; > > $choice = $choice . $br; > > } > > print "$choice"; > > $i++; > > $pick++; > > } > > > > TIA > > > > CDitty > > > > > > > >-- >PHP 3 Mailing List <http://www.php.net/> >To unsubscribe, send an empty message to php3-unsubscribelists.php.net >To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net >To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 >To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Got this from the Evolt list. Thought everyone might like to read this. It has the ability to affect everyone that uses an affiliate program on their site.

Amazon patents affiliate programs technology http://news.cnet.com/news/0-1007-200-1558650.html?tag=st.ne.1002.thed.1007-2

CDitty

attached mail follows:


Has anyone managed to get php working on a RH6.1 box using only the software supplied on the RH6.1 cd?

Excuse my ignorance, newbie & all that! ;¬)

attached mail follows:


Bear with me on a little story ... I tried for something like a day and a half to get Hylafax running on RedHat6.0 ... after all the RPM was on the CD, the SRPM was on the CD ... heck; installed it, didn't work ... compiled the source, lot's of warnings, but it compiled ... installed it, didn't work. Checked the Red Hat site, no errata, checked the Hylafax site, nothing ... finally I subscribed to and sent a message to the Hylafax mailing list - and got a good answer "Ohh, the version just doesn't work with the new RedHat, you need 4.1beta3 ... get the tarball at this obscure url that you won't easily find otherwise and you should be good to go" .... and you know what, it worked!

From that day I have not installed anything from a distro CD, If I want something I go get the current version (almost gauranteed to be a couple versions higher than what's on the CD anyway) and then configure it and install it myself.

Anyway, that story has nothing to do with php, but when in doubt go get the current source 3.0.15 as of yesterday, untar it, './configure' it, 'make' it and 'make install' it. It's not that hard - though I grant you more involved than 'rpm -ivh php3-3.0.12.rpm'

Hank

-----Original Message----- From: Andrew Harrowing [mailto:andyvirtualpresence.co.uk] Sent: Saturday, February 26, 2000 2:59 AM To: php3lists.php.net Subject: [PHP3] RH6.1 php query

Has anyone managed to get php working on a RH6.1 box using only the software supplied on the RH6.1 cd?

Excuse my ignorance, newbie & all that! ;¬)

--
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribelists.php.net
To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net
To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Hey Andrew, I had php(3.0.12) working out of the box (or off of the CD).

Harry Hoffman Product Systems Specialist Restaurants Unlimited Inc. 206.634.3082 x. 270

On Sat, 26 Feb 2000, Andrew Harrowing wrote:

> Has anyone managed to get php working on a RH6.1 box using > only the software supplied on the RH6.1 cd? > > Excuse my ignorance, newbie & all that! ;¬) > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net >

attached mail follows:


Hello,

Does anyone know how to sort an array of arrays on an array item?

Imagine the following:

$testarray = array( array("john","johnson"), array("jane","doe") );

What I want to be able to do is sort $testarray on lastname so its order would be:

"jane","doe" "john","johnson"

Any help is greatly appreciated!

Lucas

$sig = >>>EOD;

Lucas Baltes url : www.think-ahead.nl Think Ahead® BV phone : +31-(0)78-6399837 Wijnstraat 136 fax : +31-(0)78-6399836 3311 BZ Dordrecht mobile : +31-(0)6-29517107

EOD; print $sig;

attached mail follows:


Well you can do two things, you can write your own sort routine (doesn't everyone have to learn to write a bubble sort anyway?:)) or you could structure your array a little different and learn to use 'string indexing'/hashes/'associative arrays' <- I've a little perl on the brain this morning ...

$myarr["johnson"]="john"; $myarr["doe"]="jane";

Now you can use the built in functions of php like asort() or arsort() and it will do what you want. Hint, it would be good to learn the syntax and use of each() at this tine too:)

Hank

-----Original Message----- From: Lucas Baltes [mailto:lucasthink-ahead.nl] Sent: Saturday, February 26, 2000 3:17 AM To: php3lists.php.net Subject: [PHP3] Sort an array of arrays on an array item?

Hello,

Does anyone know how to sort an array of arrays on an array item?

Imagine the following:

$testarray = array( array("john","johnson"), array("jane","doe") );

What I want to be able to do is sort $testarray on lastname so its order would be:

"jane","doe" "john","johnson"

Any help is greatly appreciated!

Lucas

$sig = >>>EOD;

Lucas Baltes url : www.think-ahead.nl Think Ahead® BV phone : +31-(0)78-6399837 Wijnstraat 136 fax : +31-(0)78-6399836 3311 BZ Dordrecht mobile : +31-(0)6-29517107

EOD; print $sig;

--
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribelists.php.net
To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net
To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


<? $fd = fopen("test.txt", "r"); while ($buffer = fgets($fd, 4096)) { list($url, $description, $email) = explode(',', $buffer);

$buffer = fopen("test2.html", "r"); while(!feof($buffer)) { $buffer=fgets($buffer, 255); include ("templates.php3"); print($templine); } fclose ($buffer);

} fclose($fd); ?>

test.txt: url1,description1,email1 url2,description2,email2 ....

templates.php3 <? $buffer = ereg_replace("%url%", $url, $buffer); $buffer = ereg_replace("%description%", $desciption, $buffer); $buffer = ereg_replace("%email%", $email, $buffer);

?>

test2.html [....] <center> Url: %url% </center> [....]

I get a: Warning: Supplied argument is not a valid File-Handle resource in test.php3 on line 7 Warning: Supplied argument is not a valid File-Handle resource in test.php3 on line 9

Can anyone help me ?

attached mail follows:


There is for NT, but not (yet?) for 9x due to the lack of IPC support.

Peter

-- 
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.

-----Original Message----- From: Fernando Caamaño [mailto:fernandoconecta-t.com] Sent: Friday, February 25, 2000 6:07 PM To: php3 Subject: [PHP3] postgresql

hi all are there a version of postgres for win98??? thank you Fernando Caamaño Soporte técnico Conecta97 Travesera de Gracia 342-344 tel: 934465028 fax: 934465029 www.conecta-t.com

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Richard Lynch <rlynchignitionstate.com> wrote: At 03:34 AM 2/25/00 MST, you wrote: > i am getting the value from imap_fetchstructure for content type = text as >null instead of 0 but for other types likes image,audio etc.. i am getting >correctly the corresponding values why is it so ? can any one tell me..

Since the PHP language has no 'null' in it, I'm a little confused as to what you mean...

But I'm willing to bet that you have not realized that:

"0" evaluates to FALSE in a boolean expression in PHP

-- 

Actually by null i mean that when i print the value of the imap_fetchstructure() from content_type=text i dont see any value in the browser whereas for all other types i am able to see the corresponding numbers.(for example for type=audio 4 is printed.)

-Niranjan.

"TANSTAAFL" We're looking for PHP/ASP hacker: http://ignitionstate.com/jobs/index.html Need Work? Printer Driver: http://L-I-E.com/jobs.htm#PrinterDriver I will be offline from March 8th through April 2nd. http://CHaTMusic.com http://EmphasisEntertainment.com http://L-I-E.com http://JadeMaze.com http://CatCatalani.com http://MGMH.com http://VoodooKings.net http://UncommonGround.com

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-adminlists.php.net

____________________________________________________________________ Get free email and a permanent address at http://www.netaddress.com/?N=1

attached mail follows:


Hello,

try to install the NT resource kid from microsoft.com. then you can have the 'tlist' command which is the same as 'ps' u have in an unix box. Kill the IIS and restart again will stop all the non-stop PHP process.

Dave

Steve Edberg wrote:

> At 11:38 AM +0100 2/25/00, Heiko Weber wrote: > > > >Hello, > > > >I have encountered the problem that sometimes I have PHP > >processes under NT that just wont die and consume quite a > >lot of CPU time or memory. The only solution I have found to > >get rid of the PHP processes has been to restart the server, > >which is quite an uncool solution. In the task-manager there's > >no way to kill the processes. Is there any way to give a maximum > >execution time for PHP-processes? I have set max_execution_time > >in the php.ini to 30 seconds, but I've had processes that were > >running for several days until I finally rebooted the server. > > > >Can anyone help? > > > >thanks > > Heiko > > > >PS: I'm using Netscape Enterpreise Server 3.6 and NT 4.0 and > >PHP 3.0.11, but different PHP-versions produced the same results. > > I had this problem some time ago when I tried to use persistent > database connections - which are useless using PHP as a CGI. The NT > Task Mismanager was unable to kill them, and I can confirm that the > zombie processes start sucking up CPU cycles & RAM. Once I removed > the pconnects, the problem didn't return. Actually, I think there was > an early buggy version of PHP-Win that did this too, but that was > probably a 3.0 alpha or beta. > > Try > > (1) changing persistent DB connections to normal, if any; eg, replace > > mysql_pconnect(...) > with > mysql_connect(...) > > ...this should be pretty straightforward in editors that allow > multifile search/replaces. > > (2) there's a couple of tools - can't recall the names, sorry - that > can kill zombies. One I think is on the NT Resource Kit, or search > tucows.com, or rent 'Night of the Living Dead' & 'Dawn of the Dead' > for zombie killing tips ;P > > (3) switch to *nix. > > - steve > > +---------------- Splurk! Glort! Klikrunk! Ploip! Katoong!---------------+ > | Steve Edberg University of California, Davis | > | sbedbergucdavis.edu (530)754-9127 | > | Computer Consultant http://aesric.ucdavis.edu/ | > +------------------ Don Martin 18 May 1931 - 7 Jan 2000 -----------------+ > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net

--
David So
Developer

Tel: (852) 2862 9058 Fax: (852)2529 5488 The Web Connection http://www.twc-asia.com Winning Solutions in the Digital Economy

attached mail follows:


> We try to install mhash with php > We just compiling a RPM file of the php 3.0.15 on RedHat 6.1 with > mhash > upon we finish the compiling and try to install the php3.0.15 rpm it > has a error found > "libmhash.so.1 is need by php-3.0.15" > > I think that the php cannot find the lib > and I add a line "/usr/local/lib on /etc/ld.so.conf > > It still have the same problem. > > It will be great if you can show us the soluation. > > Thank you >

attached mail follows:


Hello,

when i use the follow syntax for imap_mail_move() mail is not moved from one folder to another.

imap_mail_move($streamID,$msgno,"mailboxname");

i think the problem is with passing second parameter i.e messagenumber. In PHP manual it is said that we have to pass msglist instead of msgno . what msglist means ...?

can any one help me.

Thanx in advance, Niranjan.

____________________________________________________________________ Get free email and a permanent address at http://www.netaddress.com/?N=1

attached mail follows:


Hi everyone,

for the function history.go(-1).

if i use it on the body tag -----> <body onload="history.go(-1)">

the above function should tell the browser to go back to the previous page and then reload that returned page again (like hitting the reload button on the browser)....if i right....but I can't get the page to reload after returned from the previous page.

Anyone has any cues!!!

Thank You

Mark Lo

attached mail follows:


>>statement, right? But only using procedural techniques. So the task is to >>have the stored procedure create a subset of a SELECT statment. This can >>only be done using a temporary table, I believe. > >That is a waste of performance and resources. If every time I need to >fetch a subset of the rows of the result of a select query I need to create >a temporary table, the advantage of doing it is gone because it would be >better to fetch the whole result by skipping the first rows you are not >interested in the client side.

I agree this would be a wast of resources. How do you like the following statment: SELECT lname,sysid FROM patients WHERE ROWNUM<100 MINUS SELECT lname,sysid FROM patients WHERE ROWNUM<90

The limitation here is, that you can not use ORDER BY.

Another alternative might be: Open a cursor on the clientside (limiting the upper-bound with ROWNUM). Then call a PL/SQL Function to move to the first record which should be displayed. Then on the clientside fetch all the rest rows. I guess this is not very performant, but it might reduce the network traffic between webserver and oracle db as the data for moving to the first required row is not sent to the webserver.

However all this is not really satisfying to me. Maybe it would be good to ask Oracle Corp about how to handle this.

Florian

attached mail follows:


Ok, here is my idea: I have been kicking around the idea of using php to output a lot of my html when possible. I've tried using the "escape to html" method, and have found it hard to read, and even harder to debug properly.

Debugging is where I spend most of my programming time.

I would like to know which is faster - using the print function, or using echo. In my mind, echo should be a bit faster, because it is a language construct, but I am unsure. Also, I am thinking that since double quotes are scanned for variables while single quotes are not, I am thinking that I want to use double quoted strings only when I have a variable that I want interpolated.

Please post comments - I'm doing this because I would like to develop a habit of writing efficient code - both in execution time and in debugging time (the latter precludes the escape to html method, I believe - if someone taps you on the shoulder to get you to fix the printer while you are debugging - it's all over :-)

attached mail follows:


Once you get used to reading the 'escape to html method' it will be easier. I used a lot of echos when I first moved to php, but I switched over after reading a post from Rasmus advocating doing it this way. It does make debugging a little bit difficult, but I think this is offset by the fact that it makes changing the html that much easier. (also working with a web designer)

When the php compiler comes out, I'm hoping for a construct similar to: #ifndef html and php gets ignored here #endif this will make debugging easier for me. (I always have to wonder if I need to use <!-- --> or /* */

The thing I miss most about Java is that there were coding conventions, and I could read just about anybody's code as if I wrote it. Now I often have a very hard time reading other people's code.

- Mark

***********************************************

On  fS at 9:58 AM Kevin Beckford wrote:

>Ok, here is my idea: > I have been kicking around the idea of using php to output a lot of my html when possible. I've tried using the "escape to html" method, and have found it hard to read, and even harder to debug properly. > >Debugging is where I spend most of my programming time. > > I would like to know which is faster - using the print function, or using echo. In my mind, echo should be a bit faster, because it is a language construct, but I am unsure. Also, I am thinking that since double quotes are scanned for variables while single quotes are not, I am thinking that I want to use double quoted strings only when I have a variable that I want interpolated. > >Please post comments - I'm doing this because I would like to develop a habit of writing efficient code - both in execution time and in debugging time (the latter precludes the escape to html method, I believe - if someone taps you on the shoulder to get you to fix the printer while you are debugging - it's all over :-) > > >-- >PHP 3 Mailing List <http://www.php.net/> >To unsubscribe, send an empty message to php3-unsubscribelists.php.net >To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net >To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 >To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


NOTE: I posted this once, but never saw it...nor did I see the bounce, so here we go:

This is most likely a quicky, but I poked through the docs and didn't find anything (although I had a hard time deciding where I should be looking).

Here's the situation.

$blah = "name"

I need to print out a the contents of a variable called $name

how do I do it?

I tried all kinds of stuff like ${$blah} etc and I can't seem to figure it out

TIA mh

-- 
Martin Hicks ||    mortachilles.net    || Sysadmin for Achilles Internet 
Use PGP/GPG  ||  GPG KeyID: 0xFCF1F503  || 613-688-0707 (voice)

attached mail follows:


At 8:09 PM -0800 2000-02-25, Dave Reinhardt wrote: >whats wrong with this: >$r = record number > >$db = mysql_connect("localhost", "user", "password");

No error checking.

> >mysql_select_db("database", $db);

No error checking.

> >$sql = "SELECT * FROM itemtable where idt = $r"; > >$result = mysql_query($sql);

No error checking.

> >$myrow = mysql_fetch_array($result);

No error checking.

> >$firstItem = $myrow["firstItem"]; >etc. > >Thanks >Dave

In other words, it's hard to know where your script might be failing, because by not checking for errors, you're not doing anything to help yourself.

-- 
Paul DuBois, paulsnake.net

attached mail follows:


At 08:09 PM 2/25/00 -0800, you wrote: > >whats wrong with this: >$r = record number > >$db = mysql_connect("localhost", "user", "password");

or die($php_errormsg);

>mysql_select_db("database", $db);

or die(mysql_error());

>$sql = "SELECT * FROM itemtable where idt = $r"; > >$result = mysql_query($sql);

or die(mysql_error());

>$myrow = mysql_fetch_array($result); > >$firstItem = $myrow["firstItem"];

-- 
"TANSTAAFL"
We're looking for PHP/ASP hacker: http://ignitionstate.com/jobs/index.html
Need Work? Printer Driver: http://L-I-E.com/jobs.htm#PrinterDriver
I will be offline from March 8th through April 2nd.
http://CHaTMusic.com                       http://EmphasisEntertainment.com
http://L-I-E.com                           http://JadeMaze.com
http://CatCatalani.com                     http://MGMH.com
http://VoodooKings.net                     http://UncommonGround.com

attached mail follows:


Martin Hicks <mortachilles.net> wrote:

> $blah = "name"

> I need to print out a the contents of a variable called $name

how do I do it?

I tried all kinds of stuff like ${$blah} etc and I can't seem to figure it out

---

it works perfectly for me . check whether you have terminated all the lines with semicolon ($blah="name";) if your still have problem refer php manual under the heading 'variable variables'.

-Niranjan

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-adminlists.php.net

____________________________________________________________________ Get free email and a permanent address at http://www.netaddress.com/?N=1

attached mail follows:


Hi,

Daevid sent his Photo Album code to me to make available. If you can't find it other places, you can try

ftp://ftp.le.org/php3/photo_album.tgz

Tin Le

----
Net Images - Premier Web Presence Provider   http://www.netimages.com/~tin
Internet Security and Firewall Consulting
Tin Le - tinnetimages.com

On Fri, 25 Feb 2000, [iso-8859-1] Sandeep Hundal wrote:

> Hi David, > > I'm very interested in your photo album for > personal use. > > Is it possible you could send it to me as an > attachement or point me o where yo might have > posted it.... > > Thanks > Sunny > __________________________________________________ > Do You Yahoo!? > Talk to your friends online with Yahoo! Messenger. > http://im.yahoo.com > > -- > --------------------------------------------------------------------- > Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before > posting. To request this thread, e-mail mysql-thread29129lists.mysql.com > > To unsubscribe, send a message to: > <mysql-unsubscribe-tin=netimages.comlists.mysql.com> >

attached mail follows:


The news server is accessible again. Our new office is currently on much slower connection than at our old one, so you may experienced congestion. We have more lines on order, but our ISP(PBI) is very slow, sigh.

Tin Le

----
Net Images - Premier Web Presence Provider   http://www.netimages.com/~tin
Internet Security and Firewall Consulting
Tin Le - tinnetimages.com

On Fri, 25 Feb 2000, Tin Le wrote:

> Sorry, we are moving our office to new location. The news server will be > down until late Saturday or Sunday at least. I had to shutdown all the > unneccessary servers. > > Tin Le > > ---- > Net Images - Premier Web Presence Provider http://www.netimages.com/~tin > Internet Security and Firewall Consulting > Tin Le - tinnetimages.com > > On Fri, 25 Feb 2000, Michael Simcich wrote: > > > Date: Fri, 25 Feb 2000 17:27:06 -0800 > > From: Michael Simcich <msimcichaccesstools.com> > > To: php3lists.php.net > > Subject: [PHP3] News server interface to this list is down? > > > > Is it just me or is the news interface to this list down? > > > > news.netimages.com > > > > doesn't hook up anymore for me (via cable Home). It worked fine until > > sometime on the 23rd. > > > > Michael Simcich > > AccessTools > > > > > > -- > > PHP 3 Mailing List <http://www.php.net/> > > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net >

attached mail follows:


Here is a browser uploaded text as viewed by VI EDITOR: It is a tab delimited text file. The first entry of each line is the word "Prints". The vi editor sees the entire file as ONE LINE - no cr's or nl's. Note the ^M before the word Prints. ------------------ Prints Deal with the Devil--Crossroads--Signed and Numbered 40.00 11 x 17 print ^MPrints Early Wright--WROX Radio--Signed and Num bered 40.00 11 x 17 print ^MPrints Thomas Elbony Si gned and Numbered Prints-Charcol/Pencil Drawing-Muddy Waters 30.00 TE600 large--get size Thomas Eloby ^MPrints Signed ------------------------ Here is the file run thru the script to reveal the ascii code (thanks R.Lynch!):

Prints (9)Deal (32)with (32)the (32)Devil- (45)- (45)Crossroads- (45)- (45)Signed (32)and (32)Numbered (9)4 (52)0 (48). (46)0 (48)0 (48) (9) (9)1 (49)1 (49) (32)x (32)1 (49)7 (55) (32)print (32) (9) (9) (13)Prints (9)Early (32)Wright- (45)- (45)WROX (32)Radio- (45)- (45)Signed (32)and (32)Numbered (9)4 (52)0 (48). (46)0 (48)0 (48) (9) (9)1 (49)1 (49) (32)x (32)1 (49)7 (55) (32)print (9) (9) (13)Prints (9)Thomas (32)Elbony (32)Signed (32)and (32)Numbered (32)Prints- (45)Charcol/ (47)Pencil (32)Drawing- (45)Muddy (32)Waters (9)3 (51)0 (48). (46)0 (48)0 (48) (9)TE6 (54)0 (48)0 (48) (9)large- (45)- (45)get (32)size (9)Thomas (32)Eloby (9) (13)Prints (9)Signed ------------------------------------------- php recognizes the cr (cha(13) before the word "Prints".

This script fixed it, replacing chr(13) with chr(10):

$file = file('/path/to/file'); $text = implode("\n", $file); $text = str_replace("\r", "\n", $text); $fp = fopen('/path/to/file', 'w'); fwrite($fp, $text); fclose($fp);

Thanks to everybody for your help!

--
 Lawrence Blades
 Digital Technologies
 P.O. Box 673
 Clarksdale, MS 38614

Church Office: 601.624.6586 COL Office: 601.627.5554 FAX: 601.627.6797 Home: 601-627-9539 Cell: 601.621.3092 http://www.clarksdale.com lrbladesclarksdale.com (If you can't find me, I can't be found.)

attached mail follows:


Hi.

First of all I want to say that I'm new to the list, so hello to everybody, and excuse me if I ask sth that has been answered before.

My server does not support SQL, but I want to implement a database in my web site. I intended to use dbase, but iitn the manual it says that is not recommended. Which is the best format I could use? dba perhaps?

Thank you very much. _________________________________ Àlex Maneu - mansoftctv.es ICQ: 12433233 Phones: +34932967792, +34619541839 PGP Public Key Available at http://www.amaneu.informaticos.org http://plataforma.hypermart.net http://www.mansoft.informaticos.org TARIFA PLANA YA! 3ª ala de combate de las fuerzas reVeldes contra el IMPERIO TIMOFONICO _________________________________

attached mail follows:


Hi, first of all, many thanks to Hank for all his suggestions....

Well, I've rewritten the script as you suggested and it works fine.... except for the purpose to count how many times the eregi function finds records.... Arghh... Using the third argument on my eregi function, I think, the script counts the number of rows that it has checked less one (?)... E.g. : in my database there are 11 records and if the query finds 7 records (and prints out 7 records correctly ), the $hits value says 10; if my query finds 2 records (and prints out 2 records correctly), the $hits value says always 10....

My main goal when I try to count the number of matches founded is to split the number of records for more pages.....

Here folllows the script as I've rewritten it:

<?php if(!$arrtext=file("form.txt")) { echo("Oops, can't get the file"); } else { $b=count($arrtext); $pipeval="\|"; for($i=0;$i<$b;$i++)

$riga=$arrtext[$i]; $pulite=split($pipeval,$riga); if(eregi($ricerca,$pulite[2],$hits)) { print "$pulite[0], $pulite[1]<br>"; } } echo(count($hits));} ?>

Umhhh, my confusion is growing....

Thanks in advance for any comments or suggestions..... Max

attached mail follows:


I have the following script and I was wondering if it could be converted to PHP using FastTemplates or if I would have to use something else

http://johannes.1webblvd.com/~da3/weblibs/

index.txt is the actual script. What it does is replace certain HTML comments with user inputted variables. It is a web version of the book game Mad Libs. If you want to see a working copy go to

http://www.da3.net/weblibs