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 20 Sep 2006 19:17:19 -0000 Issue 4358

php-general-digest-helplists.php.net
Date: Wed Sep 20 2006 - 14:17:19 CDT


php-general Digest 20 Sep 2006 19:17:19 -0000 Issue 4358

Topics (messages 241965 through 241985):

Re: Resource problem affecting Curl functions
        241965 by: Børge Holen
        241976 by: Mark Krenz

Re: preg_replace (again) [solved]
        241966 by: Robert Cummings
        241967 by: Peter Lauri
        241968 by: Andrei

php4.3.4 phpinfo shows in mysql section as "Client API version 3.23.49"
        241969 by: Muthu
        241970 by: Michal Stankoviansky
        241971 by: Muthu

xsl + xml
        241972 by: José Manuel Peso Echarri
        241975 by: Colin Guthrie

Is there a list of all Timezones as an array or someting?
        241973 by: Mathijs van Veluw
        241977 by: Chris Boget

Hylafax: nweb2fax
        241974 by: Man-wai Chang

Most stable combination of AMP?
        241978 by: James Tu
        241979 by: Kae Verens
        241980 by: Kae Verens
        241981 by: Pawel Miroslawski
        241984 by: James Tu
        241985 by: Børge Holen

Re: reading a PDF's title
        241982 by: Shu Hung (Koala)

Re: preg_replace (again)
        241983 by: Pawel Miroslawski

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 Wednesday 20 September 2006 08:34, Google Kreme wrote:
> On 19 Sep 2006, at 12:12 , Mark Krenz wrote:
> > I run a shared webserver with a few hundred vhost containers in
> > Apache's config.
>
> Are these vhosts all contained in httpd.conf, or are they separate
> files?

Depends on your configurations.

>
> Does it make a difference?

I think its easier to keep them in a separate catalog.

>
> --
> ...when you're no longer searching for beauty or love, just some kind
> of life with the edges taken off. When you can't even define what it
> is that you're frightened of; this song will be here.

--
---
Børge
Kennel Arivene
http://www.arivene.net
---

attached mail follows:


  I doubt this makes a difference, but its all in one vhost.conf file.
The httpd.conf file includes that file.

  So does anyone have any ideas about my problem with curl functions?

On Wed, Sep 20, 2006 at 06:34:32AM GMT, Google Kreme [gkremegmail.com] said the following:
> On 19 Sep 2006, at 12:12 , Mark Krenz wrote:
> > I run a shared webserver with a few hundred vhost containers in
> >Apache's config.
>
> Are these vhosts all contained in httpd.conf, or are they separate
> files?
>
> Does it make a difference?
>
> --
> ...when you're no longer searching for beauty or love, just some kind
> of life with the edges taken off. When you can't even define what it
> is that you're frightened of; this song will be here.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
Mark S. Krenz
IT Director
Suso Technology Services, Inc.
http://suso.org/

attached mail follows:


On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote:
> Just to share my solution:

Out of curiosity, why don't you go with the very well known BBCode
system?

> preg_replace('/_color:(.*?)_(.*?)_color_/i', '<font color="$1">$2</font>',
> $html);

Hopefully this is a private system, otherwise someone not very nice
might do the following:

----
This is some _color:pink"> <script type="text/javascript"
language="javascript">
document.location = 'http://www.myDoityPr0nCollection.com';
</script><font color="pink_ colored text _color_ that I want to transfer
----

You need better content sanitization ]:B

FWIW, the <font> tag is about as deprecated as deprecated can get. You
might consider switching to <span>.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


Hi,

Thanks for you comment. I already changed to <span>.

About sanitation: Do you know any open source where it checks code if it is
acceptable or not? Or should I just create a lib that do some preg_match to
see if any javascript tag is inside (assuming javascript should not be
allowed).

This is a private system, so I do not worry so much :)

/Peter

-----Original Message-----
From: Robert Cummings [mailto:robertinterjinn.com]
Sent: Wednesday, September 20, 2006 2:13 PM
To: Peter Lauri
Cc: 'PHP General'
Subject: RE: [PHP] preg_replace (again) [solved]

On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote:
> Just to share my solution:

Out of curiosity, why don't you go with the very well known BBCode
system?

> preg_replace('/_color:(.*?)_(.*?)_color_/i', '<font color="$1">$2</font>',
> $html);

Hopefully this is a private system, otherwise someone not very nice
might do the following:

----
This is some _color:pink"> <script type="text/javascript"
language="javascript">
document.location = 'http://www.myDoityPr0nCollection.com';
</script><font color="pink_ colored text _color_ that I want to transfer
----

You need better content sanitization ]:B

FWIW, the <font> tag is about as deprecated as deprecated can get. You
might consider switching to <span>.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


Well you can use
string strip_tags ( string str [, string allowable_tags] )
function

Andy

Peter Lauri wrote:
> Hi,
>
> Thanks for you comment. I already changed to <span>.
>
> About sanitation: Do you know any open source where it checks code if it is
> acceptable or not? Or should I just create a lib that do some preg_match to
> see if any javascript tag is inside (assuming javascript should not be
> allowed).
>
> This is a private system, so I do not worry so much :)
>
> /Peter
>
> -----Original Message-----
> From: Robert Cummings [mailto:robertinterjinn.com]
> Sent: Wednesday, September 20, 2006 2:13 PM
> To: Peter Lauri
> Cc: 'PHP General'
> Subject: RE: [PHP] preg_replace (again) [solved]
>
> On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote:
>> Just to share my solution:
>
> Out of curiosity, why don't you go with the very well known BBCode
> system?
>
>> preg_replace('/_color:(.*?)_(.*?)_color_/i', '<font color="$1">$2</font>',
>> $html);
>
> Hopefully this is a private system, otherwise someone not very nice
> might do the following:
>
> ----
> This is some _color:pink"> <script type="text/javascript"
> language="javascript">
> document.location = 'http://www.myDoityPr0nCollection.com';
> </script><font color="pink_ colored text _color_ that I want to transfer
> ----
>
> You need better content sanitization ]:B
>
> FWIW, the <font> tag is about as deprecated as deprecated can get. You
> might consider switching to <span>.
>
> Cheers,
> Rob.

attached mail follows:


Hi,
    
      I am using apache2.0+php4.3.4+mysql 4.1.1 in windows. If I type phpinfo(); , in mysql section it is coming as "Client API version 3.23.49" . To get the latest mysql client library for php4.3.4, what should I do?. If I need to get the php_mysql.dll for php4.3.4, Where can I get these dlls?

Thanks,
Muthu.

attached mail follows:


Hi

get it here:
http://dev.mysql.com/downloads/connector/php/

Michal

Muthu wrote:
> Hi,
>
> I am using apache2.0+php4.3.4+mysql 4.1.1 in windows. If I type phpinfo(); , in mysql section it is coming as "Client API version 3.23.49" . To get the latest mysql client library for php4.3.4, what should I do?. If I need to get the php_mysql.dll for php4.3.4, Where can I get these dlls?
>
> Thanks,
> Muthu.
>
>

attached mail follows:


> Hi
>
> get it here:
> http://dev.mysql.com/downloads/connector/php/
>
> Michal
>
> Muthu wrote:
>> Hi,
>> I am using apache2.0+php4.3.4+mysql 4.1.1 in windows. If I
>> type phpinfo(); , in mysql section it is coming as "Client API
>> version 3.23.49" . To get the latest mysql client library for
>> php4.3.4, what should I do?. If I need to get the php_mysql.dll for
>> php4.3.4, Where can I get these dlls?
>> Thanks,
>> Muthu.
>>
>>
>
Thank you for your quick reply. I could get only mysql connector for PHP
5.1.6. I need mysql connector for php4.3.4. Is there any other place to
get?.

Thanks,
Muthu.

attached mail follows:


Hi people,

I am looking for a library that mix xsl and xml producing output in
xhtml at server side.
I have readed about sablotron and libxsl, but i am confused.

Which is the best alternative in perfomance terms for the versions 4.2,
4.3?
is there some way for preprocess xsl or let ir in memory or any way for
improve the resources usage?

Thanks

Regards,
Jose

attached mail follows:


José Manuel Peso Echarri wrote:
> Hi people,
>
> I am looking for a library that mix xsl and xml producing output in
> xhtml at server side.
> I have readed about sablotron and libxsl, but i am confused.
>
> Which is the best alternative in perfomance terms for the versions 4.2,
> 4.3?
> is there some way for preprocess xsl or let ir in memory or any way for
> improve the resources usage?

Dunno about v4, but for v5 at least:

$xsl = DOMDocument::loadXML($xslt_as_a_string);
$xsltproc = new XSLTProcessor;
$xsltproc->importStyleSheet($xsl);
echo $xsltproc->transformToXML($my_xml_dom_doc);

Or something like that..... going form memory, so there may be more
appropriate commands etc.

Col.

attached mail follows:


Hello there,

I need to have a selectbox filled with the available timezones of PHP.
We are using v5.1.x, and it supports the date_default_timezone_set() etc..
As value you can give a string to what timezone.
I want all these strings within an array or something so i can create a selectbox so users can select it.

Thx in advance.

attached mail follows:


> I need to have a selectbox filled with the available timezones of PHP.
> We are using v5.1.x, and it supports the date_default_timezone_set() etc..
> As value you can give a string to what timezone.
> I want all these strings within an array or something so i can create a
> selectbox so users can select it.
> Thx in advance.

Here's the array we've been using:

      $timeZonesArray = array( 'GMT' => array( 'GMT' => +0
// GMT
                                                          ),
                               'North America' => array( 'NST' => -3.5,
// Newfoundland Standard Time
                                                          'NDT' => -2.5,
// Newfoundland Daylight Time
                                                          'AST' => -4,
// Atlantic Standard Time
                                                          'ADT' => -3,
// Atlantic Daylight Time
                                                          'EST' => -5,
// Eastern Standard Time
                                                          'EDT' => -4,
// Eastern Daylight Time
                                                          'CST' => -6,
// Central Standard Time
                                                          'CDT' => -5,
// Central Daylight Time
                                                          'MST' => -7,
// Central Daylight Time
                                                          'MDT' => -6,
// Mountain Daylight Time
                                                          'PST' => -8,
// Pacific Standard Time
                                                          'PDT' => -7,
// Pacific Daylight Time
                                                          'AKST' => -9,
// Alaska Standard Time
                                                          'AKDT' => -8,
// Alaska Daylight Time
                                                          'HAST' => -10,
// Hawaii-Aleutian Standard Time
                                                          'HADT' => -9
// Hawaii-Aleutian Daylight Time
                                                          ),
                               'Australia' => array( 'NFT' => +11.5,
// Norfolk (Island) Time
                                                          'EST' => +10,
// Eastern Standard Time
                                                          'EDT' => +11,
// Eastern Daylight Time
                                                          'CST' => +9.5,
// Central Standard Time
                                                          'CDT' => +10.5,
// Central Daylight Time
                                                          'WST' => +8,
// Western Standard Time
                                                          'CXT' => +7,
// Christmas Island Time
                                                          ),
                               'Europe' => array( 'GMT' => +0,
// Greenwich Mean Time
                                                          'BST' => +1,
// British Summer Time
                                                          'IST' => +1,
// Irish Summer Time
                                                          'WET' => +0,
// Western European Time
                                                          'WEST' => +1,
// Western European Summer Time
                                                          'CET' => +1,
// Central European Time
                                                          'CEST' => +2,
// Central European Summer Time
                                                          'EET' => +2,
// Eastern European Time
                                                          'EEST' => +3
// Eastern European Summer Time
                                                          ),
                               'Military' => array( 'Z' => +0,
// Zulu Time Zone
                                                          'Y' => -12,
// Yankee Time Zone
                                                          'X' => -11,
// X-ray Time Zone
                                                          'W' => -10,
// Whiskey Time Zone
                                                          'V' => -9,
// Victor Time Zone
                                                          'U' => -8,
// Uniform Time Zone
                                                          'T' => -7,
// Tango Time Zone
                                                          'S' => -6,
// Sierra Time Zone
                                                          'R' => -5,
// Romeo Time Zone
                                                          'Q' => -4,
// Quebec Time Zone
                                                          'P' => -3,
// Papa Time Zone
                                                          'O' => -2,
// Oscar Time Zone
                                                          'N' => -1,
// November Time Zone
                                                          'A' => +1,
// Alpha Time Zone
                                                          'B' => +2,
// Bravo Time Zone
                                                          'C' => +3,
// Charlie Time Zone
                                                          'D' => +4,
// Delta Time Zone
                                                          'E' => +5,
// Echo Time Zone
                                                          'F' => +6,
// Foxtrot Time Zone
                                                          'G' => +7,
// Golf Time Zone
                                                          'H' => +8,
// Hotel Time Zone
                                                          'I' => +9,
// India Time Zone
                                                          'K' => +10,
// Kilo Time Zone
                                                          'L' => +11,
// Lima Time Zone
                                                          'M' => +12
// Mike Time Zone
                                                          ));

thnx,
Chris

attached mail follows:


Anyone got an updated and bug-fixed version? The one I got seems to have
many serious bugs.

--
  .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06) Linux 2.6.17.13
  ^ ^ 19:50:01 up 11 days 44 min 0 users load average: 1.07 1.04 1.01
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

attached mail follows:


Hi:

I'm trying to setup a dev environment using Apache, MySQL and
PHP...to develop an application that will go to production.
What is the most stable versions of the AMP components should I can
install?

The production environment will most likely live on a Linux machine.
My dev environment will be on OS X.

Thanks.

-James

attached mail follows:


James Tu wrote:
> Hi:
>
> I'm trying to setup a dev environment using Apache, MySQL and PHP...to
> develop an application that will go to production.
> What is the most stable versions of the AMP components should I can
> install?
>
> The production environment will most likely live on a Linux machine. My
> dev environment will be on OS X.

that's a religious question. some people advocate some distributions over others.

Personally, I recommend Fedora - it's easy to install, and you can use "yum"
and "yumex" (graphical yum) for package management.

Kae

attached mail follows:


James Tu wrote:
> Hi:
>
> I'm trying to setup a dev environment using Apache, MySQL and PHP...to
> develop an application that will go to production.
> What is the most stable versions of the AMP components should I can
> install?
>
> The production environment will most likely live on a Linux machine. My
> dev environment will be on OS X.

that's a religious question. some people advocate some distributions over others.

Personally, I recommend Fedora - it's easy to install, and you can use "yum"
and "yumex" (graphical yum) for package management.

Kae

attached mail follows:


On 9/20/06, Kae Verens <kaeverens.com> wrote:
>
> James Tu wrote:
> > Hi:
> >
> > I'm trying to setup a dev environment using Apache, MySQL and PHP...to
> > develop an application that will go to production.
> > What is the most stable versions of the AMP components should I can
> > install?
> >
> > The production environment will most likely live on a Linux machine. My
> > dev environment will be on OS X.
>
> that's a religious question. some people advocate some distributions over
> others.
>
> Personally, I recommend Fedora - it's easy to install, and you can use
> "yum"
> and "yumex" (graphical yum) for package management.
>
> Kae
>
> --
>

Hi
I agree it's a religious question.
I prefer Debian, apt-get is a really comfortable tool and it install all
require dependencies. All procedure LAMP install it only 4 commands ex.
apt-get install php5 :) It's a very fast and nice (best what i know).

Representant of debian's church ;)
Paul
 *
*

attached mail follows:


I was thinking more along the lines of what version of Apache, MySQL
and PHP I should install...

-James

On Sep 20, 2006, at 12:06 PM, Pawel Miroslawski wrote:

> On 9/20/06, Kae Verens <kaeverens.com> wrote:
>>
>> James Tu wrote:
>> > Hi:
>> >
>> > I'm trying to setup a dev environment using Apache, MySQL and
>> PHP...to
>> > develop an application that will go to production.
>> > What is the most stable versions of the AMP components should I can
>> > install?
>> >
>> > The production environment will most likely live on a Linux
>> machine. My
>> > dev environment will be on OS X.
>>
>> that's a religious question. some people advocate some
>> distributions over
>> others.
>>
>> Personally, I recommend Fedora - it's easy to install, and you can
>> use
>> "yum"
>> and "yumex" (graphical yum) for package management.
>>
>> Kae
>>
>> --
>>
>
> Hi
> I agree it's a religious question.
> I prefer Debian, apt-get is a really comfortable tool and it
> install all
> require dependencies. All procedure LAMP install it only 4 commands
> ex.
> apt-get install php5 :) It's a very fast and nice (best what i know).
>
> Representant of debian's church ;)
> Paul
> *
> *

attached mail follows:


On Wednesday 20 September 2006 18:06, Pawel Miroslawski wrote:
> On 9/20/06, Kae Verens <kaeverens.com> wrote:
> > James Tu wrote:
> > > Hi:
> > >
> > > I'm trying to setup a dev environment using Apache, MySQL and PHP...to
> > > develop an application that will go to production.
> > > What is the most stable versions of the AMP components should I can
> > > install?
> > >
> > > The production environment will most likely live on a Linux machine.
> > > My dev environment will be on OS X.
> >
> > that's a religious question. some people advocate some distributions over
> > others.
> >
> > Personally, I recommend Fedora - it's easy to install, and you can use
> > "yum"
> > and "yumex" (graphical yum) for package management.
> >
> > Kae
> >
> > --
>
> Hi
> I agree it's a religious question.
> I prefer Debian, apt-get is a really comfortable tool and it install all
> require dependencies. All procedure LAMP install it only 4 commands ex.
> apt-get install php5 :) It's a very fast and nice (best what i know).
>
> Representant of debian's church ;)
> Paul
> *
> *

Disipel of the same church. Never any problems and rock stable.

--
---
Børge
Kennel Arivene
http://www.arivene.net
---

attached mail follows:


Hello all,

I worked it out. I actually vi several acrobat file
to see the actual code inside.
This is my script after my study.

This is certainly not the best method, but
it works for me. Somebody may be interested
it using or improve this. Please tell me if you
guys got a better method:

<?php

$string = file_get_contents($filename);
$start = strpos($string, "<dc:title>") + 10;
$length = strpos(substr($string, $start), '</dc:title>');
if ($length) {
    $title = strip_tags(substr($string, $start, $length));
}

?>

Cheers,
Koala

On 9/8/06, Shu Hung (Koala) <koalaygmail.com> wrote:
>
> Hello,
>
> I know PDF files stores a "Title" somewhere.
> I'm not sure if it is at meta data or elsewhere.
>
> Does anyone have any method to get this "Title" out?
>
> Thanks
> Koala Yeung
>

attached mail follows:


Hi
it's example script:

<?php
$string = "This is some _color:pink_ colored text _color_";

$patterns[0] = '/_color:(.*?)_/';
$patterns[1] = '/_color_/';
$replacements[0] = '<font color="$1">';
$replacements[1] = '</font>';

echo preg_replace($patterns, $replacements, $string);
?>

It should be ok, but i don't test it.

Pawel