GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How can I insert a long, random string into an Img Url (https://gfy.com/showthread.php?t=707242)

fuzzylogic 02-17-2007 02:23 PM

How can I insert a long, random string into an Img Url
 
like this:
http://mofo-domain/DSK20070217063051...V/mofo-img.jpg

Nookster 02-17-2007 03:06 PM

$solution = $PHP + .htaccess;

SmokeyTheBear 02-17-2007 06:39 PM

lotsa ways , depends on how your using it..

if you put an htacess in a folder called "stb" like this
RewriteEngine on
RewriteRule ^(.*)\.jpg http://www.yoursite.com/stb/img.php?in=$1 [nc]

then in img.php in the same folder

<?php
$ein = explode("/",$in);
$out = $ein[1];
header("Location: http://yoursite.com/secretfolder/$out.jpg");
?>

That would turn

yoursite.com/stb/jg7y7iyikuiu6ujk7/test.jpg
turn into
yoursite.com/secretfolder/test.jpg

quantum-x 02-17-2007 06:58 PM

All due props to smokey, but had to chime in - don't rely on the code above for anything valugely security related
By using Location, your brower makes the request to the 'secretfolder' - so finding out the secret folder is trivial. If that's not a problem, then you're sweet.

Would be much faster to do a plain rewrite, though..


All times are GMT -7. The time now is 07:12 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123