Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 09.03.2006, 18:16   #1
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default 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/
Namenlos is offline  
Old 09.03.2006, 19:23   #2
sct
Архивный участник
 
Join Date: Nov 2005
Posts: 70
Default

Wrong forum genius.
sct is offline  
Old 09.03.2006, 19:24   #3
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

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.
FidoW is offline  
Old 09.03.2006, 19:27   #4
Megatronpt
Архивный участник
 
Join Date: Jan 2006
Posts: 584
Default

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]
Megatronpt is offline  
Old 09.03.2006, 19:30   #5
sct
Архивный участник
 
Join Date: Nov 2005
Posts: 70
Default

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.
sct is offline  
Old 09.03.2006, 19:39   #6
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

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
hr is offline  
Old 09.03.2006, 20:00   #7
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

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
Теперь по-русски! Поподробнее, пожалуйста!
Namenlos is offline  
Old 09.03.2006, 22:01   #8
Kenster
Архивный участник
 
Join Date: Sep 2005
Posts: 455
Default

LOL "NEED HELP"... Where does this go..... I think Modifications fourms? YEAH! Ill put it there.
Kenster is offline  
Old 09.03.2006, 22:40   #9
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

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 =)
Namenlos is offline  
Old 09.03.2006, 22:53   #10
sct
Архивный участник
 
Join Date: Nov 2005
Posts: 70
Default

Still dont ask for help in the MODIFICATIONS ONLY forum.

once you finish your modification, you can post it here.
sct is offline  
Old 10.03.2006, 06:10   #11
Namenlos
Архивный участник
 
Join Date: Mar 2006
Posts: 160
Default

Please, close it and delete!
I just moved my website domain to my IP.
Namenlos is offline  
Old 10.03.2006, 07:51   #12
Shawnmb
Архивный участник
 
Join Date: Feb 2005
Posts: 307
Default

So edit your original post, don't ask to have potentially useful information removed just because you made a retarded mistake.
Shawnmb is offline  
Old 10.03.2006, 17:24   #13
Tim21
Архивный участник
 
Join Date: Aug 2005
Posts: 30
Default

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.
Tim21 is offline  
Old 10.03.2006, 18:45   #14
Truffe
Архивный участник
 
Join Date: May 2005
Posts: 944
Default

Moved and warned.
Truffe is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 16:17.