Re: Solution for html source <img="gif_script.php?var..."> ?
| From: | Robin Vickery | Date: | Fri, 28 Jul 2000 11:26:14 +0000 |
| Subject: | Re: Solution for html source <img="gif_script.php?var..."> ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8763@lists.php.net to get a copy of this message | ||
someone@internetaddress.com ("John Coggeshall") writes:
> Sorry, there's no way to make the SRC tag look any different than a GET
> Method type URL. The only way you could make this work otherwise was to do
> something like this.
>
> <IMG SRC="<?php echo makeImage("foo", 12); ?>">
>
> Where makeImage() would make the image and save it as a file (returning that
> filename when it was finished). That way you could end up with something
> like...
>
> <IMG SRC="asdlkjwe.gif">
>
> instead of
>
> <IMG SRC="image.php?msg=foo+bar&size=12">
>
> They both have their drawbacks.
You could use apache's mod_rewrite to make a URI like:
http://your.domain/dbimages/some_text-14.png
to actually go to:
/scripts/dbimages.php?text=some_text&size=14
a RewriteRule in your apache config file like this should do it:
RewriteRule ^/dbimages/(.+)-(.+)\.png /scripts/dbimages.php?text=$1&size=$2
-robin
--
Robin Vickery...............................................
Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK
Email: robin@planet-three.net Phone: +44 (0)794 670 6395