Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   External IP, MSSQL and hosting. NEED HELP! (https://postpacific.loc-online.com/showthread.php?t=3605)

Namenlos 09.03.2006 18:16

External IP, MSSQL and hosting. NEED HELP!
 
I have got own external IP from my home net provider. (e.g. 2xx.xx2.1xx.xx)
I made online-status script (fsockopen ports 777 and 2106). Its work.
But online-players script isn't work. Look at...

[php:1:f26bce7492]

<?php

$mssql_db="lin2world";
$CONN = mssql_connect('xx.xxx.xx6.76', 'sa_login', 'password');
if ($CONN) {
mssql_select_db($mssql_db);
$result = mssql_query("exec playersnumber", $CONN);
$online=mssql_fetch_row($result);
$isplay = $online[0];
}
else {
$isplay = 0;
}
$FORM = "<font color=black>Players online:</font> $isplay
";
echo $FORM;
?>
[/php:1:f26bce7492]

Procedure Playersnumber into Lin2world
Code:

CREATE PROCEDURE [dbo].[playersnumber]
--@pl_number int output
AS
--SELECT @pl_number=count(*) FROM user_data WHERE login>logout AND logout>0 AND login>0
SELECT count(*) FROM user_data with (nolock) WHERE login>logout
GO

When i use my in LAN IP into LAN website, its show visitors how many players online now.
When i use my external IP and move this script to the hosting (another machine, not my network, just hosting) all HTML code under this script is INVISIBLE and did not show himself.

Question: what i have to do? How configurate MSSQL or my server to make this script avalible from internet, community with MSSQL server on MY computer from hosting?


/RUS

Короче, получил я от провайдера внешний IP. При подстановке сетевого IP в тот php скрипт, что я указал, из сети всё просматривается нормально. При выводе этого скрипта на другую машину (мастерхост хостинг) и подстановке вместо сетевого IP внешнего, всё что ниже php скрипта не отображается.

Вопрос в том ЧТО я делаю НЕ так, и как вообще настроить MSSQL для того, чтобы этот скрипт работал, и все скрипты подобного типа могли общаться с моим MSSQL с другой машины (например, с удаленного хостинга). Как что настраивать? Плиииз, нужна помощь.
RUS/

sct 09.03.2006 19:23

Wrong forum genius.

FidoW 09.03.2006 19:24

best solution.. i think... make a webserver in server side... like apache...
use similar script to get players online... (the best is in lin2db.world_user , not login>logout because when server go down... all online players show online forever...)...
and in external host use sockets to call script and get data...

and yes.. wrong forum.

Megatronpt 09.03.2006 19:27

Quote:

Originally Posted by FidoW
..use similar script to get players online... (the best is in lin2db.world_user , not login>logout because when server go down... all online players show online forever...)...

Well.. add a script like this:

[php:1:6dd58c7fef]<?php
require('config.php');

$query ="UPDATE user_data SET logout = getdate()";
$result = mssql_query($query);

if($result)
{
echoLn("Logout Time Fixed.");
}
?>[/php:1:6dd58c7fef]

sct 09.03.2006 19:30

Quote:

Originally Posted by Megatronpt
Quote:

Originally Posted by FidoW
..use similar script to get players online... (the best is in lin2db.world_user , not login>logout because when server go down... all online players show online forever...)...

Well.. add a script like this:

[php:1:1892e38cd0]<?php
require('config.php');

$query ="UPDATE user_data SET logout = getdate()";
$result = mssql_query($query);

if($result)
{
echoLn("Logout Time Fixed.");
}
?>[/php:1:1892e38cd0]

You can even set the field to NULL. But, like fidow said, world_user is easier. And it puts much less strain on your db.

hr 09.03.2006 19:39

1. lin_DeleteNotOwnedItem:
Code:

update lin2world.dbo.user_data set logout=getdate() where login>logout
2.
Code:

create procedure [dbo].[playersnumber]
as
select top 1 world_user from lin2db.dbo.user_count where server_id = 1 order by record_time desc
go

3. author check your firewall and mssql config, try to contact your provider
4. don't use sa login

Namenlos 09.03.2006 20:00

Quote:

Originally Posted by hr
1. lin_DeleteNotOwnedItem:
Code:

update lin2world.dbo.user_data set logout=getdate() where login>logout
2.
Code:

create procedure [dbo].[playersnumber]
as
select top 1 world_user from lin2db.dbo.user_count where server_id = 1 order by record_time desc
go

3. author check your firewall and mssql config, try to contact your provider
4. don't use sa login

Теперь по-русски! Поподробнее, пожалуйста!

Kenster 09.03.2006 22:01

LOL "NEED HELP"... Where does this go..... I think Modifications fourms? YEAH! Ill put it there.

Namenlos 09.03.2006 22:40

Quote:

Originally Posted by Kenster
LOL "NEED HELP"... Where does this go..... I think Modifications fourms? YEAH! Ill put it there.

May be i wanna make a modification for MSSQL =)

sct 09.03.2006 22:53

Still dont ask for help in the MODIFICATIONS ONLY forum.

once you finish your modification, you can post it here.

Namenlos 10.03.2006 06:10

Please, close it and delete!
I just moved my website domain to my IP.

Shawnmb 10.03.2006 07:51

So edit your original post, don't ask to have potentially useful information removed just because you made a retarded mistake.

Tim21 10.03.2006 17:24

Even when he posted it in the wrong topic then still this topic dont has to end in a flame war.

So leave your damm ego behind you for godsake and KEEP on Topic.

Truffe 10.03.2006 18:45

Moved and warned.


All times are GMT. The time now is 15:25.