OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 6 Jan 2005 16:59:19 -0000 Issue 3212

php-general-digest-helplists.php.net
Date: Thu Jan 06 2005 - 10:59:19 CST


php-general Digest 6 Jan 2005 16:59:19 -0000 Issue 3212

Topics (messages 205709 through 205745):

Re: PHP cacher?
        205709 by: Kimmo Alm

Re: making FORM dissapear when successful login
        205710 by: JHollis

call a function within the same class
        205711 by: kalinga

Setting Up PHP
        205712 by: George McGuey
        205727 by: Mike Smith
        205731 by: John Nichel

Weird search and replace
        205713 by: Liam Gibbs
        205716 by: Jason Wong

Image copying
        205714 by: Liam Gibbs
        205715 by: Jason Wong
        205742 by: Richard Lynch

Re: endless while loop
        205717 by: Jason Wong
        205736 by: Gunter Sammet

Removing all <tr> tag
        205718 by: Binoy AV
        205720 by: Christophe Chisogne

Re: multiple deleting and updating raw mysql via php
        205719 by: Sejati Opreker

[suspicious - maybe spam] SELECT probrem
        205721 by: Phpu

Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] SELECT probrem
        205722 by: Richard Davey

Form to email with Special Characters
        205723 by: Hugo Tavares
        205724 by: Bogomil Shopov
        205725 by: Hugo Tavares

Regexp help second
        205726 by: UroÅ¡ Gruber
        205739 by: Richard Lynch

Re: apache 1 vs 2 w/php
        205728 by: William Lovaton
        205729 by: William Lovaton

Re: Persistent PHP web application?
        205730 by: William Lovaton
        205735 by: Josh Whiting
        205744 by: William Lovaton
        205745 by: Rasmus Lerdorf

Re: Total Server Sessions
        205732 by: William Lovaton

OpenSSL Problem
        205733 by: Gustafson, Tim
        205737 by: Richard Lynch
        205740 by: Gustafson, Tim
        205743 by: Gustafson, Tim

Re: migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.
        205734 by: symbulos partners
        205738 by: Greg Donald
        205741 by: Jason Barnett

Administrivia:

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

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

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

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

attached mail follows:


On 6 Jan 2005 03:02:10 -0000, Matthew Weier O'Phinney <matthewgarden.org>
wrote:

> * Kimmo Alm <kimmo.almbredband.net>:
>> On 5 Jan 2005 17:28:42 -0000, Matthew Weier O'Phinney
>> <matthewgarden.org>
>> wrote:
>> > * Kimmo Alm <kimmo.almbredband.net>:
>> > > I've been looking for some PHP cache software for a while now, and
>> > > I just can't seem to find one suitable for my setup.
>> > >
>> > > I run PHP 5.x on FreeBSD 4.x with Apache 2.x. I don't particularly
>> fancy
>> > > the Linux compability, but rather would prefer a native solution.
>> > >
>> > > It must be free (no charge)...
>> >
>> > http://eaccelerator.sourceforge.net/Home
>>
>> I was happy when you showed me that link, as I had managed to not find
>> that particular accelerator software.
>>
>> However, that ALSO doesn't seem to support PHP 5 and says nothing about
>> FreeBSD.
>
> I don't mean to be rude, but how deep did you dig into that site?
>
> It *does* support PHP5, as of 0.9.1. It was for that reason that it came
> into being -- it forked off of Turckk mmcache because no progress was
> being made on PHP5 compatability.
>
> Also -- of the two items in the FAQ, one *specifically* addresses
> compiling for FreeBSD.
>

I looked at the Web site again, and now it was all clear. Perhaps I was
mentally drunk or something at the time I first checked it. Sorry.

However, it's funny how they lie in the actual README ;-)

attached mail follows:


nevermind...i figured it out. I will read up on sessions and test some
things with what you posted and if i have anymore questions, i will post
them. Thanks Jerry.

If anyone else has any other suggestions, please feel free to share them
with me.

JHollis wrote:
> Where do i need to start my session? Ive copied and pasted exactly what
> you have typed..and the form doesnt display unless i hard code the
> variable to "NO".
>
> Jerry Kita wrote:
>
>> I do exactly the same thing on my website. I use PHP's Session
>> handling to determine if a user is actually logged on.
>>
>> You can see that I check a variable called $validlogon which I set to
>> either YES or NO at the beginning of the script
>>
>> <?php
>> if ($validlogon == "NO") {
>> print "<p class=\"hnavbar\">Salkehatchie Members Login Here:<br>\n";
>> print "<form action=\"Salkehatchie_LoginScript.php\" method=\"POST\">\n";
>> print "<p class=\"login\"><small>USER ID:</small><br>\n";
>> print "<input type=\"text\" name=\"userid\"><br><br>\n";
>> print "<small>PASSWORD:</small><br>\n";
>> print "<input type=\"password\" name=\"password\"><br><br>\n";
>> print "<input type=\"submit\" value=\"Enter\"></p>\n";
>> print "</form>\n";
>> }
>> ?>
>>
>> Near the beginning of my script I check for the existence of a valid
>> session
>>
>> <?php
>> if (isset($_SESSION[userid])) {
>> $validlogon = "YES";
>> } else {
>> $validlogon = "NO";
>> }
>> ?>
>>
>> Setting the $validlogon variable allows me to do a number of useful
>> things. For example, there are certain parts of the webpage that I
>> reveal to logged in users. Checking $validlogon allows me to decide
>> dynamically what to render to the browser. In the following I display
>> a message showing the user as being logged in and give them a link that
>> logs them out.
>>
>> if ($validlogon == "YES") {
>> print "<table style=\"width: 100%\";>\n";
>> print "<tbody>\n";
>> print "<tr>\n";
>> print "<td width=\"50%\"><p class=\"login\"><small><b>YOU ARE
>> LOGGED IN AS: $_SESSION[userid]</b></small></p></td>\n";
>> print "<td width=\"50%\"><p class=\"login\"><small><b>CLICK <a
>> href=\"LogoutScript.php\"> here</a> TO LOGOUT</b></small></p></td>\n";
>> print "</tr>\n";
>> print "</table>\n";
>> }
>>
>> Hope this is helpful
>>
>> Jerry Kita
>>
>> JHollis wrote:
>>
>>> I had this code working the way i wanted it to (as far as correct
>>> username and password allowing successful login)...but what i want to
>>> happen now is when a user successfully logs it it will make the login
>>> form disappear and just say successfully logged in or welcome user
>>> and a link below it so they can log off and make the form re-appear.
>>> Below is the code that i have where i tried to get it to disappear on
>>> successful login, but it stays disappeared all the time. Can someone
>>> please point out what im doing wrong. I have tried everything i can
>>> think of...and nothing works. Im a PHP newbie...so im sure some of
>>> you might get a laugh out of this...if it is real easy.
>>>
>>> <---snippet
>>>
>>>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>>> <html>
>>> <head>
>>> <link href="style.css" rel="stylesheet" type="text/css" />
>>> </head>
>>> <body>
>>> <div id="container">
>>> <div id="top">
>>> <h1>header</h1>
>>>
>>> </div>
>>> <div id="leftnav">
>>> <p>
>>>
>>> <?php
>>>
>>> $username=$_POST['username'];
>>> $password=$_POST['password'];
>>> $db="user";
>>> $server="localhost";
>>> $db_username="root";
>>> $db_password="*******";
>>> $connect = mysql_connect($server,$db_username,$db_password);
>>> if (!$connect) {
>>> die ("could not connect to database");
>>> }
>>> $select = mysql_select_db($db,$connect);
>>> if (!$select) {
>>> die ("could not select database $db");
>>> }
>>> /*username='$username'";*/
>>> $sql = "SELECT * FROM passwords, user_info where id=PID and
>>> username='$username'";
>>> $result = mysql_query($sql);
>>> /*$num_rows = mysql_num_rows($result);*/
>>> while ($user = mysql_fetch_array($result))
>>> {
>>> $id = $user['id'];
>>> $username2 = $user['username'];
>>> $password2 = $user['password'];
>>> $firstname = $user['firstname'];
>>> $email = $user['email_address'];
>>> IF ($username=="$username2" &&
>>> $password=="$password2")
>>> {
>>> echo("\"Welcome, <b>$firstname</b>\"");?><br><?
>>> echo ("\"Your email address is <b>$email<b>\"");?></td><tr>
>>> <a
>>> href="<?$_SERVER['PHP_SELF']?>?username=""&?password=""">Logoff</a><?
>>> break;
>>> }
>>> else
>>> {
>>> ?>
>>> <FORM action="<?$_SERVER['PHP_SELF']?>" method="post">
>>> <INPUT type="hidden" name="id">
>>> <table>
>>> <td><b>*</b>Username:</td> <td><INPUT class="input"
>>> size="8" type="text" name="username" value="<?echo
>>> $username?>"></td><tr>
>>> <td><b>*</b>Password:</td> <td><INPUT class="input"
>>> size="8" type="password" name="password"></td><tr>
>>> <td class="xsmall"><b>* Case Sensitive</b></td>
>>> <td><INPUT type="submit" value="Login"></td><tr>
>>> <td>&nbsp </td>
>>> </table>
>>> </FORM>
>>> <?
>>> break;
>>> }
>>> } //IF ($username != $username2 || $password !=
>>> $password2) {//
>>>
>>> ?><br>
>>> <?
>>> if ($username == "" && $password == "") {
>>> echo ("Please type in a Username and Password");}
>>>
>>> if ($username != "" && $password == "") {
>>> echo ("Please type in a password");}
>>>
>>> if ($username == "" && $password != "") {
>>> echo ("Please type in a username and password");}
>>> ?>
>>> </p>
>>> </div>
>>> <?if (($username2==$username && $password2==$password) &&
>>> ($username2!="" || $password2!="")){?>
>>> <div id="rightnav" class="box">
>>> <p>
>>> </p>
>>> </div>
>>> <?}?>
>>> <div id="content">
>>> <h2>Subheading</h2>
>>> <p>
>>> </p>
>>> <p>
>>> </p>
>>> </div>
>>> <div id="footer">
>>> <p>
>>> Today is
>>> <?php
>>> echo( date("F dS Y."));
>>> ?>
>>> </p>
>>> </div>
>>> </div>
>>> </body>
>>> </html>
>>> ---->snippet
>>
>>
>>
>>

attached mail follows:


Dear all,
I recently started PHP OOP and I'm bit confused about best and the most
efficient methods when 'declaring a class' and 'calling function',
could somebody
explain me with following sample code, it would be great..

thanks..

class classLdap{

        $rslt = $_POST['rslt'];

        function ldapConnect($rslt){
          ....
          ......
          return $rslt;
        }// end function ldapConnect

        function ldapAdd($rslt){
          // i want to call ldapConnect($rslt) here what is the best method.

        $rslt = classLdap::ldapConnect($rslt);
         
        //or
        //(curently i'm doing this way, it's to lengthy)

         $new_classLdap = new classLdap;
         $rslt = $new_classLdap->ldapConnect($rslt);

        //or

         $rslt = $this->ldapConnect($rslt);
        }// end function ldapAdd

}// end class

--
vk.

attached mail follows:


I am using SAMS Teach Yourself on PHP,MYSQL and Apache.

 

Everything has gone well except for the final step to test the PHP by
creating in Apache htdocs file called phpinfo.php.
 
When I do this and then go to the http://localhost/phpinfo.php to view the
information page all I get is the original lines of that are in the text
file which is <?php phpinfo() ; ?>
 
Need help and I am an absolute novice in terms of knowledge.
 
Thanks
 
 

 

G. McGuey

 

attached mail follows:


You'll need to modify your httpd.conf. Depending on you OS/Apache
version it will be different.

For Windows/Apache1.3.x:
http://us2.php.net/manual/en/install.windows.apache1.php

For Windows/Apache2.x:
http://us2.php.net/manual/en/install.windows.apache2.php

For Linux/Apache1.3.x:
http://us2.php.net/manual/en/install.unix.php#install.unix.apache

For Linux/Apache2.x:
http://us2.php.net/manual/en/install.unix.apache2.php

attached mail follows:


George McGuey wrote:
> I am using SAMS Teach Yourself on PHP,MYSQL and Apache.
>
>
>
> Everything has gone well except for the final step to test the PHP by
> creating in Apache htdocs file called phpinfo.php.
>
> When I do this and then go to the http://localhost/phpinfo.php to view the
> information page all I get is the original lines of that are in the text
> file which is <?php phpinfo() ; ?>
>
> Need help and I am an absolute novice in terms of knowledge.
>
> Thanks

Did you configure Apache to parse php files?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


I'm trying to do a search-and-replace for a certain string (#1) from a bigger string (#2), take that string (#1), do an SQL search, then do a little fiddling to make another string (#3), and put that string (#3) back into the big string (#2) to replace the certain string (#1).

Here's what I need. I have a string such as this:

"Yadda yadda yadda yadda '32'(l) yadda yadda yadda '2'(l) yadda '419'(l)." (#2)

I need to find the strings like '32'(l), '2'(l), and '419'(l), including the single quotes. Basically a '[0-9]*'(l). This is #1.

Take that string, look up a record in an SQL table based on the number in the single quotes. Take a field in the record (#3) and replace #1 with it. So basically, we have:

"Yadda yadda yadda yadda supplanted-string yadda yadda yadda supplanted-string yadda supplanted-string." (#2)

I really hope I'm explaining this properly, and after a few attempts, I have no clue where to restart. Does anyone have any ideas how to do this?

attached mail follows:


On Thursday 06 January 2005 14:24, Liam Gibbs wrote:

Please fix your mail client so that in word wraps properly!

> Here's what I need. I have a string such as this:
>
> "Yadda yadda yadda yadda '32'(l) yadda yadda yadda '2'(l) yadda '419'(l)."
> (#2)
>
> I need to find the strings like '32'(l), '2'(l), and '419'(l), including
> the single quotes. Basically a '[0-9]*'(l). This is #1.
>
> Take that string, look up a record in an SQL table based on the number in
> the single quotes. Take a field in the record (#3) and replace #1 with it.
> So basically, we have:
>
> "Yadda yadda yadda yadda supplanted-string yadda yadda yadda
> supplanted-string yadda supplanted-string." (#2)

It seems preg_replace_callback() would be ideal for this job.

--
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
------------------------------------------
New Year Resolution: Ignore top posted posts

attached mail follows:


Hello,

I'm having a real frustrating time with my problem here, which is to copy one JPEG to another resource. I'm not even sure where I'm going wrong, or how to find it out, because it seems that I'm getting all my resource IDs fine (when I echo them, I get 'resource ID #x'), and no error message pops up. Just a broken image is produced. I've been racking myself for so long now that my problem may be right under my nose, but my brain is so baked it's just not working. And I've tried to leave and come back to it, but... you know how it is. Here's what I'm doing.

What I'm trying to do is copy one JPEG to another JPEG (as mentioned) on the fly. I don't want to have a new file produced, just a modified JPEG (a few circles here and there) held in a resource. Here's how I call my function and how I display the image via HTML:

print("<IMG ALT... HEIGHT... WIDTH... SRC = \"" . copy_pic($sourcepic) . "\">");

So I'm calling the function straight from the SRC attribute of the IMG tag. Here's what's in my function:

function copy_pic($sourcepic) {
   if(file_exists($sourcepic)) {
      $destinationpic = imagecreatetruecolor(imagesx($sourcepic), imagesy($sourcepic));
      imagecopy($destinationpic, $sourcepic, 0, 0, 0, 0, imagesx($sourcepic), imagesy($sourcepic));
   }

   return $destinationpic;
}

After this, I'm going to be tampering with the pic, but I just wanted to make sure I'm getting something, which I'm not. All I get is a broken image. No error message, no nothing. Please tell me I'm not overlooking some really idiotic thing, but I'm just having one heckuva time with this.

Thanks, everyone.

attached mail follows:


On Thursday 06 January 2005 14:24, Liam Gibbs wrote:

> What I'm trying to do is copy one JPEG to another JPEG (as mentioned) on
> the fly. I don't want to have a new file produced, just a modified JPEG (a
> few circles here and there) held in a resource. Here's how I call my
> function and how I display the image via HTML:
>
> print("<IMG ALT... HEIGHT... WIDTH... SRC = \"" . copy_pic($sourcepic) .
> "\">");
>
> So I'm calling the function straight from the SRC attribute of the IMG tag.

SRC is supposed to be a URL ...

> Here's what's in my function:
>
> function copy_pic($sourcepic) {
> if(file_exists($sourcepic)) {
> $destinationpic = imagecreatetruecolor(imagesx($sourcepic),
> imagesy($sourcepic)); imagecopy($destinationpic, $sourcepic, 0, 0, 0, 0,
> imagesx($sourcepic), imagesy($sourcepic)); }
>
> return $destinationpic;
> }

... but you're giving it an image resource!

--
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
------------------------------------------
New Year Resolution: Ignore top posted posts

attached mail follows:


Liam Gibbs wrote:
> print("<IMG ALT... HEIGHT... WIDTH... SRC = \"" . copy_pic($sourcepic) .
> "\">");
>
> So I'm calling the function straight from the SRC attribute of the IMG
> tag. Here's what's in my function:
>
> function copy_pic($sourcepic) {
> if(file_exists($sourcepic)) {
> $destinationpic = imagecreatetruecolor(imagesx($sourcepic),
> imagesy($sourcepic));
> imagecopy($destinationpic, $sourcepic, 0, 0, 0, 0,
> imagesx($sourcepic), imagesy($sourcepic));
> }
>
> return $destinationpic;
> }
>
> After this, I'm going to be tampering with the pic, but I just wanted to
> make sure I'm getting something, which I'm not. All I get is a broken
> image. No error message, no nothing. Please tell me I'm not overlooking
> some really idiotic thing, but I'm just having one heckuva time with this.

Not idiotic at all.

You have to sort of "un-learn" something, and wrap your brain around a new
concept. :-)

You know how PHP spits out HTML?

Yeah, well, PHP doesn't *just* spit out HTML.

PHP can *also* spit out an actual JPEG.

Like, it spits out what you would get if you opened up a JPEG in a text
editor and you see all that gobbledy-gook.

But to do this, you've *still* got to have it being spit out as *JUST* the
image, in a separate file, the *same* as having a separate JPEG image file
on the server which is not all that gobbledy-gook pasted into your HTML.

Or, to put it this way:

You currently have something like this all in one big file:

<HTML><BODY>
...
<IMG SRC=JPEG%(**&^##R%GFGE#WWRYUIIUUYY**&%*&%$^&%$#%^#%$#%$^%$##$#%$^%>
...
</BODY></HTML>

But, a valid setup would have *TWO* files. One with:
<HTML><BODY>
<IMG SRC=otherfile.jpg></HTML>
</BODY></HTML>

otherfile.jpg would have the JPEG stuff in it:
JPEG%(**&^##R%GFGE#WWRYUIIUUYY**&%*&%$^&%$#%^#%$#%$^%$##$#%$^%

So you need to move your copy_pic stuff and all of that to a DIFFERENT
file, say "dynamic_jpeg.php".

Your HTML will then have:
<IMG SRC="dynamic_jpeg.php">
in it.

Plus your dynamic_jpeg.php file will have to have this stuff at the end:

header("Content-type: image/jpeg");
imagejpeg($destinationpic);

PS: You may not be *SEEING* the error messages, because they are buried
in the contents of what is supposed to be a JPEG. But if your JPEG looks
like this:

JPEG*(&*^*&^%^&% PHP Error: blah blah blah *&*&^%$$###$%^^^

then it's just a broken JPEG, as far as the browser is concerned.

So surf *DIRECTLY* to it when the browser shows you a broken image icon:

http://sympatico.ca/dynamic_jpeg.php

for example.

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


On Thursday 06 January 2005 05:17, Gunter Sammet wrote:

> I am having some trouble getting the following code to work:
>
> if (is_array($bundle_attributes)) {
>
> reset($bundle_attributes);
>
> while (list($option, $value) = each($bundle_attributes)) {
>
> reset($value);
>
> while (list($option2, $value2) = each($value)) {
>
> $this->contents[$products_id]['attributes'][$option] = $value;
>
> if (tep_session_is_registered('customer_id')) tep_db_query("insert into " .
> TABLE_CUSTOMERS_BASKET_BUNDLE_ATTRIBUTES . " (customers_id, products_id,
> sub_product_id, products_options_id, products_options_value_id) values ('"
> . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" .
> $option . "', '" . (int)$option2 . "', '" . (int)$value2 . "')");
>
> }
>
> }
>
> }
>
> }
>
> It gives me an endless loop in the second while loop. It seems like it
> doesn't move the pointer to the next value in the $option array.

But isn't the "next value" of $option controlled by the outer while-loop?

> When I do
> a print in that loop, I am getting the key value pair for the first element
> in the $option array.

So inside the inner while-loop, $option should never change.

> Changing it to a for loop works. Any ideas why this
> happens?

No. But I can tell you that:

1) the reset() aren't necessary
2) even better, use a foreach-loop instead of while-loop

--
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
------------------------------------------
New Year Resolution: Ignore top posted posts

attached mail follows:


"Jason Wong" <php-generalgremlins.biz> wrote in message
news:200501061706.53390.php-generalgremlins.biz...
> On Thursday 06 January 2005 05:17, Gunter Sammet wrote:
>
>> I am having some trouble getting the following code to work:
>>
>> if (is_array($bundle_attributes)) {
>>
>> reset($bundle_attributes);
>>
>> while (list($option, $value) = each($bundle_attributes)) {
>>
>> reset($value);
>>
>> while (list($option2, $value2) = each($value)) {
>>
>> $this->contents[$products_id]['attributes'][$option] = $value;
>>
>> if (tep_session_is_registered('customer_id')) tep_db_query("insert into "
>> .
>> TABLE_CUSTOMERS_BASKET_BUNDLE_ATTRIBUTES . " (customers_id, products_id,
>> sub_product_id, products_options_id, products_options_value_id) values
>> ('"
>> . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" .
>> $option . "', '" . (int)$option2 . "', '" . (int)$value2 . "')");
>>
>> }
>>
>> }
>>
>> }
>>
>> }
>>
>> It gives me an endless loop in the second while loop. It seems like it
>> doesn't move the pointer to the next value in the $option array.
>
> But isn't the "next value" of $option controlled by the outer while-loop?
>
>> When I do
>> a print in that loop, I am getting the key value pair for the first
>> element
>> in the $option array.
>
> So inside the inner while-loop, $option should never change.
>
>> Changing it to a for loop works. Any ideas why this
>> happens?
>
> No. But I can tell you that:
>
> 1) the reset() aren't necessary
> 2) even better, use a foreach-loop instead of while-loop
>
> --
> 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
> ------------------------------------------
> New Year Resolution: Ignore top posted posts

Hi Jason:
Thanks for the reply.

I added some of the reset in just to make sure the pointer isn't somewhere
else through earlier iterations/to make sure it doesn't make a difference.
Will play around with the foreach as soon as I have some time. Reading
through php.net it seems like there are a few pitfalls (as there can be with
while) to watch out for.

Found out what the problem was after I posted. Reading through the function
manual for each I found the following:
<snip>
 Caution
Because assigning an array to another variable resets the original arrays
pointer, our example above would cause an endless loop had we assigned
$fruit to another variable inside the loop.

</snip>

That's what I did. Didn't had to but it has been a copy and paste from some
other code I haven't cleaned up. Good thing on it is, that I now know that I
can't do this.

Thanks again!

Gunter

attached mail follows:


Hi,
  I have an html file containing a table. I applied
  eregi("<TR>.*</TR>",$contents,$temp) through my Php.I am getting
  the output like this-
               <td>A</td><td>B</td></tr>
               <tr><td>C</td><td>D</td></tr>
               <tr><td>E</td><td>F</td>
But my expected output is -
             <td>A</td><td>B</td>
             <td>C</td><td>D</td>
             <td>E</td><td>F</td>
 The code removing only the first and last <(/)tr>.
How to do it using eregi ? (or using any other regular expression function. I don't want to use any string replace function.)

Binav

 

 
______________ ______________ ______________ ______________
Sent via the WebMail system at softwareassociates.co.uk

 
                   
---
Scanned by MessageExchange.net (10:05:41 SPITFIRE)

attached mail follows:


Binoy AV a écrit :
> Hi,
> I have an html file containing a table. I applied
> eregi("<TR>.*</TR>",$contents,$temp) through my Php.I am getting
> (...)
> The code removing only the first and last <(/)tr>.

Expected behaviour : regex are 'greedy', ie
the .* matches the longuest string possible

> How to do it using eregi ?

Use preg_* functions (Perl regex are more powerfull and faster)

ex (not tested)
$temp = preg_replace('/<tr>(.*?)<\\/tr>/', '$1', $content);

PS the '?' in '.*?' means previous modifier (*) is not greedy
    (Perl re syntax, man perlre)

attached mail follows:


> [snip]
> I meet a problem when I want to deleting a multiple
> row, I have a table that contain columns UserID,
> name,
> company name, and bill. UserID is uniq.
> perhaps, some of UserID, say it five UserID I have
> to
> delete, how to delete all raw that contain that
> UserID
> ? and if I want to update bill of a users (multiple
> user) that data of users taking from a file ( so the
> file contain user UserId and bill), how to make it ?

I', sorry if my previous email not that clear, I'm
making a simple web-base inventory using PHP, and I
don't know how to using a web form to :
1. delete multiple raw by input an uniqID (in this
case UserID, say there was five users)
2. after deleting it, there will be say six users need
to add.
3. and I make delete or add by uploading file that
contain data I need ?

And all I hope can do by a web-base application using
PHP

sorry If I can't make it clear in my previos posting

Aji

                
__________________________________
Do you Yahoo!?
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com

attached mail follows:


Hi,

I have an array, for ex: $products=array(1, 2, 5 , 7)

I want to select all products from the database that has the ids of products.
I use this but doesn't work:

$sql = '';
foreach($products AS $products_id){
if(strlen($sql)){ $sql .= ' OR '; }
$sql .= "product_id = '$products_id'";
}
      
$sql2 = "SELECT product_name FROM accessories WHERE " .$sql;

Please help me !!!!

Thanks

attached mail follows:


Hello Phpu,

Thursday, January 6, 2005, 10:42:15 AM, you wrote:

P> I have an array, for ex: $products=array(1, 2, 5 , 7)
P> I want to select all products from the database that has the ids of products.
P> I use this but doesn't work:

$product_ids = implode(',', $products);
$sql = "SELECT product_name FROM accessories WHERE product_id IN ($product_ids)";

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

attached mail follows:


Hello:

I'm new (very new) to php.

I'm making a simple srcipt wich sends and email from a form.

My problem is tha special characters like ç,á,à,é, etc don't work.

Can anyone help me?

Thanks

attached mail follows:


Hello Can you show me the script?
Please look first at mail functions on php.net/mail to see how to use
headers (and encodings too)

Best Regards
Bogomil Shopov
http://purplerain.org

Hugo Tavares wrote:
> Hello:
>
> I'm new (very new) to php.
>
> I'm making a simple srcipt wich sends and email from a form.
>
> My problem is tha special characters like ç,á,à,é, etc don't work.
>
> Can anyone help me?
>
> Thanks

attached mail follows:


Here it is:

 $headers = "From: $name <$email>\r\n";
 $headers .= "Reply-to: $email\r\n";
 $headers .= "Return-Path: $email\r\n";
 $headers .= "MIME-Version: 1.0\r\n";
 $headers .= "Content-Type: multipart/alternative; charset=\"iso-8859-1\";
boundary=\"$mime_boundary\";\r\n\r\n";
 $headers .= "This is a multi-part message in MIME format.\r\n\r\n";
 $msg .= "--$mime_boundary\r\n";
 $msg .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; // deleted
boundary
 $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
 $msg .= $text_version."\r\n\r\n";
 $msg .= "--$mime_boundary\r\n";
 $msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
 $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
 $msg .= $message."\r\n\r\n";
 $msg .= "--$mime_boundary--\r\n\r\n\r\n";
 mail($recipient, $subject, $msg, $headers);

Thanks for the help!

"Bogomil Shopov" <bogomilspisanie.com> wrote in message
news:20050106120201.20975.qmailpb1.pair.com...
> Hello Can you show me the script?
> Please look first at mail functions on php.net/mail to see how to use
> headers (and encodings too)
>
> Best Regards
> Bogomil Shopov
> http://purplerain.org
>
> Hugo Tavares wrote:
>> Hello:
>>
>> I'm new (very new) to php.
>>
>> I'm making a simple srcipt wich sends and email from a form.
>>
>> My problem is tha special characters like ç,á,à,é, etc don't work.
>>
>> Can anyone help me?
>>
>> Thanks

attached mail follows:


Hi!

Last help about regexp solve my problem, but I have another one.

I've made some regexp but it does not work always

Let say I have some strings

1) this is some domain.com test
2) domain.com

I can make this work either for first example of fo second, but not for
both. What I want is replace of domain.com to get

this is dome domain.com domain com test so replace should be
\1 \2 \3

so for second example I did /((.+)\.{1}(.+))/

How can I extend this to work in both.

regards

Uros

attached mail follows:


You could maybe cheat and add an X at the beginning and end of the string
before your Regex, then you will have:

X\1 \2 \3X

and you can strip off the initial X from \1 and the trailing X from \3

There's probably some fancy Regexp way to do it though.

Uroš Gruber wrote:
> Hi!
>
> Last help about regexp solve my problem, but I have another one.
>
> I've made some regexp but it does not work always
>
> Let say I have some strings
>
> 1) this is some domain.com test
> 2) domain.com
>
> I can make this work either for first example of fo second, but not for
> both. What I want is replace of domain.com to get
>
> this is dome domain.com domain com test so replace should be
> \1 \2 \3
>
> so for second example I did /((.+)\.{1}(.+))/
>
> How can I extend this to work in both.
>
> regards
>
> Uros
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


My experience dictates the contrary.

Apache 2 is much faster with PHP that Apache 1.3. I run an enterprise
web application in my company with about 950 users concurrently. I
configured the apache logs to add the execution time for each request
(this is done with %T in the LogFormat). We started the production
system around 2 years ago with RH9 and Apache 1.3. Only 72% of the
requests scored 0 seconds (which means less than 1 second). Then I
updated to Fedora Core 2 with Apache 2 and it scored 96%.

I know the kernel is a lot better but this improvement is almost because
of Apache 2 since I tested Apache 1.3 in the same system and I got back
to the 72% performance.

I guess this dependes of what you use. Because PHP has an Apache filter
and an Apache handler. I use the later.

-William

El mié, 05-01-2005 a las 14:20 +0000, Matthew Weier O'Phinney escribió:
> * Sebastian <sebastianbroadbandgaming.net>:
> > I am undecided whether to upgrade to apache 2 (currently running 1.3.33)
> > I've heard some bad stuff (some good maybe) about using apache 2 with php..
> > does anyone have an opinions?
> >
> > I know everything has cons/pros but i am just looking for advice on whether
> > my site will benifit from the upgrade. I'm curious to know if a site that
> > normally sees 300-500 users online would see any improvements.
> >
> > any on going issues? is php faster/slower? downsides? advantages? anything
> > in general that can help me decide.
>
> This study might help you make up your mind:
>
> http://ilia.ws/archives/32-Apache-1-vs-Apache-2-Performance.html
>
> In summary: apache2 is faster for static content, but slower at serving
> PHP; additionally, if using the prefork version of apache2 (which you
> need to do to keep PHP stable), much of your performance boost for
> static content will be lost. Your best bet: stick with apache1 if using
> PHP heavily.
>
> --
> Matthew Weier O'Phinney | mailto:matthewgarden.org
> Webmaster and IT Specialist | http://www.garden.org
> National Gardening Association | http://www.kidsgardening.com
> 802-863-5251 x156 | http://nationalgardenmonth.org
>

attached mail follows:


Rasmus,

I see much better performance with Apache 2. I'm not an expert in the
internals of Apache nor PHP but I guess one of the improvements in
apache is the log mechanism, I think it use a different technique that
makes it faster that Apache 1.3

The reason I say this is because Apache 1.3 log are written in perfect
order according to the time field. I Apache 2 the logs are not ordered
so you can have something like this:

172.20.15.138 - - [06/Jan/2005:09:43:55 -0500]
192.168.149.42 - - [06/Jan/2005:09:43:55 -0500]
192.168.150.27 - - [06/Jan/2005:09:43:55 -0500]
172.16.113.22 - - [06/Jan/2005:09:43:53 -0500]
192.1.20.197 - - [06/Jan/2005:09:43:54 -0500]
192.168.172.20 - - [06/Jan/2005:09:43:55 -0500]
192.168.150.66 - - [06/Jan/2005:09:43:55 -0500]

This is extracted from my production server with FC3 Apache 2.0.52 and
PHP 4.3.9

-William

El mié, 05-01-2005 a las 04:58 -0800, Rasmus Lerdorf escribió:
> Lester Caine wrote:
> > Sebastian wrote:
> >> I know everything has cons/pros but i am just looking for advice on
> >> whether
> >> my site will benifit from the upgrade. I'm curious to know if a site that
> >> normally sees 300-500 users online would see any improvements.
> >
> > That would be nice information to find out, but does not seem to be
> > available.
>
> If you are serving up a lot of static file, you will see an improvement.
> If it is all dynamic PHP requests, then you won't. Apache really
> doesn't have much to do on a PHP request so all the performance depends
> on the speed of PHP, not Apache. There are a few places where Apache2
> has improved things for a PHP request, but these tend to be countered by
> a few places where things have gotten ore expensive. Every benchmark I
> have done puts PHP under Apache2 right in the same ballpark as PHP under
> Apache1 with Apache1 usually a little bit ahead. But do your own
> testing on your own platform. Other peoples' benchmarks are meaningless.
>
> -Rasmus
>

attached mail follows:


Hi Rasmus,

El lun, 03-01-2005 a las 14:13 -0500, Rasmus Lerdorf escribió:
> If you need to do something fancier you can stick things in shared
> memory. Many of the accelerators give you access to their shared memory
> segments. For example, the CVS version of pecl/apc provides apc_store()
> and apc_fetch() which lets you store PHP datatypes in shared memory
> directly without needing to serialize/unserialize them.

This is great. In my high performance web app I created a PHP library
that abstracted this to use several backends. For instance I have a
File backend and a SHM backend that uses the functions provided by the
sysvshm PHP module. With this functions, do they need to
serialize/unserialize every time I put/get something in/from the cache??

Also I use sysvsem for locking capabilities. does apc take care of the
locking? does it have an API to do that?

My experience with shared memory have been great. My production server
uses a segment of 384MB to cache lots of resultsets and PHP objects and
the performance is almost unbeatable... well if it serializes then
pecl/apc will give better performance I guess.

-William

attached mail follows:


> Anything you do in the MINIT hook is basically free, so it would be
> trivial to load the data for the array from somewhere. Like a database,
> an xml file, etc. So you wouldn't need to hardcode a complex array
> structure in your MINIT hook, just have this generic little extension
> that creates an array (or object) from some external source. To change
> the data you would change that external source and restart your server,
> or you could write a PHP function in your extension that forced a reload
> with the caveat that each running httpd process would need to have that
> function be called since your array/object lives in each process separately.
>
> If you ask really nicely one of the folks on the pecl-dev list might
> just write this thing for you. Especially if you spec it out nicely and
> think through how it should work.
>
> -Rasmus

Call me crazy or ignorant, i'm both, but would it be possible to build
an extension that, in its MINIT hook as you suggest, actually runs a
separate PHP script that contains global definitions, then makes those
definitions available to later scripts? this is basically my original
desire of having a one-time, persistent global include for each apache
process. i realize you suggest pulling array data from a source like a
DB or XML file, which would be a 90% solution for me, but the next step
(a PHP script) just seemed logical/exciting...

i realize i'm reaching with this, and it implies a conundrum (how does
an extension run a PHP script if PHP hasn't fully started yet) but this
kind of thing is just what makes me go and learn new things (C, php/zend
internals) and I just might try to do it if it was feasible, for the fun
of it, because it could be useful to lots of people, even if it took me
a year or two to pull off.

alas, this is a question for the pecl-dev list.

(the mental gears are churning...)

/jw

attached mail follows:


Rasmus,

El jue, 06-01-2005 a las 08:23 -0800, Rasmus Lerdorf escribió:
> On Thu, 6 Jan 2005, William Lovaton wrote:
> > This is great. In my high performance web app I created a PHP library
> > that abstracted this to use several backends. For instance I have a
> > File backend and a SHM backend that uses the functions provided by the
> > sysvshm PHP module. With this functions, do they need to
> > serialize/unserialize every time I put/get something in/from the cache??
>
> If you are doing this in user-space PHP, then yes, you will have to
> serialize.

>From my PHP library I use shm_put_var() and shm_get_var(). If
serialization is done this way then it is implicit... right?

-William

attached mail follows:


On Thu, 6 Jan 2005, William Lovaton wrote:

> Hi Rasmus,
>
> El lun, 03-01-2005 a las 14:13 -0500, Rasmus Lerdorf escribió:
> > If you need to do something fancier you can stick things in shared
> > memory. Many of the accelerators give you access to their shared memory
> > segments. For example, the CVS version of pecl/apc provides apc_store()
> > and apc_fetch() which lets you store PHP datatypes in shared memory
> > directly without needing to serialize/unserialize them.
>
> This is great. In my high performance web app I created a PHP library
> that abstracted this to use several backends. For instance I have a
> File backend and a SHM backend that uses the functions provided by the
> sysvshm PHP module. With this functions, do they need to
> serialize/unserialize every time I put/get something in/from the cache??

If you are doing this in user-space PHP, then yes, you will have to
serialize.

> Also I use sysvsem for locking capabilities. does apc take care of the
> locking? does it have an API to do that?

APC takes care of locking and all cache management.

> My experience with shared memory have been great. My production server
> uses a segment of 384MB to cache lots of resultsets and PHP objects and
> the performance is almost unbeatable... well if it serializes then
> pecl/apc will give better performance I guess.

It should, yes. Try it.

-Rasmus

attached mail follows:


Additionally you can check the access time to see which of those
sessions has been accessed in the last, let's say, 10 minutes or
something.

But there are several problems with this. Relying on session files is
not good enough, they might be stored in a database or in shared memory.
Other problem is that those sessions are for every PHP app installed in
the server so you are counting sessions for different apps like it were
from yours.

To solve this you could put some APPID in the session and check for its
value reading the sess file as text. Obviously you will have to figure
out the format a little bit.

-William

El lun, 03-01-2005 a las 08:25 -0700, Rob Adams escribió:
> "HarryG" <harry1980gmail.com> wrote in message
> news:20050103120421.74985.qmailpb1.pair.com...
> > Is there an easier way to count the total number of sessions running on a
> > PHP webserver? something like session_count();
>
> If you're using file based sessions, you could count the number of files in
> the directory where the sessions get saved. If there are files in there
> other than just session files, you'll have to look for just the session
> files. On all my systems, they've started with "sess."
>
> -- Rob
>

attached mail follows:


Hello

I am trying to use the OpenSSL module for PHP on a FreeBSD 4.10 server.
I have CVS'd everything, so I have the most current version of the
FreeBSD port.

I have attached the PHP file that I'm running. Here's the error message
I get:

openssl_csr_sign(): cannot get cert from parameter 2

The file that is being referenced is a valid certificate, encoded in
base-64 format and the path is correct, and OpenSSL is able to sign
using this certificate and the corresponding key if I run it directly
from the command line. I have also attached the certificate. What am I
missing?

Tim Gustafson
MEI Technology Consulting, Inc
tjgmeitech.com
(516) 379-0001 Office
(516) 480-1870 Mobile/Emergencies
(516) 908-4185 Fax
http://www.meitech.com/

attached mail follows:


Gustafson, Tim wrote:
> I am trying to use the OpenSSL module for PHP on a FreeBSD 4.10 server.
> I have CVS'd everything, so I have the most current version of the
> FreeBSD port.
>
> I have attached the PHP file that I'm running. Here's the error message
> I get:
>
> openssl_csr_sign(): cannot get cert from parameter 2
>
> The file that is being referenced is a valid certificate, encoded in
> base-64 format and the path is correct, and OpenSSL is able to sign
> using this certificate and the corresponding key if I run it directly
> from the command line. I have also attached the certificate. What am I
> missing?

You are missing error checking on the openssl_pkey_new() and
openssl_csr_new() function calls.

You don't even know for sure that you have a valid PKEY nor that you have
a valid CSR resource.

And, of course, you should have some error-checking on the return value
from openssl_csr_sign() to see if it worked.

Odds are really good that if you add all that error-checking, and the code
needed to find out what error occurred --
http://php.net/openssl_error_string -- you'll find out that the OpenSSL
software and PHP have conpsired to tell you *exactly* what is going wrong.
:-)

My first Wild Guess would be that your PHP user doesn't have permission to
read your .crt and .key files, or that you don't have a PHP-readable valid
openssl.cnf file.

If all else fails, despite the examples in the manual, you may want to try
to get rid of the 'file://' parts of your file names. But maybe you need
those for some arcane OpenSSL reason beyond my ken. [shrug]

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Richard,

Actually, if you leave the code exactly as-is, but change the
openssl_csr_sign function to create a self-signed certificate, the
entire script executes perfectly. I know there is a lot of error
checking needed - I'm just making a "test" script to get a feel for how
OpenSSL operates in PHP. The certificate and key files are mode 444
(readable by everyone) as they are just "test" certificates right now.
I have a valid openssl.cnf file (in /etc/ssl/openssl.cnf, which is
what's complied into OpenSSL) and I use that configuration file that I
use with some shell scripts to do everything that I want to do in PHP,
so I'm sure it's a valid openssl.cnf file.

Does PHP restrict access to /etc/ssl for the OpenSSL library if I have
open_basedir set? Perhaps I need to make an openssl.cnf in the
/usr/home/ws1086 (which is the open_basedir path) so that it's readable?
I would think that the library would have access to the whole system
since it's not really part of PHP, but maybe I'm wrong.

Either way, it's not complaining about access to openssl.cnf, it's
complaining about access to the certificate, so let's take it one step
at a time. :)

Tim Gustafson
MEI Technology Consulting, Inc
tjgmeitech.com
(516) 379-0001 Office
(516) 480-1870 Mobile/Emergencies
(516) 908-4185 Fax
http://www.meitech.com/

-----Original Message-----
From: Richard Lynch [mailto:ceol-i-e.com]
Sent: Thursday, January 06, 2005 11:24 AM
To: Gustafson, Tim
Cc: php-generallists.php.net
Subject: Re: [PHP] OpenSSL Problem

Gustafson, Tim wrote:
> I am trying to use the OpenSSL module for PHP on a FreeBSD 4.10
server.
> I have CVS'd everything, so I have the most current version of the
> FreeBSD port.
>
> I have attached the PHP file that I'm running. Here's the error
message
> I get:
>
> openssl_csr_sign(): cannot get cert from parameter 2
>
> The file that is being referenced is a valid certificate, encoded in
> base-64 format and the path is correct, and OpenSSL is able to sign
> using this certificate and the corresponding key if I run it directly
> from the command line. I have also attached the certificate. What am
I
> missing?

You are missing error checking on the openssl_pkey_new() and
openssl_csr_new() function calls.

You don't even know for sure that you have a valid PKEY nor that you
have
a valid CSR resource.

And, of course, you should have some error-checking on the return value
from openssl_csr_sign() to see if it worked.

Odds are really good that if you add all that error-checking, and the
code
needed to find out what error occurred --
http://php.net/openssl_error_string -- you'll find out that the OpenSSL
software and PHP have conpsired to tell you *exactly* what is going
wrong.
:-)

My first Wild Guess would be that your PHP user doesn't have permission
to
read your .crt and .key files, or that you don't have a PHP-readable
valid
openssl.cnf file.

If all else fails, despite the examples in the manual, you may want to
try
to get rid of the 'file://' parts of your file names. But maybe you
need
those for some arcane OpenSSL reason beyond my ken. [shrug]

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


I figured it out!

I had to change the key references to something like this:

file://../falconsoft.com.crt

Using an absolute path seems to break it. :\

Tim Gustafson
MEI Technology Consulting, Inc
tjgmeitech.com
(516) 379-0001 Office
(516) 480-1870 Mobile/Emergencies
(516) 908-4185 Fax
http://www.meitech.com/

-----Original Message-----
From: Gustafson, Tim
Sent: Thursday, January 06, 2005 10:45 AM
To: php-generallists.php.net
Subject: [PHP] OpenSSL Problem

Hello

I am trying to use the OpenSSL module for PHP on a FreeBSD 4.10 server.
I have CVS'd everything, so I have the most current version of the
FreeBSD port.

I have attached the PHP file that I'm running. Here's the error message
I get:

openssl_csr_sign(): cannot get cert from parameter 2

The file that is being referenced is a valid certificate, encoded in
base-64 format and the path is correct, and OpenSSL is able to sign
using this certificate and the corresponding key if I run it directly
from the command line. I have also attached the certificate. What am I
missing?

Tim Gustafson
MEI Technology Consulting, Inc
tjgmeitech.com
(516) 379-0001 Office
(516) 480-1870 Mobile/Emergencies
(516) 908-4185 Fax
http://www.meitech.com/

attached mail follows:


We know that. We understood all of that.

What we need to know is:

1)Are php core function thread safe?

2)Does php have internal mechanisms in php for protecting thread safety
(memory leak, threads overwriting memory in use by another thread, blah,
blah)?

3)Are the function in this LIMITED LIST thread safe? (This is THE LIMITED
LIST extracted from the list of the functions in section VI, the one you
requested, the one R.Lynch requested). Since we sent the list with the
functions we need already 2 times, would you please be so gentle as to
answer now?

Apache-specific Functions
Array Functions
Calendar Functions
Class/Object Functions
CURL, Client URL Library Functions
Cyrus IMAP administration Functions
Date and Time Functions
Direct IO Functions
Directory Functions
DOM Functions
DOM XML Functions
Error Handling and Logging Functions
File Alteration Monitor Functions
Filesystem Functions
Forms Data Format Functions
FTP Functions
Function Handling Functions
Gettext
GMP Functions
HTTP Functions
Image Functions
IMAP, POP3 and NNTP Functions
PHP / Java Integration
LDAP Functions
Mail Functions
Mathematical Functions
Multibyte String Functions
Mimetype Functions
Miscellaneous Functions
MySQL Functions
Improved MySQL Extension
Network Functions
Unified ODBC Functions
Object Aggregation/Composition Functions
Object property and method call overloading
OpenSSL Functions
Output Control Functions
PDF functions
PHP Options&Information
PostgreSQL Functions
Program Execution Functions
Session Handling Functions
Shared Memory Functions
SimpleXML functions
SQLite
Shockwave Flash Functions
Standard PHP Library (SPL) Functions
String Functions
URL Functions
Variable Functions
vpopmail Functions
XML Parser Functions
XML-RPC Functions
XSL functions
XSLT Functions

--
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

attached mail follows:


On Thu, 06 Jan 2005 16:15:43 +0000, symbulos partners
<partnerssymbulos.com> wrote:
> We know that. We understood all of that.
>
> What we need to know is:

Please, do not assimilate me.

--
Greg Donald
Zend Certified Engineer
http://destiney.com/

attached mail follows:


Symbulos Partners wrote:
> We know that. We understood all of that.
>

Let me ask you this. Do you know what underlying libraries are
associated with the extensions you want to use (in your list below)? If
you do then you *should* be able to google for each library individually
and see if that library is thread safe. I have not gone through this
exercise for myself, but then again I don't need to either. ;) This
would also be something that would be a great benefit to share with the
PHP community if you decide to compile this list of thread-safe extensions.

> What we need to know is:
>
> 1)Are php core function thread safe?
>

I have read somewhere that this is true, but I have absolutely no
firsthand experience in PHP's source to tell you if this is the case.
Rasmus will know (whistling and walking away...)

> 2)Does php have internal mechanisms in php for protecting thread safety
> (memory leak, threads overwriting memory in use by another thread, blah,
> blah)?

Yes it does... IIRC check out TSRM in the source.

>
> 3)Are the function in this LIMITED LIST thread safe? (This is THE LIMITED
> LIST extracted from the list of the functions in section VI, the one you
> requested, the one R.Lynch requested). Since we sent the list with the
> functions we need already 2 times, would you please be so gentle as to
> answer now?
>

I have no idea. ;) But I use a lot of these functions as well and it
would be good to know.

> Apache-specific Functions
> Array Functions
> Calendar Functions
> Class/Object Functions
> CURL, Client URL Library Functions
> Cyrus IMAP administration Functions
> Date and Time Functions
> Direct IO Functions
> Directory Functions
> DOM Functions
> DOM XML Functions

To anyone reading this, remember he's using PHP 4.3.x but he's asking
about PHP 5.x. So I guess the question there: is libxml2 thread-safe?

> Error Handling and Logging Functions
> File Alteration Monitor Functions
> Filesystem Functions
> Forms Data Format Functions
> FTP Functions
> Function Handling Functions
> Gettext
> GMP Functions
> HTTP Functions
> Image Functions
> IMAP, POP3 and NNTP Functions
> PHP / Java Integration
> LDAP Functions
> Mail Functions
> Mathematical Functions
> Multibyte String Functions
> Mimetype Functions
> Miscellaneous Functions
> MySQL Functions
> Improved MySQL Extension
> Network Functions
> Unified ODBC Functions
> Object Aggregation/Composition Functions
> Object property and method call overloading
> OpenSSL Functions
> Output Control Functions
> PDF functions
> PHP Options&Information
> PostgreSQL Functions
> Program Execution Functions
> Session Handling Functions
> Shared Memory Functions

Good lord I would hope so :)

> SimpleXML functions
> SQLite
> Shockwave Flash Functions
> Standard PHP Library (SPL) Functions
> String Functions
> URL Functions
> Variable Functions
> vpopmail Functions
> XML Parser Functions
> XML-RPC Functions
> XSL functions
> XSLT Functions
>

All of the XSL stuff should fall under the umbrella of "is libxml2
thread safe?" since we use that library for XSL functionality too.

One final note. I notice that you make of the PHP4 XML libraries?
Well, there was a break in this functionality in PHP5. If you used the
"almost W3C compliant" domxml functions then you should be ok. If not,
well, you might be in for some rewriting there. :(

http://php.net/manual/en/ref.dom.php

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2




  • application/x-pkcs7-signature attachment: smime.p7s

  • application/x-pkcs7-signature attachment: smime.p7s

  • application/x-pkcs7-signature attachment: smime.p7s