Hosting site off host and not computer.

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jan 24, 2007
Messages
49
Reaction score
0
Is it possible to host the website off a host and not the comp and still see the server status and etc.?
 
yeah just set your mysql connection IP to your WAN ip in config.inc.php (if your using rose CMS or somthing similar and forward port 3306
 
should work as long as your php code is correct.
Server Status is easy to do. I just have not tested rankings or database connect things but i don't see why not. Just make sure that your ip to the database is correct and your navicat has a account created in it.


Heres the code for remote server status useing online off line images.
Login server
Code:
$gameserv = @ fsockopen("ip to where its hosted",29000, $errno, $errstr, .5); 
if($gameserv) 
     $gameserv = '<img src="img/loginon.jpg">';
else 
    $gameserv ='<img src="img/Loginoff.jpg">';
echo $gameserv;
Char server
Code:
$gameserv = @ fsockopen("ip were hosted",29100, $errno, $errstr, .5); 
if($gameserv) 
     $gameserv = '<img src="img/charon.jpg">';
else 
    $gameserv ='<img src="img/charoff.jpg">';
echo $gameserv;
World Server
Code:
$gameserv = @ fsockopen("ip were hosted",29200, $errno, $errstr, .5); 
if($gameserv) 
     $gameserv = '<img src="img/worldon.jpg">';
else 
    $gameserv ='<img src="img/worldoff.jpg">';
echo $gameserv;
This was my next task i was gonna run the site from my web host but there down atm so im still working on that..


the code to connect to database would be something like this
Code:
<?
$connection = mysql_connect("ip were database is","id here","pass here") or die ("Couldn't Connect to the server.");

$db = mysql_select_db("database name here", $connection) or die ("Couldn't select database"); 
?>

save that info in a file called database.inc.php and put it in the folder with all the pages
for data base retrival you need to add

Code:
<?
require_once("database.inc.php");
?>
that code to the top of each page that pulls or sends info to the database..

Hope this helps I'm a noob at this.
thx Paul T for some help on this.
 
Status
Not open for further replies.
Back