php-general Digest 1 Mar 2007 20:07:27 -0000 Issue 4653

Topics (messages 249643 through 249670):

Re: best framework (pear vs zend framework)
        249643 by: Edward Kay
        249644 by: Stut
        249651 by: Stut
        249653 by: Miles Thompson

PHP 4.4.6 Released!
        249645 by: Derick Rethans
        249649 by: Andrew Hutchings

Re: Eregi error
        249646 by: Nicholas Yim
        249647 by: M.Sokolewicz
        249667 by: Myron Turner

ibm universe database
        249648 by: Fernando Viadero
        249652 by: Marco Sottana
        249668 by: Oscar Gosdinski

Re: [PHP-DEV] Re: PHP 4.4.6 Released!
        249650 by: Derick Rethans

Re: how to display images stored in DB
        249654 by: markw.mohawksoft.com
        249656 by: markw.mohawksoft.com
        249657 by: tedd
        249658 by: markw.mohawksoft.com
        249659 by: Jack Gleeson
        249661 by: jgodish.highstream.net
        249665 by: tedd
        249670 by: Roman Neuhauser

Re: echo text - anti-spam-spider measure
        249655 by: Jochem Maas
        249662 by: Casey Chu

Re: auction scripts?
        249660 by: Stut

exec from process (deamon) without shell
        249663 by: Peter Lauri
        249664 by: Roman Neuhauser
        249666 by: lists.dwsasia.com

[X-POST] PHP script to make sure MySQL is up?
        249669 by: Brian Dunning

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 ---
> which is the best framework ?

For what? Your choice of any framework/language will be governed by the
problem you are trying to solve.

> pear or zend framework?

PEAR isn't a framework, it's a repository of PHP extensions and
applications, hence the acronym. If you're looking into PHP web application
frameworks, start here:
http://en.wikipedia.org/wiki/List_of_web_application_frameworks#PHP

Personally, I like Qcodo (http://www.qcodo.com) - but only because it fits
with both my mindset and the applications I'm developing at the moment.

Edward

--- End Message ---
--- Begin Message ---
Marco Sottana wrote:
which is the best framework ? pear or zend framework?

Which is the best fruit? Apple or pear fruit?

-Stut

--- End Message ---
--- Begin Message ---
Please include the list on replies.

Marco Sottana wrote:
potato

Not really a fruit is it. Still, I'll take that to mean that you got my point.

-Stut

----- Original Message ----- From: "Stut" <[EMAIL PROTECTED]>
To: "Marco Sottana" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Thursday, March 01, 2007 10:25 AM
Subject: Re: [PHP] best framework (pear vs zend framework)


Marco Sottana wrote:
which is the best framework ? pear or zend framework?

Which is the best fruit? Apple or pear fruit?

-Stut



--- End Message ---
--- Begin Message ---
Yay!! Someone else working with qcodo.

If I was starting afresh, that's what I would use.

Current project is based on Joomla! - there is a lot to assimilate and much
of it is old-style coding.

Cheers - Miles




--- End Message ---
--- Begin Message ---
Hello!

The PHP development team would like to announce the immediate 
availability of PHP 4.4.6.  This release addresses a crash problem with 
the session extension when register_globals is turned on that was 
introduced in PHP 4.4.6. This release comes also with the new version 
7.0 of PCRE and it addresses a number of minor bugs.

A separate release announcement is also available. For changes in PHP 
4.4.6 since PHP 4.4.5, please consult the PHP 4 ChangeLog. 

Release Announcement: http://www.php.net/release_4_4_6.php
Downloads:            http://www.php.net/downloads.php#v4
Changelog:            http://www.php.net/ChangeLog-4.php#4.4.6

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

--- End Message ---
--- Begin Message ---
Derick Rethans wrote:
> Hello!
> 
> The PHP development team would like to announce the immediate 
> availability of PHP 4.4.6.  This release addresses a crash problem with 
> the session extension when register_globals is turned on that was 
> introduced in PHP 4.4.6.

So these release fixes a crash that wasn't introduced until this
release.  That's clever ;)

Regards
Andrew
-- 
Andrew Hutchings - Linux Jedi - http://www.linuxjedi.co.uk/
A-Wing Internet Services - http://www.a-wing.co.uk/
Windows is the path to the darkside...Windows leads to Blue Screen.
Blue Screen leads to downtime. Downtime leads to suffering...I sense
much Windows in you.

--- End Message ---
--- Begin Message ---
Hello Brad,

   suggest to use preg_* instead of ereg_*

   extension is useless

Best regards, 
  
======= At 2007-03-01, 11:12:52 you wrote: =======

>
>Hey all,
>I have been having some trouble with the "eregi" function. I have the 
>following piece of code in my application:
>
>    function standard_input($input, $min=0, $max=50){
>        if (strlen($input) <= $max and strlen($input) >= $min ) {
>            $pattern = '^[a-z0-9\!\_ \.- ,/]*$';
>            if(!eregi($pattern, $input)){
>                return false;
>            }else{
>                return true;
>            }
>        }else{
>            return false;
>        }
>       
>    }
>
>And i am running PHP version 5.2.1
>
>I receive the following error:
>*Warning*: eregi() [function.eregi 
><http://idontwanttouse.net/MeetMyMate/Bin/Debug/function.eregi>]: 
>REG_ERANGE in *[File Location]* on line *287
>
>*Any ideas what might cause this? Googling REG_ERANGE only showed more 
>questions.
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>

= = = = = = = = = = = = = = = = = = = =
                        
Nicholas Yim
[EMAIL PROTECTED]
2007-03-01

--- End Message ---
--- Begin Message --- I agree with the first part, that it is in many cases better to use the Perl Compatible Regular Expressions (PCRE, preg_*) than the POSIX compatible ones (ereg[i]_*). However, I don't quite get what you mean by "extension is useless" ? What extension...?? and why would it be useless? (useless in what way?)

- tul

Nicholas Yim wrote:
Hello Brad,

   suggest to use preg_* instead of ereg_*

   extension is useless

Best regards, ======= At 2007-03-01, 11:12:52 you wrote: =======

Hey all,
I have been having some trouble with the "eregi" function. I have the following piece of code in my application:

   function standard_input($input, $min=0, $max=50){
       if (strlen($input) <= $max and strlen($input) >= $min ) {
           $pattern = '^[a-z0-9\!\_ \.- ,/]*$';
           if(!eregi($pattern, $input)){
               return false;
           }else{
               return true;
           }
       }else{
           return false;
       }
}

And i am running PHP version 5.2.1

I receive the following error:
*Warning*: eregi() [function.eregi <http://idontwanttouse.net/MeetMyMate/Bin/Debug/function.eregi>]: REG_ERANGE in *[File Location]* on line *287

*Any ideas what might cause this? Googling REG_ERANGE only showed more questions.

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



= = = = = = = = = = = = = = = = = = = =
                        
Nicholas Yim
[EMAIL PROTECTED]
2007-03-01

--- End Message ---
--- Begin Message ---
M.Sokolewicz wrote:
Hey all,
I have been having some trouble with the "eregi" function. I have the following piece of code in my application:

   function standard_input($input, $min=0, $max=50){
       if (strlen($input) <= $max and strlen($input) >= $min ) {
           $pattern = '^[a-z0-9\!\_ \.- ,/]*$';
           if(!eregi($pattern, $input)){
               return false;
           }else{
               return true;
           }
       }else{
           return false;
       }
         }

And i am running PHP version 5.2.1

I receive the following error:
*Warning*: eregi() [function.eregi <http://idontwanttouse.net/MeetMyMate/Bin/Debug/function.eregi>]: REG_ERANGE in *[File Location]* on line *287

the problem is that the hyphen is interpreted as regex range operator:
                                         [a-z0-9\!\_ \.- ,/]
Rewrite this as
                                   [a-z0-9\!\_ \. ,/-]
with the hyphen in the last position.

--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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

i have to take some data from a IBM universe database on a windows server from my linux+php web server..

does anybody know how to do this?? (i have googled a few hours and i did not find anything)...


thanks
--- End Message ---
--- Begin Message ---
as400?
----- Original Message ----- From: "Fernando Viadero" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, March 01, 2007 12:44 PM
Subject: [PHP] ibm universe database


Hello.

i have to take some data from a IBM universe database on a windows server from my linux+php web server..

does anybody know how to do this?? (i have googled a few hours and i did not find anything)...


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




--- End Message ---
--- Begin Message ---
Do you mean IBM DB2 Universal Database?

I search on google with the following text: php db2 and the first result was:
http://www-128.ibm.com/developerworks/db2/library/techarticle/scott/0614_scott.html

I think this link will help you.

On 3/1/07, Fernando Viadero <[EMAIL PROTECTED]> wrote:
i have to take some data from a IBM universe database on a windows server
from my linux+php web server..

--
Saludos
Oscar

--- End Message ---
--- Begin Message ---
On Thu, 1 Mar 2007, Andrew Hutchings wrote:

> Derick Rethans wrote:
> > Hello!
> > 
> > The PHP development team would like to announce the immediate 
> > availability of PHP 4.4.6.  This release addresses a crash problem with 
> > the session extension when register_globals is turned on that was 
> > introduced in PHP 4.4.6.
> 
> So these release fixes a crash that wasn't introduced until this
> release.  That's clever ;)

Nope, it's a typo, it should read:

        This release addresses a crash problem with the session 
        extension when register_globals is turned on that was introduced 
        in PHP 4.4.5.

regards,
Derick

--- End Message ---
--- Begin Message ---
> On Wed, 2007-02-28 at 22:08 -0500, [email protected] wrote:
>> > On Wed, 2007-02-28 at 17:04 -0500, Mark wrote:
>> >> Kevin Waterson wrote:
>> >>
>> >> > This one time, at band camp, zerof <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> >> It is not a good practice to store pictures in DataBases, use
>> links,
>> >> >> instead of.
>> >> >
>> >> > Rubbish, where are your benchmarks?
>> >>
>> >> It has almost nothing to do with benchmarks.
>> >>
>> >> Images are typically best supported in the form of files. They are
>> more
>> >> easily manipulated by external tools.
>> >>
>> >> The web browser sees an image as a single HTTP request. Invoking the
>> PHP
>> >> script engine, parsing the script, and executing a SQL query to
>> retrieve
>> >> the image from the database is less efficient than letting the web
>> >> server
>> >> just send the file.
>> >>
>> >> Image files do not need to be constrained by the rigid requirements
>> of a
>> >> relational database.
>> >>
>> >> I could go on, but it should be clear enough that putting images in a
>> >> database is not a good idea.
>> >
>> > What about when you need to share those files across a 50 node
>> network?
>>
>> Without more information about the nodes and the network design, I can't
>> offer a good argument against it,
>
> Oh, let's just say 50 nodes across the internet -- no specific location.
> And remember, I don't want to have every file on every server, I may
> have petabytes of data. Feel free to comment.

OK, sure.

First, are you saying that 50 nodes, spread across the internet, all have
access to your SQL database? Yikes.

>
>>  but I can say, that given any rational
>> system, bitmap images are better as discrete files than contents of a
>> database.
>
> I'd argue that's only true if you need to modify the contents, and you
> can't do so without a copy on the filesystem. Otherwise I'd have to
> disagree. Databases implement their own filesystem for the most parts.

A data storage system within a file system. It is a subtle difference.


> In fact many newer bleeding edge filesystems are practically database
> implementations.

Not even bleeding edge. Think of the UNIX file systems, many use file
names merely as indexes to inodes which point to files. Very
database-esque.

> As such, the OS and the Database are merely layers over
> the raw medium.

To a point, this is true, but layers with different purposes.

> Sure the database is often layered over the OS's
> implementation of the filesystem, but that is not necessaril true since
> some databases support raw access

Absolutly, raw access can speed up SQL databases with, of course, certain
caveats.


> in which case they're performance is
> probably just as good as the OS (and quite probably better if you want
> to store meta information about the file and it's data).

Well, here's where your probably wrong. Depending on the database, of
course, as PostgreSQL, MySQL, Oracle, DB2, etc. all have different
behavior characteristics.

Now, first the only point in your argument thus far has been performance.
There are more issues involved, but for the moment lets argue that simple
point.

A file system is designed to take a file name, find its location on disk
or in cache, and return it. (Obviously simplified, but you get the point)

A database is designed to accept a query, parse the query and produce a
good access plan for the data requested, and return the data.

In many databases, blobs or binary objects are merely stored as files
outside the data tables. Even if they are stored in your database they are
large and possibly compressed. Either way they are large.

If the bitmaps are stored as external files, then performance wise, you
have the overhead of the SQL query in top of your file access.

If the bitmaps are stored in the database, then they take up cached blocks
that the database manage and reduce overall performance of the database.
>
>> If you give me more information, I can counter with more specifics.
>
> I don't have specifics, I was just giving a sample scenario from the top
> of my head.
>
>> > I'd keep it in a database, then when I need it cache a local copy on
>> the
>> > filesystem. Then I can just check the timestamp in the database to see
>> > if the file has changed. Voila, multi-node high availability images.
>>
>> You can do that sort of operation with any number of other tools more
>> efficiently.
>
> Maybe... and even so, are they just as convenient? Why implement
> multiple protocols when one will suffice? KISS!

Scalability and reliability and performance all come from keeping
logically separate functions being done separately.

>
>> > Seems better than have a local copy of every single image. I guess the
>> > answer is... it depends on what you're doing!
>>
>> No, it just seems like if the only tool you are comfortable with is a
>> hammer, then every job is more or less exactly like a nail.
>
> I'm quite comfortable with many tools. But if it looks like a duck, and
> walks like a duck, then I'm sure the hammer will suffice.

It only looks like a duck if you ignore the horns, hooves, and teeth.

>
>> Databases are great tools, but there are many tasks which they can do,
>> just not well.
>
> Well one thing I know the webserver itself and the filesystem can't do
> is check the credentials of a logged in user to see if they are allowed
> the file.

This is true.

> Well, I guess the webserver could do it... sort of... with
> http auth. Wonder if that works with many custom authentication
> systems... I presume you would somehow cram that into the webserver? I
> guess if the only tool with which you're comfortable is a screwdriver,
> then every job is more or less exactly like a screw. As such, I think
> you're screwed. Remember, I said it depends on what you're doing, you
> said "no", and well quite frankly you're wrong, because your screw and
> screwdriver mentality doesn't work in every imaginable scenario.

In the case of a bitmap file that needs auth, I would use the session and
a PHP pass through code and avoid the database.

if($_SESSION['bitmapok'] == 'yes')
{
   $bitmap = fopen($bitmap_file_name);

    ......
}

I'm not sure of your design, but typically speaking, the database back-end
is the bottleneck, and web services should limit access if possible to
improve performance.

--- End Message ---
--- Begin Message ---
>> > >> The web browser sees an image as a single HTTP request. Invoking
>> the PHP
>> > >> script engine, parsing the script, and executing a SQL query to
>> retrieve
>> > >> the image from the database is less efficient than letting the web
>> > >> server
>> > >> just send the file.
>
>
> In a simple setup, that is probably true. However, if you use PHP to
> do authentication or throttling, then the engine is already there. On
> the flip side, you can use sendfile() or on Lighhttpd you can push the
> sending of the file back to the webserver using x-sendfile.

That's doesn't address the storage location of the file.
>
>
>> > >> Image files do not need to be constrained by the rigid requirements
>> of a
>> > >> relational database.
>
>
> File systems are not immune to constraints. For example, ext3 only
> allows 32000 subdirectories. So if you gave each user a directory to
> upload files to, you would be stuck at a max of 32000 users. Or start
> going to silly things like /S/t/e/Steve.gif

First of all, I wouldn't use EXT3 for anything. In is, in all my tests,
the slowest file system.

>
> More constaints below..
>
>
>> > > What about when you need to share those files across a 50 node
>> network?
>
>
> Webfarm scenarios do come to mind. There is an issue of how to sync
> all webservers to have all files. Then again, if you are using 50
> webservers, the chances of them all being able to house all your files
> (1 petabyte, as an example given) is not very good.

Again, the problem of replication or distribution does not require a
database. If you are saying that your single database will contain all
your bitmap files, then that's messed up and your database will be a
bottleneck.

You've stated a problem: A large amount of data spread across multiple
machines, this is a real problem domain, but it absolutely does not say
why a database is the right solution or even a solution at all.

--- End Message ---
--- Begin Message ---
At 5:04 PM -0500 2/28/07, Mark wrote:
Images are typically best supported in the form of files. They are more
easily manipulated by external tools.
-snip-
I could go on, but it should be clear enough that putting images in a
database is not a good idea.

It's clear enough to me that it's not a bad idea -- it depends upon the purpose.

You also said:

At 10:08 PM -0500 2/28/07, [email protected] wrote:
No, it just seems like if the only tool you are comfortable with is a
hammer, then every job is more or less exactly like a nail.

Interesting, someone usually makes that comment to one who has a limited repertoire.

On one hand, I'm advocating using dB for image storage when the needs of the job are better served by doing that, while you only see only one way and that is to use the file system.

Can you not imagine any scenario where storing images in a dB would be a better choice? Or is this the hammer and nail thing you stated but failed to realize you were practicing?

I suggest, and it's only a suggestion, that before you condemn one practice and advocate another that you know both the good and bad of both.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
> At 5:04 PM -0500 2/28/07, Mark wrote:
>>Images are typically best supported in the form of files. They are more
>>easily manipulated by external tools.
>>-snip-
>>I could go on, but it should be clear enough that putting images in a
>>database is not a good idea.
>
> It's clear enough to me that it's not a bad idea -- it depends upon
> the purpose.

Obviously, I don't agree.

>
> You also said:
>
> At 10:08 PM -0500 2/28/07, [email protected] wrote:
>>No, it just seems like if the only tool you are comfortable with is a
>>hammer, then every job is more or less exactly like a nail.
>
> Interesting, someone usually makes that comment to one who has a
> limited repertoire.

Or needs a smart ass way of saying that someone is using the wrong tool
for the job.


>
> On one hand, I'm advocating using dB for image storage when the needs
> of the job are better served by doing that, while you only see only
> one way and that is to use the file system.

Actually, I think you would be hard pressed to make a viable case for
storing bitmap images in a database. Just because you *can* do it, does
not mean it is a good solution to the problem.

>
> Can you not imagine any scenario where storing images in a dB would
> be a better choice? Or is this the hammer and nail thing you stated
> but failed to realize you were practicing?

Well, to be honest, I can't think of a single instance where storing
bitmap data in a database is a good idea. I've done everything from DICOM
systems to huge web sites, and it has never been a solution that did not
introduce more problems than it solves.

Storing a bitmap path in the database is far more flexible and efficient.

>
> I suggest, and it's only a suggestion, that before you condemn one
> practice and advocate another that you know both the good and bad of
> both.

In this discussion I have stated reasons why it is a bad idea. No one has
come up with a counter point which can only be served by a database and
thus proves me wrong. I think that says something.

--- End Message ---
--- Begin Message ---
Rubbish, where are your benchmarks?

^^ whoever wrote that needs to check the manual before you make bold
statements and my friend it is not 'Rubbish'

On 2/28/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Tue, February 27, 2007 8:03 pm, Kevin Waterson wrote:
> This one time, at band camp, "Richard Lynch" <[EMAIL PROTECTED]> wrote:
>
>> *ALL* of the arguments on this topic, and benchmarks, are in the PHP
>> General archives.
> I am not concerned with past benchmarks done by others, I am asking
> what
> current benchmarks this user has made to make his claim.

Why?

They'd be no more nor less meaningful than the previous benchmarks to
you personally.

Or maybe I've just lost the thread of conversation here...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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




--
--

Jack Gleeson
Web Designer

--- End Message ---
--- Begin Message ---
Information on image storage in DB's

http://www.webmasterworld.com/forum88/9091.htm

Quoting [email protected]:

> >> > >> The web browser sees an image as a single HTTP request. Invoking
> >> the PHP
> >> > >> script engine, parsing the script, and executing a SQL query to
> >> retrieve
> >> > >> the image from the database is less efficient than letting the web
> >> > >> server
> >> > >> just send the file.
> >
> >
> > In a simple setup, that is probably true. However, if you use PHP to
> > do authentication or throttling, then the engine is already there. On
> > the flip side, you can use sendfile() or on Lighhttpd you can push the
> > sending of the file back to the webserver using x-sendfile.
>
> That's doesn't address the storage location of the file.
> >
> >
> >> > >> Image files do not need to be constrained by the rigid requirements
> >> of a
> >> > >> relational database.
> >
> >
> > File systems are not immune to constraints. For example, ext3 only
> > allows 32000 subdirectories. So if you gave each user a directory to
> > upload files to, you would be stuck at a max of 32000 users. Or start
> > going to silly things like /S/t/e/Steve.gif
>
> First of all, I wouldn't use EXT3 for anything. In is, in all my tests,
> the slowest file system.
>
> >
> > More constaints below..
> >
> >
> >> > > What about when you need to share those files across a 50 node
> >> network?
> >
> >
> > Webfarm scenarios do come to mind. There is an issue of how to sync
> > all webservers to have all files. Then again, if you are using 50
> > webservers, the chances of them all being able to house all your files
> > (1 petabyte, as an example given) is not very good.
>
> Again, the problem of replication or distribution does not require a
> database. If you are saying that your single database will contain all
> your bitmap files, then that's messed up and your database will be a
> bottleneck.
>
> You've stated a problem: A large amount of data spread across multiple
> machines, this is a real problem domain, but it absolutely does not say
> why a database is the right solution or even a solution at all.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
At 10:01 AM -0500 3/1/07, [email protected] wrote:
In this discussion I have stated reasons why it is a bad idea. No one has
come up with a counter point which can only be served by a database and
thus proves me wrong. I think that says something.


Contradiction is not a sign of falsity, nor the lack of contradiction a sign of truth.

I think "no comment" says that discussing this issue has problems.

For example, this has been subject of many flame wars before and I'm sure that many just don't care to join in. If you want to claim something absurd, then who are they to correct you? And why should they care?

Also, it might be that if counter points are made, will they just fall on deaf ears and be dismissed as easy as you claimed that there are no "good" reasons for doing in the first place. Keep in mind that you admittedly don't know of any "good" reasons and thus are more of an advocate for one side than open to seeing both sides.

If I were to provide you with "good" reasons, would you honestly consider them OR are you so set in your ways that no example would suffice. Remember, that this topic has started flames wars before where people, on both sides, would not admit that one technique might prove more appropriate for one condition over another.

If you are open to honestly consider, then I shall provide a couple of examples. But if I do and you do not agree, then your only recourse will be to *prove* otherwise.

So, what say you?

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-03-01 12:46:09 -0500:
> At 10:01 AM -0500 3/1/07, [email protected] wrote:
> >In this discussion I have stated reasons why it is a bad idea. No one has
> >come up with a counter point which can only be served by a database and
> >thus proves me wrong. I think that says something.
> 
> 
> Contradiction is not a sign of falsity, nor the lack of contradiction 
> a sign of truth.
> 
> I think "no comment" says that discussing this issue has problems.
> 
> For example, this has been subject of many flame wars before and I'm 
> sure that many just don't care to join in. If you want to claim 
> something absurd, then who are they to correct you? And why should 
> they care?

Exactly, ted.  markw is so obviously right, and he's presented the
points so well, there's nothing to add, really.  but since you asked:
yeah, he's right.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
> You could also use %XX in HEX on the mailto:

you can actually randomly mix and match hex and entity encoding,
which is what the function I posted elsewhere in the thread does.

> 
> On Tue, February 27, 2007 11:09 pm, Casey Chu wrote:
>> It works. =P I tested it.
>>
>> Try it here! =P
>>
>> http://themfund.com/snippets/test.php
>>
>> On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote:
>>> I'm not sure with both of your questions. I'm too lazy to try.
>>>
>>> Untested: But to encode it, you would use
>>>
>>> preg_replace_callback('~([\d\w])~', create_function('$a', 'return
>>> "&#".ord($a[0]).";";'), $theEmail);
>>>
>>> Hopefully that works?
>>>
>>> On 2/27/07, John Taylor-Johnston
>>> <[EMAIL PROTECTED]> wrote:
>>>> How do I encode it? And would the href tag work?
>>>>
>>>> Casey Chu wrote:
>>>>> ^ So put that into a <a href> tag.
>>>>>
>>>>> On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote:
>>>>>> Try using Javascript? Or use all entities? For example:
>>>>>> mailto:[email protected] would turn into
>>>>>> &#109;&#97;&#105;&#108;&#116;&#111;&#58;&#112;&#104;&#112;&#45;&#103;&#101;&#110;&#101;&#114;&#97;&#108;&#64;&#108;&#105;&#115;&#116;&#115;&#46;&#112;&#104;&#112;&#46;&#110;&#101;&#116;
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 2/27/07, John Taylor-Johnston
>>>>>> <[EMAIL PROTECTED]> wrote:
>>>>>>> I need an anti-spam-spider measure for my site. Too many
>>> addresses are
>>>>>>> getting raked. In once instance, I created a flash page:
>>>>>>> http://erasethis.glquebec.org/English/contact.htm
>>>>>>> But I just don't have the time to create a flash image for
>>> every
>>>>>> single
>>>>>>> instance, most of which come from dynamically printed PHP
>>> pages from a
>>>>>>> MySQL database.
>>>>>>>
>>>>>>> Could I dynamically create a flash image, input the email and
>>> tell the
>>>>>>> flash image to mailto:[EMAIL PROTECTED]
>>>>>>>
>>>>>>> Do anyone have a solution? Does one already exist?
>>>>>>>
>>>>>>> My idea was to create a PHP script and output to a png. But I
>>> see many
>>>>>>> problems, including:
>>>>>>>
>>>>>>> 1) How do I avoid echoing the email address in the <a
>>> href=""> tag?
>>>>>>> 2) How would I write a png that would be long and high
>>> enough?
>>>>>>> 3) How would the same script display the png?
>>>>>>>
>>>>>>> In short, I can't see far enough how to do this and avoid
>>>>>> spider-raking
>>>>>>> in the HTML or header the content of the image.
>>>>>>>
>>>>>>> Any advice, code or input would be appreciated,
>>>>>>> John
>>>>>>>
>>>>>>> <a href="<?php
>>>>>>>
>>>>>>> #what do I put here?
>>>>>>> $mydata->email = "[EMAIL PROTECTED]";
>>>>>>> echo $??????????;
>>>>>>>
>>>>>>> ?>"><img src="<?php
>>>>>>> |header('Content-type: image/png');|
>>>>>>> #How do I display the image?
>>>>>>>
>>>>>>> $mydata->email = "[EMAIL PROTECTED]";
>>>>>>> echo $??????????;
>>>>>>>
>>>>>>> ?>" width="???" height="???">
>>>>>>>
>>>>>>> --
>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> 

--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
> You could also use %XX in HEX on the mailto:

you can actually randomly mix and match hex and entity encoding,
which is what the function I posted elsewhere in the thread does.


My function also does that: http://themfund.com/snippets/test.php


On 3/1/07, Jochem Maas <[EMAIL PROTECTED]> wrote:
Richard Lynch wrote:
> You could also use %XX in HEX on the mailto:

you can actually randomly mix and match hex and entity encoding,
which is what the function I posted elsewhere in the thread does.

>
> On Tue, February 27, 2007 11:09 pm, Casey Chu wrote:
>> It works. =P I tested it.
>>
>> Try it here! =P
>>
>> http://themfund.com/snippets/test.php
>>
>> On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote:
>>> I'm not sure with both of your questions. I'm too lazy to try.
>>>
>>> Untested: But to encode it, you would use
>>>
>>> preg_replace_callback('~([\d\w])~', create_function('$a', 'return
>>> "&#".ord($a[0]).";";'), $theEmail);
>>>
>>> Hopefully that works?
>>>
>>> On 2/27/07, John Taylor-Johnston
>>> <[EMAIL PROTECTED]> wrote:
>>>> How do I encode it? And would the href tag work?
>>>>
>>>> Casey Chu wrote:
>>>>> ^ So put that into a <a href> tag.
>>>>>
>>>>> On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote:
>>>>>> Try using Javascript? Or use all entities? For example:
>>>>>> mailto:[email protected] would turn into
>>>>>> 
&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#112;&#104;&#112;&#45;&#103;&#101;&#110;&#101;&#114;&#97;&#108;&#64;&#108;&#105;&#115;&#116;&#115;&#46;&#112;&#104;&#112;&#46;&#110;&#101;&#116;
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 2/27/07, John Taylor-Johnston
>>>>>> <[EMAIL PROTECTED]> wrote:
>>>>>>> I need an anti-spam-spider measure for my site. Too many
>>> addresses are
>>>>>>> getting raked. In once instance, I created a flash page:
>>>>>>> http://erasethis.glquebec.org/English/contact.htm
>>>>>>> But I just don't have the time to create a flash image for
>>> every
>>>>>> single
>>>>>>> instance, most of which come from dynamically printed PHP
>>> pages from a
>>>>>>> MySQL database.
>>>>>>>
>>>>>>> Could I dynamically create a flash image, input the email and
>>> tell the
>>>>>>> flash image to mailto:[EMAIL PROTECTED]
>>>>>>>
>>>>>>> Do anyone have a solution? Does one already exist?
>>>>>>>
>>>>>>> My idea was to create a PHP script and output to a png. But I
>>> see many
>>>>>>> problems, including:
>>>>>>>
>>>>>>> 1) How do I avoid echoing the email address in the <a
>>> href=""> tag?
>>>>>>> 2) How would I write a png that would be long and high
>>> enough?
>>>>>>> 3) How would the same script display the png?
>>>>>>>
>>>>>>> In short, I can't see far enough how to do this and avoid
>>>>>> spider-raking
>>>>>>> in the HTML or header the content of the image.
>>>>>>>
>>>>>>> Any advice, code or input would be appreciated,
>>>>>>> John
>>>>>>>
>>>>>>> <a href="<?php
>>>>>>>
>>>>>>> #what do I put here?
>>>>>>> $mydata->email = "[EMAIL PROTECTED]";
>>>>>>> echo $??????????;
>>>>>>>
>>>>>>> ?>"><img src="<?php
>>>>>>> |header('Content-type: image/png');|
>>>>>>> #How do I display the image?
>>>>>>>
>>>>>>> $mydata->email = "[EMAIL PROTECTED]";
>>>>>>> echo $??????????;
>>>>>>>
>>>>>>> ?>" width="???" height="???">
>>>>>>>
>>>>>>> --
>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>



--- End Message ---
--- Begin Message ---
Please include the list in replies.

Lisa Armstrong wrote:
Well, if it goes through ebay don't you have to give them a percentage?

Correct, that's usually what happens when someone provides you with a service.

Also, he just wanted it on his site and not on ebay?

http://www.hotscripts.com/PHP/Scripts_and_Programs/Auctions/index.html

But bear in mind that you'll need to put stuff in place to cover all the legal issues raised by online auctions. The reason I recommended eBay is that they're set up to do this, but it's your funeral.

-Stut

    ----- Original Message -----
    *From:* Stut <mailto:[EMAIL PROTECTED]>
    *To:* Lisa A <mailto:[EMAIL PROTECTED]>
    *Cc:* [email protected] <mailto:[email protected]>
    *Sent:* Thursday, March 01, 2007 1:43 AM
    *Subject:* Re: [PHP] auction scripts?

    Lisa A wrote:
     > I have a client that bought some property that he'd like to have
    a website
     > and have people bid on the land?  Does anyone know of any
    software or could
     > write something simple for me to put this on his site?

    This wheel is not simply a round object, and it already exists...
    http://ebay.com/

    -Stut

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

 

I have a very complex script that is being called by a running deamon that
doesn't have any shell. To simplify it I make this script, that is also
failing:

 

#/thepathtophp

<?php

exec("ls -lrt", $stdout, $exitcode);

 

if($exitcode!=0) {

            echo "Command ls -lrt could not be executed correctly. Exit
code: $exitcode\n";

} else {

            echo "Result:\n";

            foreach($stdout AS $line) {

                        echo $line."\n";

            }

}

?>

 

This code give the exit code -1 that is equal to that "ls -lrt" could not be
executed. 

 

Running this from shell give correct result. 

 

Executing it from a web page (thru apache) gives correct result.

 

But the "shell less" deamon is giving the -1 exit code.

 

Is exec requiring a shell? Any workaround on this? I will play around, maybe
something like system() or passthru() will do it, but I haven't tested that
yet, want to get some feedback first.

 

Best regards,

Peter Lauri

 

 <http://www.dwsasia.com/> www.dwsasia.com - company web site

 <http://www.lauri.se/> www.lauri.se - personal web site

 <http://www.carbonfree.org.uk/> www.carbonfree.org.uk - become Carbon Free

 


--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-03-01 18:28:35 +0200:
> #/thepathtophp
> <?php
> 
> exec("ls -lrt", $stdout, $exitcode);
> 
> if($exitcode!=0) {
>             echo "Command ls -lrt could not be executed correctly. Exit code: 
> $exitcode\n";
> } else {
>             echo "Result:\n";
>             foreach($stdout AS $line) {
>                         echo $line."\n";
>             }
> }
> 
> ?>
> 
> 
> This code give the exit code -1 that is equal to that "ls -lrt" could not be
> executed. 

Does the daemon run chrooted somewhere?
What does $PATH contain?
What happens if you use /bin/ls?


-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
Quoting Roman Neuhauser <[EMAIL PROTECTED]>:

# [EMAIL PROTECTED] / 2007-03-01 18:28:35 +0200:
#/thepathtophp
<?php

exec("ls -lrt", $stdout, $exitcode);

if($exitcode!=0) {
echo "Command ls -lrt could not be executed correctly. Exit code: $exitcode\n";
} else {
            echo "Result:\n";
            foreach($stdout AS $line) {
                        echo $line."\n";
            }
}

?>


This code give the exit code -1 that is equal to that "ls -lrt" could not be
executed.

Does the daemon run chrooted somewhere?
What does $PATH contain?
What happens if you use /bin/ls?


I tried with /bin/ls but still same thing. I just found out that the exitcode is -1 but the $stdout actually gives correct answer. But that doesn't make sense. How can I then control what action to take depending on the exitcode?

apache   10099     1  0 18:47 ?        00:00:00 /tmp/log_monitor

--- End Message ---
--- Begin Message --- I host at Rackspace, and one thing that their monitoring service does NOT catch is a problem when too many connections hit MySQL, and for some reason it remains hung up until the service is manually restarted. In the meantime, this is happening to us once or twice a month. It gets hammered with a huge number of brief connections from other Apache servers.

Slow queries and mysql_close() are NOT the problem. It's just too many connections, even though they're super fast.

Is there such a thing as a PHP script that I can put on a cron job to run every minute and make a test query, and upon failure, restart the service and maybe send an email to Rackspace support? I don't know how you'd check that the query was refused due to too many connections, and I also don't know how PHP would restart the MySQL service.

Thanks...  :)

--- End Message ---

Reply via email to