PHP:
<?php
// =====================
// Ñáîğíèê ôóíêöèé è ïğ.
// =====================
$img_serv='http://mysql.bedavahost.biz/';
$gamename='TheWorld';
$redirect="top.frames['main_top'].location='main.php';";
$quit="top.location='index.php';";
// Íàçâàíèå êóêè
@DEFINE('AP','\'');
// Äàííûå äëÿ äîñòóïà ê ÁÄ
@DEFINE('DB_HOST','mysql.bedavahost.biz');
@DEFINE('DB_USER','DB KULLANICI ADIM');
@DEFINE('DB_PASS','DB SİFREM');
@DEFINE('DB_NAME','DB ADIM');
$db_link = 0;
function redirect($url)
{
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'">';
die;
}
// Ïğîöåäóğà, âûâîäèò ñîîáùåíèå îá îøèáêå è êîğğåêòíî ïåğåíàïğàâëÿåò
// ïîëüçîâàòåëÿ íà ãëàâíóş ñòğàíèöó
function goto_error($err_text)
{
echo '<b>Ğåæèì îòëàäêè: </b><br>'.$err_text.'<br><INPUT TYPE="button" VALUE="Íàçàä" onClick="history.back()">';
die;
}
// Îòêğûâàåò ñîåäèíåíèå ñ áàçîé äàííûõ, ïğàâèëüíî îáğàáàòûâàåò ñèòóàöèş,
// êîãäà ñîåäèíåíèå áûëî îòêğûòî íåñêîëüêî ğàç
function db_open()
{ // Îòêğûâàåì ñîåäèíåíèå ñ áàçîé äàííûõ
global $db_link;
if($db_link==0) // Ïğîâåğêà, áûëî-ëè ñîåäèíåíèå óæå îòêğûòî... ìîæíî óáğàòü
{
"$db_link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or goto_error(mysql_error());"
mysql_select_db(DB_NAME) or goto_error(mysql_error());
}
mysql_query("SET NAMES cp1251");
}
// Ïîñûëàåò çàïğîñ ê áàçå äàííûõ
function db_query($str)
{ // Âûïîëíÿåì çàïğîñ áàçå äàííûõ
global $db_result;
$db_result = mysql_query($str) or goto_error(mysql_error());
}
// Îáğàáàòûâàåò ğåçóëüòàò çàïğîñà
function db_fetch()
{ // Äåëèì ñòğîêó...
global $db_result;
$str = mysql_fetch_array($db_result, MYSQL_ASSOC);
return $str;
}
function db_quer($table,$filter)
{ $str='SELECT * FROM '.$table.' WHERE '.$filter;
//echo $str; die;
$db_result = mysql_query($str) or goto_error(mysql_error());
$str2 = mysql_fetch_array($db_result);
return $str2;
}
// Äóáëèğîâàíèå ôóíêöèè äëÿ âëîæåííûõ çàïğîñîâ
function db_query2($str){global $db_result2; $db_result2 = mysql_query($str) or goto_error(mysql_error());}
function db_fetch2(){global $db_result2; $str = mysql_fetch_array($db_result2, MYSQL_ASSOC); return $str; }
// Ïğîâåğÿåì àâòîğèçîâàí-ëè ïîëüçîâàòåëü â èãğå..
// Åñëè äà, òî âîçâğàùàåì õıø ïîëüçîâàòåëÿ
function check_auth()
{ global $my;
if(isset($_COOKIE[cookname]))
{
$my['pass'] = $_COOKIE[cookname];
}else{
goto_error_global('Âû íå àâòîğèçîâàíû â èãğå!');
} }
// Ôóíêöèÿ ğàññ÷åòà âğåìåíè ãåíåğàöèè ñòğàíè÷êè
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function testchr($text)
{
$vchar[] = chr(32); $vchar[] = chr(33); $vchar[] = chr(36); $vchar[] = chr(38); $vchar[] = chr(91); $vchar[] = chr(93); $vchar[] = chr(95); $vchar[] = chr(126);
for($i = 40; $i != 58; $i++) {if ($i!=44 && $i!=46 && $i!=47){ $vchar[] = chr($i);}}
for($i = 64; $i != 91; $i++) {$vchar[] = chr($i);}
for($i = 97; $i != 123; $i++) {$vchar[] = chr($i);}
for($i = 192; $i != 256; $i++) {$vchar[] = chr($i);}
for ($i=0; $i<strlen($text); $i++) {
if (!in_array($text[$i],$vchar)) { $test=1; break; }else{$test=0;}
}
return $test;
}
function testchat($msg)
{
$mat= array("http://","www.",".ru",".com",".net",".info","õóé","ïèçäà","ñóêà","áëÿäü","áëÿ" );
for ($i=0; $i<strlen($msg); $i++) {
if (!in_array($msg[$i],$mat)) { $test=0; break; }else{$test=1;}
}
return $test;
}
function scod()
{
$cod=md5(rand(100,10000));
$_SESSION['secur'][]=$cod;
print $cod;
}
function scode()
{
$cod=md5(rand(100,10000));
$_SESSION['secur'][]=$cod;
return $cod;
}
?>
Arkadaslar önce kolay gelsin herkese... Maalesef hatam yine bu konudan.Cok konu inceledim ama bir turlu cozum bulamadım.
PHP:
Parse error: syntax error, unexpected T_STRING in /home/u*********/public_html/func/connect.php on line 43
Lütfen bana bi kodlayın.İlgi gosteren arkadaslara tesekkur ediyorum.