php-windows Digest 12 Nov 2003 05:27:55 -0000 Issue 1995

Topics (messages 22070 through 22075):

Re: Problem with Socket and CPU usage!
        22070 by: Eric COLINET

Please help !
        22071 by: Lawrence
        22072 by: C-omputerSolutions Webmaster

Re: HOW DO I FIND GD LIB ENABLED
        22073 by: S F Alim
        22075 by: toby z

Thanks so much !
        22074 by: Lawrence

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 --- Hi,

What the timeout of your socket_select ?
Because when the timeout is NULL or a big value your script normally 'sleep' when nothing append.


Eric


At 15:14 11/11/2003, Alex wrote:
Hello ALL!

I've made an IRC client with DCC support (it uses many sockets)
I use socket_select in an infinite loop. All works fine, but the
problem is CPU usage. When I start my script CPU-usage rises to 100%
and stops there :(
So I wander is there any way to optimize the code to lower the CPU
usage? It is really a big problem running this script cause it slows
down other programs.
HELP me please!

Thanks for attention!

Best regards to all!

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

--- End Message ---
--- Begin Message ---
// $_SESSION["cart_m"] includes these values : flower01 fruit01 cake01

When I echo $_SESSION["cart_m"] , it look like this
$i = 1 ;
 while  ( $i <= $_SESSION["productlist"] )
(
   echo $_SESSION["cart_m$i"] ;
   $i = $i + 1 ;
 }
Result is :
flower01
fruit01
cake01

I want to use these values with 2checkout
$i = 1 ;
 while  ( $i <= $_SESSION["productlist"] )
(
   header(" location :
www.2checkout.com/cgibin/sbuyers/cart_order_id=".$_SESSION["cart_m$i"]."")
   $i = $i + 1 ;
 }

But result is I just receive the last result :
 www.2checkout.com/cgibin/sbuyers/cart_order_id=cake01

I want to get all values like this , but I do not know how to do , anyone
can help me , thank you .
www.2checkout.com/cgibin/sbuyers/cart_order_id=cake01fruit01flower01

--- End Message ---
--- Begin Message ---
the main problem is that each time it your script cycles through the
different ids, it resets the header location to the last value received, the
echo statement just prints each line as it comes up changed keeping the
values you want to show, but the header reference changes every time you
continue the loop and increment $i [see my comments in your script], there
are a few ways you can handle this - you can use a MySQL database [if you
have access to it] to store the variables after each pass, or you can use a
third variable and add to it each time the loop goes through

<<EXAMPLE>>
$i = 1 ;
 while  ( $i <= $_SESSION["productlist"] )
(
   $cartcontents = "$cartcontents$_SESSION[\"cart_m$i\"]";
   $i = $i + 1 ;
}
header(" location :
www.2checkout.com/cgibin/sbuyers/cart_order_id=".$cartcontents".");

or a variation on that that suits your situation
<</EXAMPLE>>
-----Original Message-----
From: Lawrence [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Please help !


// $_SESSION["cart_m"] includes these values : flower01 fruit01 cake01

When I echo $_SESSION["cart_m"] , it look like this
$i = 1 ;
 while  ( $i <= $_SESSION["productlist"] )
(
   echo $_SESSION["cart_m$i"] ;
<<[EMAIL PROTECTED] - COMMENT -  this line works fine because
each echo statement is printed to the same page >>
   $i = $i + 1 ;
 }
Result is :
flower01
fruit01
cake01

I want to use these values with 2checkout
$i = 1 ;
 while  ( $i <= $_SESSION["productlist"] )
(
   header(" location :
www.2checkout.com/cgibin/sbuyers/cart_order_id=".$_SESSION["cart_m$i"]."")
   $i = $i + 1 ;
<<[EMAIL PROTECTED] COMMENT - Here, every time $i is
incremented, the value of header(" location: ...) is changed as well
therefore with each pass the header variable will equal the corresponding
cart_m$i data (ie cart_m$1 = flower01, cart_m$2 = fruit01, cart_m$3 =
cake01) which is why the only result you get is the cart_order_id=cake01>>
 }

But result is I just receive the last result :
 www.2checkout.com/cgibin/sbuyers/cart_order_id=cake01

I want to get all values like this , but I do not know how to do , anyone
can help me , thank you .
www.2checkout.com/cgibin/sbuyers/cart_order_id=cake01fruit01flower01

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

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

Ok I couldn't find it in my phpinfo() output. I did find the file in
"c:\php\..." and also I found extension=php_d2.dll syntax in php.ini but
there is semi colon (;) before it.
Even I remove (;) semi colon from it, and restart my pc, but still its
not in phpinfo() page. 
Need help quick on this one...

faisal


-----Original Message-----
From: Frank M. Kromann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 11, 2003 2:35 AM
To: 'PHP Help Desk'
Subject: Re: [PHP-WIN] HOW DO I FIND GD LIB ENABLED

Hi,

The GD librarry is included in a DLL on Win32. You need to load the
library from php.ini with extension=php_gd2.dll or from the script with
dl("php_gd2.dll");

You can check the output from phpinfo(); to see if the GD has been
loaded.

- Frank

> Hi,
>  
> Can I find that my php version support gd library, 
> My php version is 4.3.3 and server is IIS 5.0 and I want to configure
it
> for JPGraph.
> Thnx in advanced.
>  
> Faisal
> 

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

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

> Ok I couldn't find it in my phpinfo() output. I did find the file
> in
> "c:\php\..." and also I found extension=php_d2.dll syntax in
> php.ini but
> there is semi colon (;) before it.

yeah .... ofcourse there is
a semi-colan means it commented out ! ! ! ! 

> Even I remove (;) semi colon from it, and restart my pc, but still
> its
> not in phpinfo() page. 

u dont need to restart ur machine 
just restart apache service

> Need help quick on this one...

learn to go polite on people pal 

good luck

toby


> -----Original Message-----
> From: Frank M. Kromann [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 11, 2003 2:35 AM
> To: 'PHP Help Desk'
> Subject: Re: [PHP-WIN] HOW DO I FIND GD LIB ENABLED
> 
> Hi,
> 
> The GD librarry is included in a DLL on Win32. You need to load the
> library from php.ini with extension=php_gd2.dll or from the script
> with
> dl("php_gd2.dll");
> 
> You can check the output from phpinfo(); to see if the GD has been
> loaded.
> 
> - Frank
> 
> > Hi,
> >  
> > Can I find that my php version support gd library, 
> > My php version is 4.3.3 and server is IIS 5.0 and I want to
> configure
> it
> > for JPGraph.
> > Thnx in advanced.
> >  
> > Faisal
> > 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

--- End Message ---
--- Begin Message ---
$cartcontents = 0 ;
// if value of $cartcontents is defined , it will announce undefined
$cartcontents

$i = 1 ;
 while  ( $i <= $_SESSION["productlist"] )
(

$cartcontents = "$cartcontents".$_SESSION["cart_m$i"].""; // this is my
correction
//$cartcontents = "$cartcontents$_SESSION[\"cart_m$i\"]";
   $i = $i + 1 ;
}
This is my result :
header(" location :
www.2checkout.com/cgibin/sbuyers/cart_order_id=0flower01fruit01cake01

Thanks for your help , thanks so much .



"C-Omputersolutions Webmaster" <[EMAIL PROTECTED]> wrote in
message
news:[EMAIL PROTECTED]
> the main problem is that each time it your script cycles through the
> different ids, it resets the header location to the last value received,
the
> echo statement just prints each line as it comes up changed keeping the
> values you want to show, but the header reference changes every time you
> continue the loop and increment $i [see my comments in your script], there
> are a few ways you can handle this - you can use a MySQL database [if you
> have access to it] to store the variables after each pass, or you can use
a
> third variable and add to it each time the loop goes through
>
> <<EXAMPLE>>
> $i = 1 ;
>  while  ( $i <= $_SESSION["productlist"] )
> (
>    $cartcontents = "$cartcontents$_SESSION[\"cart_m$i\"]";
>    $i = $i + 1 ;
> }
> header(" location :
> www.2checkout.com/cgibin/sbuyers/cart_order_id=".$cartcontents".");
>
> or a variation on that that suits your situation
> <</EXAMPLE>>
> -----Original Message-----
> From: Lawrence [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 11:02 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Please help !
>
>
> // $_SESSION["cart_m"] includes these values : flower01 fruit01 cake01
>
> When I echo $_SESSION["cart_m"] , it look like this
> $i = 1 ;
>  while  ( $i <= $_SESSION["productlist"] )
> (
>    echo $_SESSION["cart_m$i"] ;
> <<[EMAIL PROTECTED] - COMMENT -  this line works fine
because
> each echo statement is printed to the same page >>
>    $i = $i + 1 ;
>  }
> Result is :
> flower01
> fruit01
> cake01
>
> I want to use these values with 2checkout
> $i = 1 ;
>  while  ( $i <= $_SESSION["productlist"] )
> (
>    header(" location :
> www.2checkout.com/cgibin/sbuyers/cart_order_id=".$_SESSION["cart_m$i"]."")
>    $i = $i + 1 ;
> <<[EMAIL PROTECTED] COMMENT - Here, every time $i is
> incremented, the value of header(" location: ...) is changed as well
> therefore with each pass the header variable will equal the corresponding
> cart_m$i data (ie cart_m$1 = flower01, cart_m$2 = fruit01, cart_m$3 =
> cake01) which is why the only result you get is the cart_order_id=cake01>>
>  }
>
> But result is I just receive the last result :
>  www.2checkout.com/cgibin/sbuyers/cart_order_id=cake01
>
> I want to get all values like this , but I do not know how to do , anyone
> can help me , thank you .
> www.2checkout.com/cgibin/sbuyers/cart_order_id=cake01fruit01flower01
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---

Reply via email to