Robert Cummings | 1 Mar 01:41 2007

Re: Re: how to display images stored in DB

On Wed, 2007-02-28 at 17:04 -0500, Mark wrote:
> Kevin Waterson wrote:
> 
> > This one time, at band camp, zerof <zerof <at> terra.com.br> 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?
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.
(Continue reading)

Chris | 1 Mar 01:49 2007
Picon

Re: how to retrieve pictures from postgreSQL DB

tedd wrote:
> At 5:12 PM -0600 2/27/07, Richard Lynch wrote:
>> Personally, I think your first mistake was putting the image into the
>> DB at all.
>>
>> Unless you're the CIA doing pixel comparisons actually in SQL stored
>> procedures or something. :-)
> 
> Richard:
> 
> I highly respect your opinion and on this list you provide tremendous 
> help -- however -- I must disagree with you about storing images in 
> dB's. Both techniques (using dB or the file system) have their up-sides 
> and down-sides and neither have anything to do about CIA pixel comparisons?
> 
> This idea of CIA pixel comparisons has been brought up before and it's 
> pointless. There is no way for anyone to do a pixel search in MySQL. 
> Images are not text and thus can't be subject to a "full text" like 
> search. There are no functions in MySQL that will permit pixel searches 
> AND that isn't important anyway -- not everything stored in a dB has to 
> be search-able. That's not a requirement for entry!
> 
> When someone uses a dB for storing images, that's what they are doing -- 
> storing. I never store images without other data, like image type, size, 
> description and such. So, why would I want to separate out that single 
> attribute from a record and store that in a remote file system when I 
> could just as easily store it in a dB? It's like saying "Never use css 
> to display an image, only use html" when both work well under different 
> needs.
> 
(Continue reading)

Chris | 1 Mar 01:51 2007
Picon

Re: Problem with pgsql.so and extensions.

Marc Burgauer wrote:
> I found various links via Google mentioning the problem of ordering the 
> extension in the ini file. In my case this hasn't produced quite the 
> result. I haven't found an order that works for me.
> 
> Here the problem:
> 
> Freebsd 6
> apache 1.3.34
> PHP 5.2.1
> 
> I am using the ports collection and I have done a complete update prior 
> of attempting building PHP5.
> 
> My apache crashes with a "exit on signal 11 (core dumped)" on restart. 
> The culprit seems to be the pgsql.so extension in the ini file.
> I found a work around, which might shed some light to people who 
> understand the extension mechanism.

Could be a version mismatch (ie the pgsql.so is compiled for php 4.x and 
the rest are for php 5.x).

Having said that, the internals list would be a better place to ask 
because they would be able to help you debug/work out exactly what's 
going on (they're the C coders, we're just the plebs who use the end 
result ;) ).

--

-- 
Postgresql & php tutorials
http://www.designmagick.com/
(Continue reading)

Lisa A | 1 Mar 02:50 2007

auction scripts?

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?
thanks,
Lisa A

--

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

markw | 1 Mar 04:08 2007

Re: Re: how to display images stored in DB

> On Wed, 2007-02-28 at 17:04 -0500, Mark wrote:
>> Kevin Waterson wrote:
>>
>> > This one time, at band camp, zerof <zerof <at> terra.com.br> 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
(Continue reading)

M5 | 1 Mar 03:57 2007

Re: Re: Extract printable text from web page using preg_match


On 28-Feb-07, at 1:48 AM, Colin Guthrie wrote:

> M5 wrote:
>> No, it's not a very good solution. Striptags will leave everything
>> within <head>, <style> and <script> (in the body or out). Comments  
>> are
>> also included.
>>
>> I know it's possible to use non reg-ex strpos/substr to extra  
>> everything
>> within <body>, but as another poster correctly said, this assumes a
>> consistent HTML document (which there is not).
>>
>> I realize now that such a regex would be rather sophisticated, but I
>> thought surely it must exist, since text-scrapping the readable  
>> content
>> of a web page must not be rare.
>
> Said it before, but low-tech solution is to use program "lynx" with  
> the
> -dump argument and capture the output back to PHP. I'm assuming you  
> are
> on Linux or OSX I guess as I've not heard of using lynx on  
> windows.....

Thanks, that sounds like a good direction. And yes, I'm on OS X.

> There are loads of command line options to control the way lynx  
> displays
(Continue reading)

Brad | 1 Mar 04:08 2007

Eregi error


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.

--

-- 
(Continue reading)

Robert Cummings | 1 Mar 04:37 2007

Re: Re: how to display images stored in DB

On Wed, 2007-02-28 at 22:08 -0500, markw <at> mohawksoft.com wrote:
> > On Wed, 2007-02-28 at 17:04 -0500, Mark wrote:
> >> Kevin Waterson wrote:
> >>
> >> > This one time, at band camp, zerof <zerof <at> terra.com.br> 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?
> 
(Continue reading)

steve | 1 Mar 05:36 2007
Picon

Re: Re: how to display images stored in DB

> > >> 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.

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

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.

> some databases support raw access in which case they're performance is
> probably just as good as the OS (and quite probably better if you want
(Continue reading)

Casey Chu | 1 Mar 05:36 2007
Picon

Re: echo text - anti-spam-spider measure

http://themfund.com/snippets/test.php

Has %HEX, &#entity;, and even a entity version of the hex!

On 2/28/07, Richard Lynch <ceo <at> l-i-e.com> wrote:
> On Wed, February 28, 2007 1:20 am, Stut wrote:
> > Of all the possible methods, entities are the easiest for bots to
> > handle. They just need to decode the entities.
> >
> > More reliable methods involve using javascript to write out the
> > mailto:
> > tag. Do it in several statements. But even then, some of the smarter
> > spiders will execute simple javascript like that. You can make it
> > better
> > by using onload to execute the javascript which means the spider will
> > need to implement that, which I don't believe they do at the moment.
> >
> > Of course the best way is to use an image and don't link it. If it's
> > just a way for visitors to contact you, use a contact form. You don't
> > expose the email address and can control it a lot better.
>
> I'm no expert, but as far as I can tell from my readings on this
> subject, the reality is that spammers just don't bother to harvest
> them.
>
> Ongoing studies, older studies, newer studies.
>
> Everybody knows that the spammers *could* decode HEX or even the JS
> fairly trivially, but they don't.
>
(Continue reading)


Gmane