Script PHP

03/02/2011 20:03 topazee#1
{Solved} Good evening,

do you have script for website Shaiya

as user online, pvp rank ...

because I 'and test the script are great but without success ...


exemple : [Only registered and activated users can see links. Click Here To Register...]

error :
Quote:
Players online: ".$online." Human: ".$human." Elf: ".$elf." Vail: ".$vail." DeathEater: ".$nordein." "; @mssql_close($link); ?>
03/02/2011 20:13 eQuiNoX.#2
Change the first line to <?php
03/02/2011 20:17 topazee#3
Quote:
Originally Posted by eQuiNoX. View Post
Change the first line to <?php
always the same worries
03/02/2011 20:18 topazee#4
Here is the complete script

Quote:
<?

$dbhost = $_ENV['LOCAL_DOMAIN'];
$dbuser = 'Shaiya';
$dbpwd = 'Shaiya123';

// connect to SQL server
if (!$link = @mssql_connect("$dbhost","$dbuser","$dbpwd"))
{
print "Failed to connect to MSSQL server.";
};

// select database
if (!@mssql_select_db("PS_GameData",$link))
{
print "Failed to select database.";
};

// check who's online
$result = @mssql_query("SELECT LoginStatus, Family FROM Chars WHERE LoginStatus=1",$link);

// initialize veriables
$online = @mssql_num_rows($result);
$human = 0;
$elf = 0;
$vail = 0;
$nordein = 0;

// fill variables with data (who's online)
while($row = @mssql_fetch_array($result,MSSQL_NUM))
{
if (@mssql_num_rows($result)==0) return;
switch($row[1])
{
case 0: $human++;break;
case 1: $elf++;break;
case 2: $vail++;break;
case 3: $nordein++;break;
};
};


@mssql_free_result($result);
// Print number of online players
print "<table style=\"border: 1px solid black;\">
<tr><td colspan=2>Players online: </td><td>".$online."</td></tr>
<tr><td>Human: </td><td>".$human."</td></tr>
<tr><td>Elf: </td><td>".$elf."</td></tr>
<tr><td>Vail: </td><td>".$vail."</td></tr>
<tr><td>DeathEater: </td><td>".$nordein."</td></tr>
</table>";

@mssql_close($link);

?>
03/02/2011 20:33 eQuiNoX.#5
Quote:
<?php

$dbhost = '127.0.0.1';
$dbuser = 'Shaiya';
$dbpwd = 'Shaiya123';

// connect to SQL server
if (!$link = @mssql_connect("$dbhost","$dbuser","$dbpwd"))
{
print "Failed to connect to MSSQL server.";
};

// select database
if (!@mssql_select_db("PS_GameData",$link))
{
print "Failed to select database.";
};

// check who's online
$result = @mssql_query("SELECT LoginStatus, Family FROM Chars WHERE LoginStatus=1",$link);

// initialize veriables
$online = @mssql_num_rows($result);
$human = 0;
$elf = 0;
$vail = 0;
$nordein = 0;

// fill variables with data (who's online)
while($row = @mssql_fetch_array($result,MSSQL_NUM))
{
if (@mssql_num_rows($result)==0) return;
switch($row[1])
{
case 0: $human++;break;
case 1: $elf++;break;
case 2: $vail++;break;
case 3: $nordein++;break;
};
};


@mssql_free_result($result);
// Print number of online players
print "<table style=\"border: 1px solid black;\">
<tr><td colspan=2>Players online: </td><td>".$online."</td></tr>
<tr><td>Human: </td><td>".$human."</td></tr>
<tr><td>Elf: </td><td>".$elf."</td></tr>
<tr><td>Vail: </td><td>".$vail."</td></tr>
<tr><td>DeathEater: </td><td>".$nordein."</td></tr>
</table>";

@mssql_close($link);

?>
Works fine for me. Have u installed php on ur server?
03/02/2011 20:41 topazee#6
I do not know how, I'm newbie in php
03/02/2011 20:44 topazee#7
I actually use web host (host) and creates the site (web creator)

if you have any software I am willing to offer me

SQL Server 2005 I do not know if the php function is activated
03/03/2011 00:09 Xx.LaMin.xX#8
yes you need to active the php function check in php.ini
03/03/2011 00:31 topazee#9
Quote:
Originally Posted by Xx.LaMin.xX View Post
yes you need to active the php function check in php.ini
Thanx, I have taken her myself but now easyphp a blank page I think that is because of intelligence on the databse


dbhost:
userhost:
pass:
03/03/2011 12:15 topazee#10
here is my worry now, I have a blank page

can you help me please?

thank you in advance for your help
03/04/2011 22:32 ProfNerwosol#11
I wrote that script a long time ago. It's very simple and credits would be welcome.

To see what is wrong post errors you get. There's nothing you posted so far that looks like a script problem.
03/11/2011 02:38 topazee#12
I am a beginner in php can you help me please
I got a blank page
03/15/2011 04:18 topazee#13
{Solved}

Pour tous ceux qui ont le meme probleme il faut telecharger wampserver + extension php.

ensuite ouvrir le port 80
03/15/2011 11:37 Shaiyalancia#14
Hi @ all,

I have the problem that iwas is set in the non-DB properly because I always only 1 player is displayed as Online.

What can be the error?

sorry for my bad English
03/15/2011 11:43 topazee#15
you try to redo the script to 0?

Quote:
sorry for my bad English
you speak french?