[olug] PHP vs. Perl

Jeremy Bettis jeremyb at hksys.com
Wed Nov 27 17:04:00 UTC 2002


Create an image.php page.  In your main page, use things like <img
src="image.php?imagenum=23456">

In image.php, connect to the database, get the image, and use the
header() function to write the Content-Type:, then output the image,
then exit;

Simple.  Search google for php database image for many examples.

I have a baby pictures php script: (http://www.bettis.org/photos) but it
doesn't use a database, just files in a directory.  But I do all the
thumbnail generation in php.

--
Jeremy Bettis, Software Development Manager
HKS Medical Information Systems, Inc.
jeremyb at hksys.com


> -----Original Message-----
> From: Jonathan Warren [mailto:thechunk at cox.net]
> Sent: Wednesday, November 27, 2002 11:05 AM
> To: olug at olug.org
> Subject: Re: [olug] PHP vs. Perl
> 
> Normally a photo linked into a page is a pointer back to the image.
It
> seems to me if you want a photo to be served up from a db your going
to
> have to some how alias the db pointer in your web server to a url.  I
> don't know of anythign to do this.  I don't know if you can embed the
> image than the browser should be able to interpret it.  Basically I am
> suggesting you dump all your images in a scripted manner and write php
to
> interpret your pictures directory.  If you find a way to use images
direct
> from a db please share with the list.  I would like to know how it is
> done.
> 
> -Jon W
> 
> 
> On Wed, Nov 27, 2002 at 09:18:25AM -0600, Joe Catanzaro wrote:
> > I'm in the process of building a web page for my family (we just had
a
> > baby, blah, blah, blah), and I have several questions.
> >
> > 1. Most of my web page data, such as photos are stored in a MySQL
> database.
> > To manage the database I use MySQLMan by Gossamer-Threads
> > http://www.gossamer-threads.com/scripts/mysqlman/ , and it's a great
web
> > interface to manage the database, but when it lists the photos on
the
> web
> > page, it displays them as they are stored, rather than as they
should
> > appear (funky garbage characters). Can someone recommend a web
interface
> to
> > manage a MySQL database? I've heard of PHPmyadmin. Any good? If so,
does
> it
> > display photo images rather than a bunch of garbage characters all
over
> the
> > screen?
> >
> > 2. To extract these photos and other data (text and video) from the
> > database, I normally use Perl's DBI. Is there any advantage in
learning
> PHP
> > to create these web pages? The reason I'm asking this question here
is
> > because of the survey I saw posted on OLUG that most people prefer
PHP
> over
> > Perl to create web pages.
> >
>
http://www.olug.org/modules.php?name=Surveys&op=results&pollID=10&mode=&
or
> der=&thold=
> >
> > 3. I'm using a MySQL database in hopes all of this is going to scale
no
> > matter how many photos I've got in that database. Are there any
> > disadvantages to building my site in this manner or have I assumed
> > correctly that this is a best practice?
> >
> > Thanks in advance and have a very Happy Thanksgiving,
> >
> >
> >
> >
> > Joe Catanzaro
> > joecatanzaro at cox.net
> >
> > _______________________________________________
> > OLUG mailing list
> > OLUG at olug.org
> > http://lists.olug.org/mailman/listinfo/olug
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug



More information about the OLUG mailing list