On Thu, July 26, 2007 8:18 am, elk dolk wrote:
> Hi all,
>
> I want to hide the real URL to my images by masking it with PHP
> the code looks like this:
>
> $query = "SELECT * FROM table";
> $result=mysql_query($query);
>
> while ($row = mysql_fetch_array($result))
> {
> echo "<img src='http://www.mysite.com/img/{$FileName}'/>";
> }
>
> if you look at the source in browser you will see:
>
> <img src='http://www.mysite.com/img/111.jpg' />
>
> how can I show it like this:
>
> <img src='show.php?FileName=111.jpg' />

Change the URL to exactly what you typed and write a show.php script
that does a http://php.net/readfile on $FileName

You've missed a few minor bits and pieces, like $FileName never
actually gets pulled out of $row, but you're almost finished, except
for the debugging code and security issues:
http://phpsec.org/

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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

Reply via email to