Re: creating a PHP wrapper script?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



php.net/curl should be able to do what you want.

file_get_contents with a proper stream context should also work (have
a look at functions like http://dk.php.net/manual/en/context.http.php
)

Regards
Peter

On 23 April 2010 17:18, Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> wrote:
>
>  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
> ========================================================================
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux