php-general Digest 31 May 2003 12:37:10 -0000 Issue 2089

Topics (messages 149622 through 149646):

performance issue under IIS
        149622 by: matt rowe

Re: Adding graphics library
        149623 by: Martin Helie
        149631 by: Todd Cary

Re: Code Help Please
        149624 by: Jennifer Goodie

Long screen display cut short.
        149625 by: Floyd Baker
        149626 by: Martin Helie
        149643 by: Thomas Seifert
        149646 by: Ernest E Vogelsinger

Re: What's wrong with this code??
        149627 by: Brian V Bonini
        149639 by: Beauford

Re: Best Practices in Directory Layout?
        149628 by: Jaap van Ganswijk

I guess I'll give the list a shot
        149629 by: David McGlone
        149641 by: David Otton

Function result is an array
        149630 by: Dustin Mitchell
        149632 by: Evan Nemerson
        149638 by: Ernest E Vogelsinger

Using Cookies Securely
        149633 by: Monty
        149634 by: Justin French
        149635 by: Evan Nemerson

Re: ldap_add() troubles
        149636 by: David Robley
        149637 by: Cecile

Getting the parsing time of a script
        149640 by: Bix
        149642 by: David Otton
        149645 by: Ernest E Vogelsinger

Any POSTNUKER, reading from two DB
        149644 by: nabil

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 --- Dear list,

Hi there. I have a bit of a performance problem under IIS, and I can't seem to figure it out.

I have two similar servers. Both are running php v4.3.1 (as a cgi) with IIS on Win2k. Both have nearly identical php.ini files, and IIS configurations (as far as I can tell).

However, the "slow" server only serves one php document at a time. For example, I wrote a test script that counts from 0 to 10, sleeping for a second in between each count. If I hit that page with a browser, IIS waits until the counting is finished before serving up any subsequent pages (triggered from another browser window).

The "fast" server doesn't behave like this. When I trigger the counter script, I can go to many other php pages while the counter is running.

The strange thing is that the task manager shows many instances of php.exe (one for each php page that is hit). So, it looks like multiple instances of the php executable are being called. But, for some reason, IIS is waiting (linearly) to serve the php pages.

I'm fairly sure I'm missing some obscure check box in the IIS configuration. Can anyone please point me in the right direction?

Thanks,
Matt


--- End Message ---
--- Begin Message ---
Well, not necessarily, since gd is included with php 4.3.x. You'll probably
still want to get libjpeg and libpng, and link against them with the proper
configure options.



<Ef> <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --with-gd and of oucrce you need the GD library.
>
> "Todd Cary" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
> > I am new to Linux so I need some help for installing the graphics
> > library.  This is what I did to get PHP to inlcude Interbase.
> >
> >    !! Configure PHP with Interbase with apxs
> >    34  ./configure --with-apxs=/usr/sbin --with-interbase=/opt/interbase
> >    35  ./configure --with-interbase=/opt/interbase --with-apxs=/usr/sbin
> >    36  ./configure --with-interbase=/opt/interbase
> > --with-apxs=/usr/sbin/apxs
> >
> > What do I need to add to this to include the graphics library?
> >
> > Many thanks...
> >
> > Todd
> >
> >
>
>



--- End Message ---
--- Begin Message --- <<<
You'll probably
still want to get libjpeg and libpng, and link against them with the proper
configure options.

>>>
What is the correct syntax to do all of the suggestions?

Todd


Martin Helie wrote:
Well, not necessarily, since gd is included with php 4.3.x. You'll probably
still want to get libjpeg and libpng, and link against them with the proper
configure options.



<Ef> <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
  
--with-gd and of oucrce you need the GD library.

"Todd Cary" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]...
    
I am new to Linux so I need some help for installing the graphics
library.  This is what I did to get PHP to inlcude Interbase.

   !! Configure PHP with Interbase with apxs
   34  ./configure --with-apxs=/usr/sbin --with-interbase=/opt/interbase
   35  ./configure --with-interbase=/opt/interbase --with-apxs=/usr/sbin
   36  ./configure --with-interbase=/opt/interbase
--with-apxs=/usr/sbin/apxs

What do I need to add to this to include the graphics library?

Many thanks...

Todd


      
    



  

--


--- End Message ---
--- Begin Message ---
> I need to find if table1.username = table2.domain/table2.username  is

If you are using mySQL you can use CONCAT

table1.username = CONCAT(table2.domain,'/',table2.username)

http://www.mysql.com/doc/en/String_functions.html#IDX1174 
 

--- End Message ---
--- Begin Message ---
Hello...

I have a routine that works fine on local win98 but when it runs on
linux online, the screen output is cut short.  I have lengthened the
30 second script time max to 45 but that made no difference at all.  

Depending on the particulars, the routine stops at a certain spot.  If
it is rerun, it stops at the very same spot again.  Putting in other
particulars cause it to stop at a different point, further down.  It
seems that changes which affect the number of mysql calculations, make
some difference in the length of the screen display, but it's only a
minor amount.  It cuts off somewhere around 4 pages.

Any ideas please. 

Floyd

--

--- End Message ---
--- Begin Message ---
Well, I don't know if this might be it, but a while back, I had problems
with apache + php (forget which version) and a bug in php that cause memory
problems.

I was using an array to store fairly large amounts of data. What would
happen is something similar to what you describe. Modifying the code to
avoid using an array solved the problem. Have not had the problem since
upgrading php.

Martin

Floyd Baker <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hello...
>
> I have a routine that works fine on local win98 but when it runs on
> linux online, the screen output is cut short.  I have lengthened the
> 30 second script time max to 45 but that made no difference at all.
>
> Depending on the particulars, the routine stops at a certain spot.  If
> it is rerun, it stops at the very same spot again.  Putting in other
> particulars cause it to stop at a different point, further down.  It
> seems that changes which affect the number of mysql calculations, make
> some difference in the length of the screen display, but it's only a
> minor amount.  It cuts off somewhere around 4 pages.
>
> Any ideas please.
>
> Floyd
>
> --



--- End Message ---
--- Begin Message ---
what is the online-version?
I mean which webserver-software in which version?


Thomas

On Fri, 30 May 2003 20:45:08 -0400 [EMAIL PROTECTED] (Floyd Baker) wrote:

> 
> Hello...
> 
> I have a routine that works fine on local win98 but when it runs on
> linux online, the screen output is cut short.  I have lengthened the
> 30 second script time max to 45 but that made no difference at all.  
> 
> Depending on the particulars, the routine stops at a certain spot.  If
> it is rerun, it stops at the very same spot again.  Putting in other
> particulars cause it to stop at a different point, further down.  It
> seems that changes which affect the number of mysql calculations, make
> some difference in the length of the screen display, but it's only a
> minor amount.  It cuts off somewhere around 4 pages.
> 
> Any ideas please. 
> 
> Floyd
> 
> --



--- End Message ---
--- Begin Message ---
On Fri, 30 May 2003 20:45:08 -0400 [EMAIL PROTECTED] (Floyd Baker) wrote:
--------------------[snip]-------------------- 
> I have a routine that works fine on local win98 but when it runs on
> linux online, the screen output is cut short.  I have lengthened the
> 30 second script time max to 45 but that made no difference at all.  
> 
> Depending on the particulars, the routine stops at a certain spot.  If
> it is rerun, it stops at the very same spot again.  Putting in other
> particulars cause it to stop at a different point, further down.  It
> seems that changes which affect the number of mysql calculations, make
> some difference in the length of the screen display, but it's only a
> minor amount.  It cuts off somewhere around 4 pages.
--------------------[snip]-------------------- 

I once had this effect on pages exceeding a total size of 8k when running a
test server on an asynchronoous line (ADSL, in 712kB, out 64kB). As long as
the page fits into a single IP packet (which usually equals 8kB) no
problems occur, however if more than one packet is needed to transmit the
page the webserver will only be able to send the first packet. All pages
went fine when using a synchronous connection (in == out).


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



--- End Message ---
--- Begin Message ---
On Fri, 2003-05-30 at 20:02, Beauford wrote:
> Your right though, the code is awkward - but I couldn't think of any other
> way of doing it.
> 
> Any suggestions?
> 
 
switch

http://us4.php.net/manual/en/control-structures.switch.php


--- End Message ---
--- Begin Message ---
I find  the switch statement does not always give the desired results and
it's really not any different than using the if statement - the calculations
would still have to be the same - it's just laid out differently.

----- Original Message ----- 
From: "Brian V Bonini" <[EMAIL PROTECTED]>
To: "Beauford" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, May 30, 2003 9:18 PM
Subject: Re: [PHP] What's wrong with this code??


> On Fri, 2003-05-30 at 20:02, Beauford wrote:
> > Your right though, the code is awkward - but I couldn't think of any
other
> > way of doing it.
> >
> > Any suggestions?
> >
>
> switch
>
> http://us4.php.net/manual/en/control-structures.switch.php
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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

At 2003-05-30 12:04 -0700, motorpsychkill wrote:
>I've wanted to get some input on this for a while...  I've recently been
>designing PHP applications using the following directory architecture:
>
>main/
>        master php files (e.g. addphoto.php)
>
>        includes/
>        forms/
>        validation/
>        process/

I think you shouldn't use plurals, just call them include, form etc.
When you use 'include', you should also consider renaming 'validation'
to 'validate'.

>So, using the addphoto.php example, there would be a file in the forms
>directory that read:  addphoto_form.inc
>In the validation directory, there would be:  addphoto_validation.inc
>And in the process directory, addphoto_process.inc
>
>The master php file (addphoto.php) would simply pull the form, validate it
>and process it.  Now the problem is, as I add more master files (currently
>around 50), the forms, validation and process directories get equally large.
>Would it make more sense to simply allocate each master file its own
>directory like this:
>
>addphoto/
>        addphoto_form.inc
>        addphoto_validate.inc
>        addphoto_process.inc

Like Jim I prefer this second method, because it gives every
application it's own directory. This also makes copying a
project or part of a project and converting it into a new
project easier.

I wouldn't reuse the name of the project in the name
of the file, because it makes copying and renaming
the files and converting it into a new project harder.
This also goes for the main file I think, so you also
shouldn't call that addphoto.php but call it index.php
instead.


Greetings,
Jaap

-- Chip Directory
-- http://www.chipdir.biz/
-- http://www.chipdir.info/
-- http://www.chipdir.net/
-- http://www.chipdir.nl/
-- http://www.chipdir.org/
-- And about 30 other mirror sites world-wide.
--
-- To subscribe to a free 'chip issues, questions and answers'
-- mailing list, send a message to [EMAIL PROTECTED] with
-- in the body 'subscribe chipdir-L'. About 500 experts are
-- willing to think with you about electronics problems etc.


--- End Message ---
--- Begin Message ---
Hi all, I've got a really tough question, I am building an application that 
allows PayPal's shopping cart to have multiple items, but also multiple 
prices for the same item, but a different style or size or color, and Im 
quite stuck on how I would get the prices of the item according to it's color 
or description from a dropdown and insert it into a hidden field to be 
inserted into the shopping cart, as far as I know I can't modify the dropdown 
or it will not show up in the options of the shopping cart, so I need to work 
around the dropdowns.

Basically what Im trying to do is when lets say "black" is selected from the 
dropdown, then the price for a black shirt is grabbed from the database and 
inserted into a hidden field.

Did I explain the right?
-- 
David M.


--- End Message ---
--- Begin Message ---
On Fri, 30 May 2003 21:47:03 -0400, you wrote:

>Hi all, I've got a really tough question, I am building an application that 
>allows PayPal's shopping cart to have multiple items, but also multiple 
>prices for the same item, but a different style or size or color, and Im 
>quite stuck on how I would get the prices of the item according to it's color 
>or description from a dropdown and insert it into a hidden field to be 
>inserted into the shopping cart, as far as I know I can't modify the dropdown 
>or it will not show up in the options of the shopping cart, so I need to work 
>around the dropdowns.
>
>Basically what Im trying to do is when lets say "black" is selected from the 
>dropdown, then the price for a black shirt is grabbed from the database and 
>inserted into a hidden field.

Exactly what data are you trying to store? Something like this?

for each item_chosen
    (id, qty, colour, price)

One approach is to put all your data in an array, serialize the array and
store that as the hidden field.

Another is to use sessions, and store the array in the session (probably
faster).

A third is to write the data out to a series of hidden fields beginning with
xyz (xyz1, xyz2, xyz3, etc), and iterate over the contents of the returned
form to find the xyz* fields.

Of the three, sessions are the one you /should/ use - because if pricing
data goes out to the client, it can be altered.


--- End Message ---
--- Begin Message ---
I briefly tried searching the archives for this, but there aren't any handy
keywords, so I didn't find anything.  Why can't I do this:

$year = getdate($timestamp)['year'];

(syntax error) while I can do this:

$temp = getdate($timestamp);
$year = $temp['year'];

and is there a way to combine the above into one statement, however
ungainly?

This doesn't just happen with getdate -- it happens with any function
returning an array.  I'm using PHP 4.1.2.

Dustin

-- 

  Dustin Mitchell
  [EMAIL PROTECTED]/[EMAIL PROTECTED]
  http://people.cs.uchicago.edu/~dustin/

--- End Message ---
--- Begin Message ---
IMHO the function()[] syntax should be allowed, but it isn't.

You could use list() or extract(), but then you'd wind up with a lot more date 
than you want. What I've been doing is creating a function, then calling when 
needed. For example:

function array_get_value($array, $index) {
        return $array[$index];
}

array_get_value(getdate($timestamp), 'year');

If you'd like to fill out a bug report (use 'feature request' for the type of 
bug), http://bugs.php.net/




On Friday 30 May 2003 06:52 pm, Dustin Mitchell wrote:
> I briefly tried searching the archives for this, but there aren't any handy
> keywords, so I didn't find anything.  Why can't I do this:
>
> $year = getdate($timestamp)['year'];
>
> (syntax error) while I can do this:
>
> $temp = getdate($timestamp);
> $year = $temp['year'];
>
> and is there a way to combine the above into one statement, however
> ungainly?
>
> This doesn't just happen with getdate -- it happens with any function
> returning an array.  I'm using PHP 4.1.2.
>
> Dustin

-- 

All religions are founded on the fear of the many and the cleverness of the 
few.

-Stendhal


--- End Message ---
--- Begin Message ---
At 06:23 31.05.2003, Evan Nemerson said:
--------------------[snip]--------------------
>IMHO the function()[] syntax should be allowed, but it isn't.
>
>You could use list() or extract(), but then you'd wind up with a lot more
>date 
>than you want. What I've been doing is creating a function, then calling when 
>needed. For example:
>
>function array_get_value($array, $index) {
>       return $array[$index];
>}
>
>array_get_value(getdate($timestamp), 'year');
--------------------[snip]-------------------- 

A little profiling notice on this here.

Constructing 3 testbeds, accessing an array through a function passing an
array reference (so the array won't get copied to the function), one using
your array_get_value() from above (without references, so the array will
get copied), and one using a local variable and direct access. 

The testbed source is copied below, as always. 
The numbers:

1.355221 secs (0.013552 msecs each): Copy local, direct access (100000 passes)
0.550718 secs (0.005507 msecs each): Ref local, direct access (100000 passes)
2.497536 secs (0.024975 msecs each): array_get_value (100000 passes)
0.906490 secs (0.009065 msecs each): array_get_value_ref (100000 passes) 

The interesting stuff is that storing the array to a local variable and
accessing it directly is slower than calling a function passing a reference
to the array. As you may notice, using array references is _always_ faster
by some factor, as copying the array is avoided.

Conclusion: use array references wherever you can. If you build a function
returning an array, let it return a reference (function &myfunc()), and use
this reference when calling ($var =& myfunc()). If you have this in a loop
it might save your script some valuable time.

Notes to the test scenario:
Since I've been interested in timing array access, not array creation, I've
used a static copy of the getdate() array, avoiding to profile the
getdate(time()) function.

// the static array to run the test with
$atime = getdate(time());

// return a reference to the array
function &arviaref() {
        global $atime;
        return $atime;
}

// return a copy of the array
function &arviacopy() {
        global $atime;
        return $atime;
}

//////////////////////////////////////////////////
// PROFILE CANDIDATES
function array_get_value_ref(&$array, $index) {
        return $array[$index];
}

function array_get_value($array, $index) {
        return $array[$index];
}
//////////////////////////////////////////////////

$LOOPS = 100000;

$x = measure();
for ($i = 0; $i < $LOOPS; ++$i) {
        $temp = arviacopy();
        $rslt = $temp['year'];
}
echo measure($x, 'Copy local, direct access (%1$d passes)', $i, array($i));

$x = measure();
for ($i = 0; $i < $LOOPS; ++$i) {
        $temp =& arviaref();
        $rslt = $temp['year'];
}
echo measure($x, 'Ref local, direct access (%1$d passes)', $i, array($i));

$x = measure();
for ($i = 0; $i < $LOOPS; ++$i)
        $rslt = array_get_value(arviaref(), 'year');
echo measure($x, 'array_get_value (%1$d passes)', $i, array($i));

$x = measure();
for ($i = 0; $i < $LOOPS; ++$i)
        $rslt = array_get_value_ref(arviaref(), 'year');
echo measure($x, 'array_get_value_ref (%1$d passes)', $i, array($i));

function measure($start = null, $string = null, $passes = null, $params = null)
{
        // the bias is the effort made for calling measure() twice
        // and constructing the optional array parameter for the second call
        // note we do not run measure($start, $string, $passes, $params) since
        // this would add a lot of action that gets not timed by measure()
        // to the bias value.
        static $bias = -1;
        if ($bias == -1) {
                $bias = 0;
                $x = microtime();
                for ($i = 0; $i < 1000; ++$i) {
                        measure(); measure();
                        $a = array('string entry','string entry','string
entry');
                }
                $y = microtime();
                list($s0, $s1) = explode(' ', $x);
                list($e0, $e1) = explode(' ', $y);
                $bias = (($e0 + $e1) - ($s0 + $s1)) / 1000;
        }

        // get the current time
        $x = microtime();

        // if the start time is set, this is a final profiling call
        if ($start) {
                list($s0, $s1) = explode(' ', $start);
                list($e0, $e1) = explode(' ', $x);
                $time = ($e0 + $e1) - ($s0 + $s1) - $bias;
                if (is_array($params)) {
                        $cmd = "return sprintf(\$string, '" . join("','",
$params) . "');";
                        $string = eval($cmd);
                }
                if ($passes)
                        $x = sprintf("%f secs (%f msecs each): %s\n",
$time, ($time * 1000) / $passes, $string);
                else
                        $x = sprintf("%f secs: %s\n", $time, $string);
        }

        // return either the time, or the profiling string
        return $x;
}



-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



--- End Message ---
--- Begin Message ---
I see some posts here that say storing a username or encrypted password in a
cookie is not secure. If so, then what's a more secure way to allow users to
be "remembered" using a cookie so that they don't have to log in every time
they come to the site? What do you store in the cookie to authenticate
against?

Monty


--- End Message ---
--- Begin Message ---
The short answer is that if you're worried about security, don't store a uid
and pwd in a cookie on the client... banks don't do it, for example.

It's also common for the uid to be remembered, but not the pwd.

>From what I can see happening on the "big sites", you give the user the
option to be remembered or not, and you advise them against it if they're on
a shared/public computer, or even remotely care about security and privacy.

Handling log-ins and cookie sending under SSL would also help.


Justin


on 31/05/03 4:29 PM, Monty ([EMAIL PROTECTED]) wrote:

> I see some posts here that say storing a username or encrypted password in a
> cookie is not secure. If so, then what's a more secure way to allow users to
> be "remembered" using a cookie so that they don't have to log in every time
> they come to the site? What do you store in the cookie to authenticate
> against?
> 
> Monty
> 


--- End Message ---
--- Begin Message ---
Send a session ID to the user in a cookie, then lookup that ID in a database 
on the server. It's extremely difficult to guess random session ID's (don't 
just increment them!), and if you have a session timeout, you're pretty much 
set.

It's not perfect, but I don't think anyone has come up with a better way

The way it's been explained to me, this is how PHP's sessions work, but I have 
not personally verified this. So I think it's okay to put semi-sensitive data 
in the session array (you shouldn't ever store really sensitive data). Check 
first though.




On Friday 30 May 2003 10:29 pm, Monty wrote:
> I see some posts here that say storing a username or encrypted password in
> a cookie is not secure. If so, then what's a more secure way to allow users
> to be "remembered" using a cookie so that they don't have to log in every
> time they come to the site? What do you store in the cookie to authenticate
> against?
>
> Monty

-- 

Perl - the only language that looks the same before and after RSA encryption.

-Keith Bostic


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Hi list,
> 
> i'm very newbie in PHP so sorry for this simple question but i havn't found any
> differences between my "code" and example code on a lot of website that i visited.
> 
> I use PHP-4.3.1, OpenLDAP 2.1.19, BerkeleyDB-4.1.25 and Apache-2.0.45.
> 
> My problem is that my variables are not taken into account.
> 
> This is the code :
> ------------------
> 
> <?php
> 
> print "<center><form method='post'>  Username : <br>
>        <input type='text' name='user' size='20'></form>\n";
> print "<center><form method='post'>  Firstname : <br>
>        <input type='text' name='firstname' size='20'></form>\n";
> print "<center><form method='post'>  Lastname : <br>
>        <input type='text' name='lastname' size='20'></form>\n";
> print "<center><form method='post'>  Telephon Number : <br>
>        <input type='text' name='tel' size='20'></form>\n";
> print "<center><form method='post'>  Mobile Number : <br>
>        <input type='text' name='mobile' size='20'></form>\n";
> print "<center><form method='post'>  Address : <br>
>        <textarea name='street' rows='3' cols='20'></textarea></form>\n";
> print "<center><form method='post'><br>
>        <input type='submit' value='Valider' name='goldap'></form>\n";

You only need one <FORM> here, not one for each value. When you click 
Valider, it only sends the values in that FORM element and of course the 
only variable there is goldap :-(

So remove all <FORM> except the first, and remove all </FORM> except the 
last and see how you go.

-- 
Quod subigo farinam


--- End Message ---
--- Begin Message ---
Quoting David Robley <[EMAIL PROTECTED]>:

> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> >[...]
> > My problem is that my variables are not taken into account.
> > 
> > This is the code :
> > ------------------
> > 
> > <?php
> > 
> > print "<center><form method='post'>  Username : <br>
> >        <input type='text' name='user' size='20'></form>\n";
> > print "<center><form method='post'>  Firstname : <br>
> >        <input type='text' name='firstname' size='20'></form>\n";
> > print "<center><form method='post'>  Lastname : <br>
> >        <input type='text' name='lastname' size='20'></form>\n";
> > print "<center><form method='post'>  Telephon Number : <br>
> >        <input type='text' name='tel' size='20'></form>\n";
> > print "<center><form method='post'>  Mobile Number : <br>
> >        <input type='text' name='mobile' size='20'></form>\n";
> > print "<center><form method='post'>  Address : <br>
> >        <textarea name='street' rows='3' cols='20'></textarea></form>\n";
> > print "<center><form method='post'><br>
> >        <input type='submit' value='Valider' name='goldap'></form>\n";
> 
> You only need one <FORM> here, not one for each value. When you click 
> Valider, it only sends the values in that FORM element and of course the 
> only variable there is goldap :-(
> 
> So remove all <FORM> except the first, and remove all </FORM> except the 
> last and see how you go.
> 
>[...]

Hi David,

the "problem" is resolved.
I did not know that the variables was lost when the form was closed.  
It is logical... :-) 

Thanks a lot for your help in this basic case... 
Thanks also to Mark.

Cheers,

Cecile.




-------------------------------------------------
Mail sent through GFI Mailserver1.0
info: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Is there any way getting the time taken to parse a script?

IE:

This page took 0.13 seconds to generate.

Is it a predefined variable anywhere?

Thanks ;o)

Bix.



--- End Message ---
--- Begin Message ---
On Sat, 31 May 2003 11:39:41 +0100, you wrote:

>Is there any way getting the time taken to parse a script?
>
>IE:
>
>This page took 0.13 seconds to generate.

Call microtime() at the beginning and end of the script.

$timeTaken = $timeEnd - $timeStart;

see

http://uk2.php.net/manual/en/function.microtime.php

and read the comments.


--- End Message ---
--- Begin Message ---
At 12:39 31.05.2003, Bix said:
--------------------[snip]--------------------
>Is there any way getting the time taken to parse a script?
>
>IE:
>
>This page took 0.13 seconds to generate.
>
>Is it a predefined variable anywhere?
--------------------[snip]-------------------- 

$start = microtime();
for ($i = 0; $i < 10000; ++$i)
        $n = getdate(time());
$end = microtime();
list($s0, $s1) = explode(' ', $start);
list($e0, $e1) = explode(' ', $end);
echo sprintf('<hr>This page took %.2f seconds to generate',
($e0+$e1)-($s0+$s1));


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



--- End Message ---
--- Begin Message ---
Greeting,

I have a postnuke site and I want to connect it to two databases in order to
verify users from these databases.



--- End Message ---

Reply via email to