Logging in on different servers?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Terriator
Forum Commoner
Posts: 60
Joined: Mon Jul 04, 2005 12:46 pm

Logging in on different servers?

Post by Terriator »

Hey,

I own a textbased mmorpg, and I'm considering getting a secondary server, so that users can chose to log in on either server 1 or 2. How do I create a form on my main site, where users can chose "server 1" or "server 2" from a dropdown menu, and press login, whereafter they are redirected to the specific server?

Regards,
Terriator
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You can write a script that sends different header('Location: ....)s depending on the POST or GET parameter, see http://de3.php.net/header
Or even simpler: Have the login page/script on both servers and let the player choose before.

Code: Select all

choose server
<a href="http://server1.doma.in/login">Server 1</a> <a href="http://server2.doma.in/login">Server 2</a>
Maybe a bit prettier than that ;)
Post Reply