Re: munge / obfuscate ?

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

 



On 29 Mar 2008, at 02:15, Jack Sasportas wrote:
I understand what is happening here, however I really want something
simple like:

$link ="http://www.whataver.com/whateverpath/";;
$image = "123456";

new_image = munge($image);

new_link = $link . $new_image;

or maybe

new_link = munge($link . $image);


Which would encode the whole link.

Either way this is what would go into the email message we send out.

Encode in what way? What are you actually trying to stop people doing?

If all you're wanting to do is make sure people can't write a script that simply requests n.jpg over and over again with an incrementing n then all you need to do is obfuscate the filename when you store it on your server. You then store that filename in the database alongside the data it relates to.

$filename = sha1(time()).'.jpg';

Obviously that's just an example. You can generate the filename in any way you choose as long as you check for duplicates before using it.

If that's not the reason please explain exactly what you're trying to achieve rather than how you want to achieve it.

-Stut

--
http://stut.net/

--
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