creating a PHP wrapper script?
| From: | Robert P. J. Day | Date: | Fri, 23 Apr 2010 15:18:06 +0000 |
| Subject: | creating a PHP wrapper script? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-304480@lists.php.net to get a copy of this message | ||
i'm sure this isn't hard to do, but i'm having end-of-week brain
cramps. just now, i installed a PHP package that lets me download
thumbnails of image files stored on a server -- the URL to generate
and download a thumbnail is, say:
http://server/d1/d2/thumbnail.php?fileID=whatever&arg1=val1&arg2=val2
and so on. unsurprisingly, the thumbnail generation program accepts
numerous arguments and is incredibly sophisticated, and is stored in a
subdirectory under /var/www/html and ... well, you get the idea,
calling it directly involves creating quite the URL.
instead, i'd like to stuff a wrapper script at the top of the
document root which hides all that complexity, so i can just browse
to:
http://server/thumb.php?fileID=whatever
and have that top-level thumb.php script make the appropriate
invocation to the real thumbnail.php script with all of those
(default) arguments and values.
so, what would thumb.php look like? i obviously need to simulate a
POST call, retrieve the output and pass it back unchanged. thoughts?
surely this is something that people want to do on a regular basis,
no?
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================