Answer this PHP question and I'll Paypal you $5
QUESTION: I'm trying to figure out the best way to redirect a vistitor who types in my URL with a coupon code (see below) to another url with a variable populated. For example, when someone types the following:
http://www.mysite.com/A101
they are redirected to:
http://www.mysite.com/page.php?coupon=A101 (PREFERRED SOLUTION)
or to:
http://www.mysite.com where a form field is prepoulated with the A101 code so they only need to click a submit button
Right now the mysite.com/A101 is treated as a 404 and I tried to do a custom PHP to get the URL using SERVER_NAME and PHP_SELF but it's just showing the 404.php page. I don't want to have to create files/directories for A101 anywhere, it needs to dynamically do it.
I'm running on Apache/PHP
Thanks in advance!
(free membership and no email required for registration)
MuscularBrain.com: A Perfectionist's Thoughts on Self Development
Bored. Learn everything you need to know about Organic Gardening.