Mantvydas
Narys
Patrankų mėsa
Pranešimai: 7
Įstojęs: 2008 Lie. 14 16:07:37
|
Sveiki,
bandau sukurti serveriu lista, padarau subdomena, idedu reikiamus failus, bet ismeta klaida:
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/*******/domains/******/public_html/serveriai/index.php on line 261
Gal kas buvot susidure su sia beda? Prasau padekit
|
tabux
Narys
Buldozeris
Pranešimai: 219
Įstojęs: 2007 Lie. 14 11:07:21
|
o tai kas rasoma index.php 261 eiluteje?
|
Zixx
Narys
Nuolatinis
Pranešimai: 162
Įstojęs: 2007 Rugs. 8 19:09:48
|
Errora issiversk: At reading initial - Kazkokia klaida nuskaitant inicial1-simbolĮ ,bent jau manau a
WKO tm |
kiskiss
Narys
Terminatorius
Pranešimai: 1545
Įstojęs: 2006 Rugs. 11 17:09:58
|
Klaida 261 eilutėje
|
Zixx
Narys
Nuolatinis
Pranešimai: 162
Įstojęs: 2007 Rugs. 8 19:09:48
|
Žmogau, čia ir taip aišku.. Jis žalias.. Jam kad pasakei kur nieko nepadės..Viska ištrins ir klaidą paliks..
Įmesk savo tą eilutę čia, patvarkysim
WKO tm |
Mantvydas
Narys
Patrankų mėsa
Pranešimai: 7
Įstojęs: 2008 Lie. 14 16:07:37
|
$db = mysql_connect($hostas, $useris, $passas) or die("<center><b>Laikinos serverio problemos</b></center>") or die("<center><b>Laikinos serverio problemos</b></center>");
Stai toji eilute, zinau kad cia klaida, bet nesuprantu kur.. Juk cia viskas atrodo gerai.
|
Arnelis
Narys
Kapitonas
Pranešimai: 596
Įstojęs: 2008 Bir. 16 10:06:18
|
Blogai gal suvedes duomenis esi mysql.
|
tabux
Narys
Buldozeris
Pranešimai: 219
Įstojęs: 2007 Lie. 14 11:07:21
|
bandyk toki koda $db = mysql_connect($hostas, $useris, $passas);
if(mysql_connect_error()){
printf("<center><b>Laikinos serverio problemos</b></center>");
exit();
}
|
Mantvydas
Narys
Patrankų mėsa
Pranešimai: 7
Įstojęs: 2008 Lie. 14 16:07:37
|
Dekui, bet neveikia, ismeta dar viena klaida del 262 eilutes
|
tabux
Narys
Buldozeris
Pranešimai: 219
Įstojęs: 2007 Lie. 14 11:07:21
|
tai tu visa koda ikelk ir pasiziuresiu kas ten ne taip
|
Mantvydas
Narys
Patrankų mėsa
Pranešimai: 7
Įstojęs: 2008 Lie. 14 16:07:37
|
<html>
<head>
<title>Server List</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body bgimage="bg.jpg" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" text="#FFFFFF">
<center><img src=images/theme/head.jpg></center>
<?php
$starttime = microtime();
$startarray = explode(" ", $starttime);
$starttime = $startarray[1] + $startarray[0];
?>
<?php
include "configas.php";
error_log(0);
function show_server($ip, $port, $big, $blod){
include "locale.php";
$maxlongname = 70;
$maxlongnamesmall = 40;
if($server = @fsockopen("udp://".$ip,$port,$errno,$errstr)){
$write = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
socket_set_timeout($server,1);
$time_in = microtime_float();
fwrite($server, $write);
$server_response = fread($server,4096);
$time_out = microtime_float();
if ($server_response) {
$server_ping = (int)(($time_out-$time_in)*1000);
$server_response = substr($server_response, 5);
$server_address = get_value_string($server_response);
$server_host_name = get_value_string($server_response);
$map = get_value_string($server_response);
$gamedir = get_value_string($server_response);
$gamename = get_value_string($server_response);
$count_players = get_value_byte($server_response);
$maxplayers = get_value_byte($server_response);
$netver = get_value_byte($server_response);
$dedicated = get_value_byte($server_response);
$os = get_value_byte($server_response);
$pass = get_value_byte($server_response);
$skip = get_value_byte($server_response);
$skip = get_value_string($server_response);
$skip = get_value_string($server_response);
$skip = get_value_string($server_response);
$skip = get_value_lint($server_response);
$skip = get_value_lint($server_response);
$skip = get_value_byte($server_response);
$skip = get_value_byte($server_response);
$secure = get_value_byte($server_response);
$bots = get_value_byte($server_response);
$players = "$count_players / $maxplayers";
if($big == 1){
if (file_exists("images/".$map.".jpg")){$map_image = "<img src='images/".$map.".jpg' class='img2'>";}else{$map_image = "<img src='images/nera.jpg' class='img2'>";}
echo "<br>\n";
echo "<table class='bgbigo' width='700' align='center'>\n<tr>\n<td>\n";
echo "<table width='100%' align='center' border='0'>\n";
echo "<tr>\n";
echo "<td rowspan='7' width='160'>\n";
echo $map_image."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[pavadinimas];
echo "</td>\n";
echo "<td>\n";
if (strlen($server_host_name) > $maxlongname){
$server_host_namesmall = substr($server_host_name, 0, $maxlongname - 3) . "...";
}else{
$server_host_namesmall = $server_host_name;
}
echo $server_host_namesmall."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td >";
echo $locale[adresas];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($ip).":".htmlspecialchars($port)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[zaidejai];
echo "</td\n>";
echo "<td>\n";
echo htmlspecialchars($players)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[zemelapis];
echo "</td>\n";
echo "<td >\n";
echo htmlspecialchars($map)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[pingas];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($server_ping)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[protokolas];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($netver)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n</tr>\n</table>\n<br>\n";
}
if($big == 0){
if (strlen($server_host_name) > $maxlongnamesmall){
$server_host_namesmall = substr($server_host_name, 0, $maxlongnamesmall - 3) . "...";
}else{
$server_host_namesmall = $server_host_name;
}
echo "<tr>\n";
echo "<td class='list_row1'>\n";
echo "<center><img src='images/theme/cstrike.gif'></center>\n";
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo htmlspecialchars($server_host_namesmall)."\n";
blodclose($blod);
echo "</td>";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo htmlspecialchars($ip).":".htmlspecialchars($port)."\n";
blodclose($blod);
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo htmlspecialchars($map)."\n";
blodclose($blod);
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo "<center>".htmlspecialchars($players)."</center>\n";
blodclose($blod);
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo "<center>".htmlspecialchars($server_ping)."</center>\n";
blodclose($blod);
echo "</td>\n";
echo "<tr>\n";
}
}
}
}
function get_value_byte(&$data){
$temp = $data[0];
$data = substr($data, 1);
return ord($temp);
}
function get_value_string(&$data){
$temp = '';
$i = 0;
while (ord($data[$i]) != 0){
$temp .= $data[$i];
$i++;
}
$data = substr($data, $i+1);
return $temp;
}
function get_value_sint(&$data){
$temp = substr($data, 0, 2);
$data = substr($data, 2);
$array = @unpack('Sshort', $temp);
return $array['short'];
}
function get_value_lint(&$data){
$temp = substr($data, 0, 4);
$data = substr($data, 4);
$array = @unpack('Lint', $temp);
return $array['int'];
}
function get_value_float(&$data){
$temp = substr($data, 0, 4);
$data = substr($data, 4);
$array = @unpack('ffloat', $temp);
return $array['float'];
}
function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
function blodopen($blod){
if($blod == "1"){
echo "<font color='#CC0000'><b>";
}}
function blodclose($blod){
if($blod == "1"){
echo "</font></b>";
}}
//Gaunam serveriu duomenis is msql ir bandom juos isvesti xD
function dbarray($query) {
$result = @mysql_fetch_assoc($query);
if (!$result) {
echo mysql_error();
return false;
} else {
return $result;
}
}
function dbcount($field,$table,$conditions="") {
$cond = ($conditions ? " WHERE ".$conditions : "");
$result = @mysql_query("SELECT Count".$field." FROM ".DB_PREFIX.$table.$cond);
if (!$result) {
echo mysql_error();
return false;
} else {
$rows = mysql_result($result, 0);
return $rows;
}
}
$db = mysql_connect($hostas, $useris, $passas);
if(mysql_connect_error()){
printf("<center><b>Laikinos serverio problemos</b></center>");
exit();
}
mysql_select_db($dbas) or die("<center><b>Laikinos serverio problemos 2</b></center>");
$snddata = mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
$goas = mysql_query("DELETE FROM ".$fusionoprefixas."money_servers WHERE `galiojaiki` < '".$snddata."'");
$serveriai1 = mysql_query("SELECT * FROM ".$fusionoprefixas."money_servers WHERE `tipas` = 1 and `galiojaiki` > ".$snddata." ORDER BY galiojaiki DESC");
if(!$serveriai1)
{
}else{
while($serverio1 = dbarray($serveriai1))
{
show_server($serverio1[serverip], $serverio1[serveroprt], "1", "0");
}
}
echo "<table cellpadding='3' cellspacing='0' class='list_table' width='700' align='center'>\n";
echo "<tr>\n<td class='list_row1'> </td>\n<td class='list_row1'><center>Serverio pavadinimas:</center></td>\n<td class='list_row1'><center>Ip:</center></td>\n<td class='list_row1'><center>Zemelapis:</center></td>\n<td class='list_row1'><center>Zaidejai:</center></td>\n<td class='list_row1'><center>Pingas:</center></td>\n</tr>\n";
$serveriai = mysql_query("SELECT * FROM ".$fusionoprefixas."money_servers WHERE `tipas` = '0' and `galiojaiki` > ".$snddata." ORDER BY galiojaiki DESC") or die("<center><b>Laikinos serverio problemos</b</center>");
while($serverio = dbarray($serveriai))
{
show_server($serverio[serverip], $serverio[serveroprt], "0", "0");
}
mysql_close($db);
echo "</table>";
?>
<?php
$endtime = microtime();
$endarray = explode(" ", $endtime);
$endtime = $endarray[1] + $endarray[0];
$totaltime = $endtime - $starttime;
$totaltime = round($totaltime,0);
?>
</body>
</html>
<br>
<center><font size="-4" color="#ffffff" face="Tahoma">© 2008. Visos teisės saugomos.<br></font><a href=""><font size="-4" color="#ffffff" face="Tahoma"></font></a></center>
Visas index.php
configas.php :
<?php
$hostas = "mysql.hostingas.in";
$useris = "***_servers";
$passas = "db_pass";
$dbas = "***_gmg";
$fusionoprefixas = "fusion_php";
?>
|
tabux
Narys
Buldozeris
Pranešimai: 219
Įstojęs: 2007 Lie. 14 11:07:21
|
na ka bandyk dar karta <html>
<head>
<title>Server List</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body bgimage="bg.jpg" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" text="#FFFFFF">
<center><img src=images/theme/head.jpg></center>
<?php
$starttime = microtime();
$startarray = explode(" ", $starttime);
$starttime = $startarray[1] + $startarray[0];
?>
<?php
include "configas.php";
error_log(0);
function show_server($ip, $port, $big, $blod){
include "locale.php";
$maxlongname = 70;
$maxlongnamesmall = 40;
if($server = @fsockopen("udp://".$ip,$port,$errno,$errstr)){
$write = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
socket_set_timeout($server,1);
$time_in = microtime_float();
fwrite($server, $write);
$server_response = fread($server,4096);
$time_out = microtime_float();
if ($server_response) {
$server_ping = (int)(($time_out-$time_in)*1000);
$server_response = substr($server_response, 5);
$server_address = get_value_string($server_response);
$server_host_name = get_value_string($server_response);
$map = get_value_string($server_response);
$gamedir = get_value_string($server_response);
$gamename = get_value_string($server_response);
$count_players = get_value_byte($server_response);
$maxplayers = get_value_byte($server_response);
$netver = get_value_byte($server_response);
$dedicated = get_value_byte($server_response);
$os = get_value_byte($server_response);
$pass = get_value_byte($server_response);
$skip = get_value_byte($server_response);
$skip = get_value_string($server_response);
$skip = get_value_string($server_response);
$skip = get_value_string($server_response);
$skip = get_value_lint($server_response);
$skip = get_value_lint($server_response);
$skip = get_value_byte($server_response);
$skip = get_value_byte($server_response);
$secure = get_value_byte($server_response);
$bots = get_value_byte($server_response);
$players = "$count_players / $maxplayers";
if($big == 1){
if (file_exists("images/".$map.".jpg"){$map_image = "<img src='images/".$map.".jpg' class='img2'>";}else{$map_image = "<img src='images/nera.jpg' class='img2'>";}
echo "<br>\n";
echo "<table class='bgbigo' width='700' align='center'>\n<tr>\n<td>\n";
echo "<table width='100%' align='center' border='0'>\n";
echo "<tr>\n";
echo "<td rowspan='7' width='160'>\n";
echo $map_image."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[pavadinimas];
echo "</td>\n";
echo "<td>\n";
if (strlen($server_host_name) > $maxlongname){
$server_host_namesmall = substr($server_host_name, 0, $maxlongname - 3) . "...");
}else{
$server_host_namesmall = $server_host_name;
}
echo $server_host_namesmall."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>";
echo $locale[adresas];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($ip).":".htmlspecialchars($port)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[zaidejai];
echo "</td\n>";
echo "<td>\n";
echo htmlspecialchars($players)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[zemelapis];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($map)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[pingas];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($server_ping)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo $locale[protokolas];
echo "</td>\n";
echo "<td>\n";
echo htmlspecialchars($netver)."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n</tr>\n</table>\n<br>\n";
}
if($big == 0){
if (strlen($server_host_name) > $maxlongnamesmall){
$server_host_namesmall = substr($server_host_name, 0, $maxlongnamesmall - 3) . "...";
}else{
$server_host_namesmall = $server_host_name;
}
echo "<tr>\n";
echo "<td class='list_row1'>\n";
echo "<center><img src='images/theme/cstrike.gif'></center>\n";
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo htmlspecialchars($server_host_namesmall)."\n";
blodclose($blod);
echo "</td>";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo htmlspecialchars($ip).":".htmlspecialchars($port)."\n";
blodclose($blod);
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo htmlspecialchars($map)."\n";
blodclose($blod);
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo "<center>".htmlspecialchars($players)."</center>\n";
blodclose($blod);
echo "</td>\n";
echo "<td class='list_row1'>\n";
blodopen($blod);
echo "<center>".htmlspecialchars($server_ping)."</center>\n";
blodclose($blod);
echo "</td>\n";
echo "<tr>\n";
}
}
}
}
function get_value_byte(&$data){
$temp = $data[0];
$data = substr($data, 1);
return ord($temp);
}
function get_value_string(&$data){
$temp = '';
$i = 0;
while (ord($data[$i]) != 0){
$temp .= $data[$i];
$i++;
}
$data = substr($data, $i+1);
return $temp;
}
function get_value_sint(&$data){
$temp = substr($data, 0, 2);
$data = substr($data, 2);
$array = @unpack('Sshort', $temp);
return $array['short'];
}
function get_value_lint(&$data){
$temp = substr($data, 0, 4);
$data = substr($data, 4);
$array = @unpack('Lint', $temp);
return $array['int'];
}
function get_value_float(&$data){
$temp = substr($data, 0, 4);
$data = substr($data, 4);
$array = @unpack('ffloat', $temp);
return $array['float'];
}
function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
function blodopen($blod){
if($blod == "1"{
echo "<font color='#CC0000'><b>";
}}
function blodclose($blod){
if($blod == "1"{
echo "</font></b>";
}}
//Gaunam serveriu duomenis is msql ir bandom juos isvesti xD
function dbarray($query) {
$result = @mysql_fetch_assoc($query);
if (!$result) {
echo mysql_error();
return false;
} else {
return $result;
}
}
function dbcount($field,$table,$conditions="") {
$cond = ($conditions ? " WHERE ".$conditions : "";
$result = @mysql_query("SELECT Count".$field." FROM ".DB_PREFIX.$table.$cond);
if (!$result) {
echo mysql_error();
return false;
} else {
$rows = mysql_result($result, 0);
return $rows;
}
}
$db = mysql_connect($hostas, $useris, $passas);
if(mysql_connect_error()){
printf("<center><b>Laikinos serverio problemos</b></center>)";
exit();
}else{
mysql_select_db($dbas);
}
$snddata = mktime(date("H",date("i",date("s",date("m",date("d",date("Y");
$goas = mysql_query("DELETE FROM ".$fusionoprefixas."money_servers WHERE 'galiojaiki' < '".$snddata."'");
$serveriai1 = mysql_query("SELECT * FROM ".$fusionoprefixas."money_servers WHERE 'tipas' = 1 and 'galiojaiki' > ".$snddata." ORDER BY galiojaiki DESC");
if(!$serveriai1)
{
}else{
while($serverio1 = dbarray($serveriai1))
{
show_server($serverio1[serverip], $serverio1[serveroprt], "1", "0";
}
}
echo "<table cellpadding='3' cellspacing='0' class='list_table' width='700' align='center'>\n";
echo "<tr>\n<td class='list_row1'> </td>\n<td class='list_row1'><center>Serverio pavadinimas:</center></td>\n<td class='list_row1'><center>Ip:</center></td>\n<td class='list_row1'><center>Zemelapis:</center></td>\n<td class='list_row1'><center>Zaidejai:</center></td>\n<td class='list_row1'><center>Pingas:</center></td>\n</tr>\n";
$serveriai = mysql_query("SELECT * FROM ".$fusionoprefixas."money_servers WHERE `tipas` = '0' and `galiojaiki` > ".$snddata." ORDER BY galiojaiki DESC" or die("<center><b>Laikinos serverio problemos</b</center>");
while($serverio = dbarray($serveriai))
{
show_server($serverio[serverip], $serverio[serveroprt], "0", "0";
}
mysql_close($d);
echo "</table>";
?>
<?php
$endtime = microtime();
$endarray = explode(" ", $endtime);
$endtime = $endarray[1] + $endarray[0];
$totaltime = $endtime - $starttime;
$totaltime = round($totaltime,0);
?>
</body>
</html>
<br>
<center><font size="-4" color="#ffffff" face="Tahoma">© 2008. Visos teises saugomos.<br></font><a href=""><font size="-4" color="#ffffff" face="Tahoma"></font></a></center>
|
Fucikijoooou
Narys
Buldozeris
Pranešimai: 260
Įstojęs: 2008 Lie. 30 01:07:51
|
Cia tavo duombazes nustatymai klaidyngi paziurek ar viska gerai suvedei
gal prefix'ai skirtyngi ?
Fucikijoooo.!!;] :) |
Rytis
Narys
Tankas
Pranešimai: 2258
Įstojęs: 2006 Sau. 13 17:01:49
|
$hostas = "mysql.hostingas.in";
???
Turėtų būti mysqlhost
|