Welcome to WebmasterWorld Guest from 184.108.40.206
The problem is, I don't know how to use "mid" essentially in PHP.
The returned values are:
How would I do that?
Basically, I want to link to a site without actually linking to it, so I have the following in my .htacccess:
RewriteRule ^offsite/([A-Za-z0-9_\ %\.\\-]+)$ redirect.php?site=$1
which will take any url, such as:
and pass it to redirect.php?site=thissite.com
redirect was going to(prior to my finding out it wouldn't always work) check the referrer and make sure it matched the host, so people can't just type in any url, it had to be coming from my site.
How else would you recommend I do this?
You could probably set up a cookie-based system to only allow the redirect if the user has been to a referring page within the last hour or two. It would take some work, though.
Or for another solution, you could store all of the links in a database, and refer to them with a code, like TinyURL does. That might be harder to maintain, but it would be most secure.
I would need an encyption alg. that others don't have access to. I guess I could md5 a text string with a timestamp, but that seems silly, really.
Any suggestions on the best way to implement the code version? (I would prefer a 4-5 digit code, if it has to be in the URL itself. such as: