You need create your own PHP API.
(A) VPS or Dedicated server machine:
+ Mu Server
+ MSSQL Dataserver
+ IIS (Apache) with security mod or any like this (IP filter for port 80)
(B) Website hosting (only need linux):
+ PHP Website with MySQL
(+ You can seperate Website (No database) and character CP)
Advantage:
Build PHP API Server, and place it on your
(A):
PHP API Server:
+ You can use GET or POST method, GET is recommended.
+ You need setup your own access token (for security)
+ Respond as JSON data (simple to filter data) or text/html
Place PHP API Client on (B):
+ Use cUrl (or ...) to make a GET or POST request to your API Server
+ Verify json data from your API Server, if true => alert success,...
Example register:
+ Server API, place (A):
PHP:
<?php
// API Server
// Include your database connector here
// Sample as $database
// Access token
$access_token = "ga45g6a5s4g3as31a5h9874g64a3s1fas32fasfasf65as4f6";
$account = $_GET['account'];
$password = $_GET['password'];
$email = $_GET['email'];
$personal_id = $_GET['personal_id'];
if($access_token != $_GET['token']) die('Cannot process');
function check_account_exist($account) {
// I am using basic method
$test = $database->query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='".$account."'");
if(isset($test['memb___id']) AND $test['memb___id'] == $account) {
return false;
}
return true;
}
if(check_account_exist($account)) {
$data = array(
"respond" => true
);
// Run INSERT Query to add new account here
} else {
$data = array(
"respond" => false,
"error_code" => 1
);
}
die(json_encode($data));
?>
+ Client API, place (B)
PHP:
<?php
if($_POST['submit']) {
// Example you already have cUrl class
// Call it as "cUrl_send"
$access_token = "ga45g6a5s4g3as31a5h9874g64a3s1fas32fasfasf65as4f6";
$data = cUrl_send("http://YOUR_SERVER_API_IP/register.php?account=".$_POST['account']."&password=".$_POST['password']."&email=".$_POST['email']."&personal_id=".$_POST['personal_id']."&token=".$access_token);
$data = json_decode($data);
if(isset($data) && is_array($data)) {
if($data['respond']) {
// Register success
} else {
// Failed, show error code
die("Failed, error code ". $data['error_code']);
}
}
else {
// Error
// Something like
die("Cannot connect to gameserver");
}
}
?>
<form method="POST">
<input name="account" type="text">
<input name="password" type="text">
<input name="email" type="text">
<input name="personal_id" type="text">
</form>
You need to add captcha.
Do not open MSSQL port as public.
Use this solution will help your server very very more security