Use PHP to authenticate information in a MySQL database from an external server $conn = mysql_connect('external-server.hostname.example.com', $user, $password); mysql_select_db($database_name); GRANT SELECT ON databasename.tablename TO `webserveruser`@`webserver-hostname` IDENTIFIED BY 'thepassword'; http://www.myhostingservice.com/refer/80ddca50-f41e-11e0-be50-0800200c9a66/
// Get the form data if ($_POST['do_validation']) { // The correct form was posted, get the form data $username = mysql_real_escape_string($_POST['username_input']); $password = mysql_real_escape_string($_POST['password_input']); // Connect to the database mysql_connect ("http://91.0.0.1", "myUsername", "myPassword"); // Select database mysql_select_db('remote_table_name'); // Check the username and password against database $check_credentials = mysql_query("SELECT user_id FROM users WHERE username='$username' AND password='$password'"); // Check that user exists if (mysql_num_rows($check_credentials) == 1) { $existing_user = mysql_fetch_assoc($check_credentials); $existing_user_id = $existing_user_id['user_id']; // The user exists, now get ID of posts from another table, using their 'user_id' $check_posts = mysql_query("SELECT post_id FROM posts WHERE user_id='$existing_user_id'"); // Check the number of posts is at least 100 if ($check_posts >= 100) { // The user has 100 posts OR MORE echo "You are a valid user"; // Here you could start a session for the user (logging them in), and then show the data that you want session_start(); // Store the user_id of the user in a SESSION $_SESSION['user_id'] = $existing_user_id; } } }