Zdravím nedávno som si stiahol jednú CSGO stránku kde by mal fungovať aj chat. Ale mne nefunguje a neviem prečo mám nainštalované php5,apache2,mysql proste všetko čo to potrebuje a nefunguje mám aj nachmodovane 777 /var/www/html všetky súbory a aj tak nefunguje ale ked som skusil web/chat/chat.php tak to píše interval error 500 takže asi chyba v kode neviete mi pomôcť ?
chat.php
<?php
$file = "chat/chat.txt";
$f = file($file);
$lines = count(file($file));
include_once("\link.php");
$admin = fetchinfo("admin","users","steamid",$_SESSION["steamid"]);
for($i=$lines-25; $i!=$lines; $i++){
if($i>=0){
echo "<div style='border-bottom: dotted 1px #DCDCDC; display:flex'>".$f[$i]."</div>";
}
}
?>
process.php
<?php
$function = $_POST['function'];
$log = array();
switch($function) {
case('getState'):
if(file_exists('chat.txt')){
$lines = file('chat.txt');
}
$log['state'] = count($lines);
break;
case('update'):
$state = $_POST['state'];
if(file_exists('chat.txt')){
$lines = file('chat.txt');
}
$count = count($lines);
if($state == $count){
$log['state'] = $state;
$log['text'] = false;
}
else{
$text= array();
$log['state'] = $state + count($lines) - $state;
foreach ($lines as $line_num => $line)
{
if($line_num >= $state){
$text[] = $line = str_replace("\n", "", $line);
}
}
$log['text'] = $text;
}
break;
case('send'):
$nickname = $_POST['nickname'];
$ava = $_POST['ava'];
$steamid = $_POST['id'];
$admin = $_POST['admin'];
$premium = $_POST['premium'];
include_once("..\link.php");
$admin = fetchinfo("admin","users","steamid",$_SESSION["steamid"]);
$premium = fetchinfo("premium","users","steamid",$_SESSION["steamid"]);
$dbname = fetchinfo("name","users","steamid",$_SESSION["steamid"]);
$dbava = fetchinfo("avatar","users","steamid",$_SESSION["steamid"]);
$lastmsg = fetchinfo("lastmsg","users","steamid",$_SESSION["steamid"]);
$cban = fetchinfo("cban","users","steamid",$_SESSION["steamid"]);
$bnmsg = fetchinfo("value","info","name","nmsg");
$bpmsg = fetchinfo("value","info","name","pmsg");
$time=time();
$nmsg=$time+$bnmsg;
$pmsg=$time+$bpmsg;
$message = htmlentities(strip_tags($_POST['message']));
if(($message) != "\n" && $message != "" && $message != " " && $message != " " && $message != " " && $message != " ")
{
if($admin == "1" || $admin == 1)
{
$color='ff0000';
fwrite(fopen('chat.txt', 'a+'), "<a href='profile.php?action=view&id=".$steamid."'><img src='".$ava."' height='50' width='50'></img></a><p style='float: right;width: 210px;overflow-wrap: break-word;padding: 3px;padding-left: 13px;'><a class='nameclick' style='color:#".$color."' target='_blank' href='profile.php?action=view&id=".$steamid."'>".$nickname."</a><br><a style='display: block;margin-top: 5px;'>".$message = str_replace("\n", " ", $message)."</a></p><a href='index.php?action=cban&id=$steamid' class='ban' style='display:none'></a><script>document.getElementById('chat-wrap').scrollTop = document.getElementById('chat-wrap').scrollHeight;</script> \n");
mysql_query("UPDATE `users` SET `lastmsg`='$nmsg' WHERE `steamid`='$steamid'");
}
else if($premium == "1")
{
if($lastmsg<=$time && $cban==0)
{
if($dbava==$ava && $dbname==$nickname)
{
$color = "FFD700";
fwrite(fopen('chat.txt', 'a+'), "<a href='profile.php?action=view&id=".$steamid."'><img src='".$ava."' height='50' width='50'></img></a><p style='float: right;width: 210px;overflow-wrap: break-word;padding: 3px;padding-left: 13px;'><a class='nameclick' style='color:#".$color."' target='_blank' href='profile.php?action=view&id=".$steamid."'>".$dbname."</a><br><a style='display: block;margin-top: 5px;'>".$message = str_replace("\n", " ", $message)."</a></p><a href='index.php?action=cban&id=$steamid' class='ban' style='display:none'></a><script>document.getElementById('chat-wrap').scrollTop = document.getElementById('chat-wrap').scrollHeight;</script> \n");
mysql_query("UPDATE `users` SET `lastmsg`='$pmsg' WHERE `steamid`='$steamid'");
}
}
}
else
{
if($lastmsg<=$time && $cban==0)
{
if($dbava==$ava && $dbname==$nickname)
{
$color = "337ab7";
fwrite(fopen('chat.txt', 'a+'), "<a href='profile.php?action=view&id=".$steamid."'><img src='".$ava."' height='50' width='50'></img></a><p style='float: right;width: 210px;overflow-wrap: break-word;padding: 3px;padding-left: 13px;'><a class='nameclick' style='color:#".$color."' target='_blank' href='profile.php?action=view&id=".$steamid."'>".$dbname."</a><br><a style='display: block;margin-top: 5px;'>".$message = str_replace("\n", " ", $message)."</a></p><a href='index.php?action=cban&id=$steamid' class='ban' style='display:none'></a><script>document.getElementById('chat-wrap').scrollTop = document.getElementById('chat-wrap').scrollHeight;</script> \n");
mysql_query("UPDATE `users` SET `lastmsg`='$nmsg' WHERE `steamid`='$steamid'");
}
}
}
}
break;
}
echo json_encode($log);
?>
čo som pozeral do logu tak je chyba v process.php jak vidiím pretože
PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161263 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161272 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161361 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161371 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161378 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161394 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161402 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161408 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161417 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Fatal error: Call to undefined function fetchinfo() in /var/www/html/chat/process.php on line 51, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161422 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.161427 2016] [:error] [pid 12175] [client 78.98.117.4:20729] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899587 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899633 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899648 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899763 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899779 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899793 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899813 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899840 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899854 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899873 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Fatal error: Call to undefined function fetchinfo() in /var/www/html/chat/process.php on line 51, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899885 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:23.899898 2016] [:error] [pid 12109] [client 78.98.117.4:20727] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478829 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478880 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478899 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478973 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478982 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478988 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.478998 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.479030 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.479036 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.479045 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Fatal error: Call to undefined function fetchinfo() in /var/www/html/chat/process.php on line 51, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.479050 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:24.479055 2016] [:error] [pid 12162] [client 78.98.117.4:20722] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274186 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274228 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274243 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274335 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274346 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274352 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274388 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274401 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274414 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274431 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Fatal error: Call to undefined function fetchinfo() in /var/www/html/chat/process.php on line 51, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274439 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.274445 2016] [:error] [pid 12141] [client 78.98.117.4:20732] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727253 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727301 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727316 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727441 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727458 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727471 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727505 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727519 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727531 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727547 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Fatal error: Call to undefined function fetchinfo() in /var/www/html/chat/process.php on line 51, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727558 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:25.727570 2016] [:error] [pid 12159] [client 78.98.117.4:20714] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521608 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521659 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521677 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521793 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521810 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521839 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521862 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521876 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521889 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521903 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Fatal error: Call to undefined function fetchinfo() in /var/www/html/chat/process.php on line 51, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521909 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.521914 2016] [:error] [pid 12109] [client 78.98.117.4:20734] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946423 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP Notice: Undefined index: premium in /var/www/html/chat/process.php on line 47, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946462 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946476 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946601 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP Warning: include_once(..\\link.php): failed to open stream: No such file or directory in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946615 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP Stack trace:, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946626 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP 1. {main}() /var/www/html/chat/process.php:0, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946644 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP Warning: include_once(): Failed opening '..\\link.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/chat/process.php on line 50, referer: http://litepixel.eu/
[Sat Feb 20 06:24:26.946655 2016] [:error] [pid 12167] [client 78.98.117.4:20730] PHP Stack trace:, referer: http://litepixel.eu/