Welcome to WebmasterWorld Guest from 188.8.131.52
I have been researching the header location function and I can't seem to find an answer to my question. I do not know if I am asking this right, but is there a way to do this...
Say you have your site http://example.com
Whenever a user clicks a game, he goes to example.com/game/...
When the user clicks the "play game" button, he goes to play the game at say example.com/playgame/...
Now there are multiple games on the site so every game goes from arcade.com/game/... to example.com/playgame/...
Is there a way to use the header location function to send a user to multiple sites?
For example... The user is at example.com/game/1. He clicks the game and is forwarded on to another site to play the game. A different user is also on and is at example.com/game/2. He clicks the game to play and is forwarded on to a different site to play his game.
Is there a way to do this using the header location function? If so, where could I read up more about it?
Thanks for the help,
[edited by: eelixduppy at 8:25 pm (utc) on Nov. 28, 2008]
[edit reason] exemplified [/edit]
If you have your criteria, this is roughly as follows:
$loc = "http://www.site1.com/game1/";
$loc = "http://www.site2.com/game1/";
$loc = "http://www.siteX.com/gameX/";
If this is the case, would the above code do this or is there something else that I would need?
$playgame = "http://www.mysite.com/playgame.php?id=123";
$url = "http://www.example.com";
Here is what I get stuck. I want the next part of the code to keep the user at my site and let them play the game on my site. So is there some else function I could include such as...
header("location: Keep the person at my site");
exit/break; (whichever would be best)
Obviously, as I said, I am not very good with php, so I understand most of this doesn't work. I am just looking for a direction to go in.
What you are looking for is some form of a proxy system - a simple one would run:
Where a visitor to:
Would see the content of foo.bar/game, but the URL remaining within example.com
However - I don't recommend this - and it opens up big holes for copyright liability and being abused by black-hat SEO companies.
However - I still don't know what's wrong with giving them a direct link, as the moment they click your one they will go to the other guy's site anyway - and that includes their URL bar changing to his site.
Is this so they don't know they are going to be sent away?
My script was purchased so its more advanced than what I know. It connects to my database and finds the correct game to play and what not. I don't know how to define a direct link for a specific game using the script I have, thats all. So I just decided that using the header location function would be easiest for me.