1. Гость, мы просим Вас ознакомиться с Правилами Форума и Отказом от ответственности!

Результаты поиска

  1. maestro199
  2. maestro199
  3. maestro199
  4. maestro199
  5. maestro199
  6. maestro199
  7. maestro199
  8. maestro199
  9. maestro199
  10. maestro199
  11. maestro199
  12. maestro199
  13. maestro199
  14. maestro199
    С мертвяка сдвинулись но недалеко. [IMG] Но теперь заносил 2 аккаунта в базу (не понимаю почему 2 но заносит) <?php ////////////////////////////////////////////////////////////////////////////////////// $DBHost = "localhost"; // localhost or your IP // $DBUser = "*"; // Database user // $DBPassword = "*"; // Database password // $DBName = "*"; // Database name // $voice = "*"; // Обычный голос // $smsvoice = "*"; // СМС голос // ////////////////////////////////////////////////////////////////////////////////////// // адресс к файлу лога на mmotope $fcontent=file("txt"); function dbconnect () { global $DBHost,$DBUser,$DBPassword,$DBName; ///////Start Open MySQL-connection/////////////////// $openConndb = mysql_connect( $DBHost, $DBUser, $DBPassword ); $dbSelected = mysql_select_db( $DBName, $openConndb ); setlocale(LC_ALL, 'ru_RU.utf-8'); mysql_query("SET character_set_results='utf8'"); mysql_query("SET NAMES 'utf8'"); /////////End Open MySQL-connection///////////////////// return $openConndb; } $content = @file_get_contents($linkstat); $massive=explode("\n", $content); for($j=0;$j<sizeof($fcontent);$j++) { $temp=explode("\t",$fcontent[$j]); $vote_id = (int)trim($temp[0]); $vote_time = trim($temp[1]); $vote_time = explode(" ",$vote_time); $temp1 = explode(".",$vote_time[0]); $vote_time = $temp1[2]."-".$temp1[1]."-".$temp1[0]." ".$vote_time[1]; $vote_ip = trim($temp[2]); $vote_char_name = strtolower(trim($temp[3])); $vote_count = (int)trim($temp[4]); if(strlen($vote_char_name) <= 0) continue; $loginquery = MySQL_Query("select `name` from `users` WHERE `name`='$vote_char_name'", dbconnect()); $login = mysql_num_rows($loginquery) ? mysql_result($loginquery, 0,'name') : ''; if($login == $vote_char_name) { $query = "SELECT vote_id FROM mmotop WHERE vote_id = ".$vote_id; $result = mysql_query($query, dbconnect()); $row=mysql_fetch_row($result); if($row[0]) continue; $mysqlresult=MySQL_Query("select * from `users` WHERE `name`='$vote_char_name'", dbconnect()); $User_ID=MySQL_result($mysqlresult,0,'ID'); $query = "INSERT INTO mmotop (vote_id,vote_time,vote_ip,vote_char_name,vote_count) VALUES ('".$vote_id."','".$vote_time."','".$vote_ip."','".mysql_escape_string($vote_char_name)."','".$vote_count."')"; $result = mysql_query($query, dbconnect()); function CUINT($Data) { if($Data < 64) return StrRev(PACK("C", $Data)); else if($Data < 16384) return StrRev(PACK("S", ($Data | 0x8000))); else if($Data < 536870912) return StrRev(PACK("I", ($Data | 0xC0000000))); return StrRev(PACK("c", -32) . PACK("I", $Data)); } function SysSendMail($Receiver, $Title, $Message, $ItemID, $Count, $Count_Max, $Octets, $Proctype, $Expire_date, $Guid1, $Guid2, $Mask, $Money) { $tID = "\x00\x00\x01\x58"; $SysID = "\x00\x00\x00\x20"; $SysType = "\x03"; $Receiver = PACK("N*", $Receiver); $Title = iCONV("UTF-8", "UTF-16LE", $Title); $TitleLengh = StrLen($Title); if($TitleLengh < 128) { $TitleLengh = PACK("C*", $TitleLengh); } else { $TitleLengh = PACK("n*", $TitleLengh + 32768); } $Message = iconv("UTF-8", "UTF-16LE", $Message); $MessageLengh = strlen($Message); if($MessageLengh < 128) { $MessageLengh = PACK("C*", $MessageLengh); } else { $MessageLengh = PACK("n*", $MessageLengh + 32768); } $ItemID = PACK("N*", $ItemID); $Pos = "\x00\x00\x00\x00"; $Count = PACK("N*", $Count); $Count_Max = PACK("N*", $Count_Max); $Octets = PACK("H*", $Octets); $OctetsLenght = PACK("n*", strlen($Octets) + 32768); $Proctype = PACK("N*", $Proctype); $Expire_date = PACK("N*", $Expire_date); $Guid1 = PACK("N*", $Guid1); $Guid2 = PACK("N*", $Guid2); $Mask = PACK("N*", $Mask); $Money = PACK("N*", $Money); $Packet = $tID.$SysID.$SysType.$Receiver.$TitleLengh.$Title.$MessageLengh.$Message.$ItemID.$Pos.$Count.$Count_Max.$OctetsLenght.$Octets.$Proctype.$Expire_date.$Guid1.$Guid2.$Mask.$Money; $PacketLenght = strlen($Packet); if($PacketLenght < 128) { $PacketLenght = PACK("C*", $PacketLenght); } else { $PacketLenght = PACK("n*",$PacketLenght + 32768); } $Packet = "\x90\x76".$PacketLenght.$Packet; $Socket = SOCKET_CREATE(AF_INET, SOCK_STREAM, SOL_TCP); if(!$Socket) { die(SOCKET_STRERROR(SOCKET_LAST_ERROR())); } if(SOCKET_CONNECT($Socket,'127.0.0.1',29100)) { SOCKET_SET_BLOCK($Socket); if (false !== ($sBytes = SOCKET_SEND($Socket,$Packet,8192,0))) { } else { $ERR = 1; } if (false !== ($rBytes = SOCKET_RECV($Socket,$BUF,8192,0))) { } else { $ERR = 2; } SOCKET_SET_NONBLOCK($Socket); SOCKET_CLOSE($Socket); } else { $ERR = 3; } return $ERR; } if($vote_count == 1) SysSendMail("$User_ID", "Почта преисподни", "Спасибо, что проголосовали.", "$itemid", "$voice", "$maxcount", "$octets", "$proctype", "$date", 0, 0, "$mask", "$money"); if($vote_count == 2) SysSendMail("$User_ID", "Почта преисподни", "Спасибо, что проголосовали.", "$itemid", "$smsvoice", "$maxcount", "$octets", "$proctype", "$date", 0, 0, "$mask", "$money"); } } echo <<<HTML <style> input[type='text'],select,textarea { outline-style:none; } form { margin:20; } a { text-decoration:none; } a:hover { color:rgba(159,182,205,1.0); } </style> <form method='post'> </form> HTML; ?> --- добавлено: 28 ноя 2013 в 19:29 --- Сделал отдельный скрипт такого вида, все данные с лога в базу заносит. Но только английские. Осталось присунуть сюда функцию отправки... корректно... пока работает без ошибок <?php ////////////////////////////////////////////////////////////////////////////////////// $DBHost = "localhost"; // localhost or your IP // $DBUser = "*"; // Database user // $DBPassword = "*"; // Database password // $DBName = "*"; // Database name // $voice = "*"; // Обычный голос // $smsvoice = "1"; // СМС голос // ////////////////////////////////////////////////////////////////////////////////////// // адресс к файлу лога на mmotope $fcontent=file("*"); function dbconnect () { global $DBHost,$DBUser,$DBPassword,$DBName; ///////Start Open MySQL-connection/////////////////// $openConndb = mysql_connect( $DBHost, $DBUser, $DBPassword ); $dbSelected = mysql_select_db( $DBName, $openConndb ); setlocale(LC_ALL, 'ru_RU.utf-8'); mysql_query("SET character_set_results='utf8'"); mysql_query("SET NAMES 'utf8'"); /////////End Open MySQL-connection///////////////////// return $openConndb; } $content = @file_get_contents($linkstat); $massive=explode("\n", $content); for($j=0;$j<sizeof($fcontent);$j++) { $temp=explode("\t",$fcontent[$j]); $vote_id = (int)trim($temp[0]); $vote_time = trim($temp[1]); $vote_time = explode(" ",$vote_time); $temp1 = explode(".",$vote_time[0]); $vote_time = $temp1[2]."-".$temp1[1]."-".$temp1[0]." ".$vote_time[1]; $vote_ip = trim($temp[2]); $vote_char_name = strtolower(trim($temp[3])); $vote_count = (int)trim($temp[4]); if(strlen($vote_char_name) <= 0) continue; $loginquery = MySQL_Query("select `name` from `users` WHERE `name`='$vote_char_name'", dbconnect()); $login = mysql_num_rows($loginquery) ? mysql_result($loginquery, 0,'name') : ''; if($login == $vote_char_name) { $query = "SELECT vote_id FROM mmotop WHERE vote_id = ".$vote_id; $result = mysql_query($query, dbconnect()); $row=mysql_fetch_row($result); if($row[0]) continue; $mysqlresult=MySQL_Query("select * from `users` WHERE `name`='$vote_char_name'", dbconnect()); $User_ID=MySQL_result($mysqlresult,0,'ID'); $query = "INSERT INTO mmotop (vote_id,vote_time,vote_ip,vote_char_name,vote_count) VALUES ('".$vote_id."','".$vote_time."','".$vote_ip."','".mysql_escape_string($vote_char_name)."','".$vote_count."')"; $result = mysql_query($query, dbconnect()); } } ?>
    Сообщение от: maestro199, 28 ноя 2013 в разделе: PW Решённые вопросы
  15. maestro199
    А, ну да, трабл не решает --- добавлено: 28 ноя 2013 в 18:46 --- Взял функции коннекта к БД из скрипта начисления голда за голоса, данная ошибка пропала, но появилась к другой строке. Видимо где то в этом куске косяк. function dbconnect () { global $DBHost,$DBUser,$DBPassword,$DBName; ///////Start Open MySQL-connection/////////////////// $openConndb = mysql_connect( $DBHost, $DBUser, $DBPassword ); $dbSelected = mysql_select_db( $DBName, $openConndb ); setlocale(LC_ALL, 'ru_RU.utf-8'); mysql_query("SET character_set_results='utf8'"); mysql_query("SET NAMES 'utf8'"); /////////End Open MySQL-connection///////////////////// return $openConndb; } $content = @file_get_contents($linkstat); $massive=explode("\n", $content); for($j=0;$j<sizeof($fcontent);$j++) { $temp=explode("\t",$fcontent[$j]); $vote_id = (int)trim($temp[0]); $vote_time = trim($temp[1]); $vote_time = explode(" ",$vote_time); $temp1 = explode(".",$vote_time[0]); $vote_time = $temp1[2]."-".$temp1[1]."-".$temp1[0]." ".$vote_time[1]; $vote_ip = trim($temp[2]); $vote_char_name = strtolower(trim($temp[3])); $vote_count = (int)trim($temp[4]); if(strlen($vote_char_name) <= 0) continue; $loginquery = MySQL_Query("select `name` from `users` WHERE `name`='$vote_char_name'", dbconnect()); $login = mysql_num_rows($loginquery) ? mysql_result($loginquery, 0,'name') : ''; if($login == $vote_char_name) { $query = "SELECT vote_id FROM mmotop WHERE vote_id = ".$vote_id; $result = mysql_query($query, dbconnect()); $row=mysql_fetch_row($result); if($row[0]) continue; $mysqlresult=MySQL_Query("select * from `users` WHERE `name`='$vote_char_name'", dbconnect()); $User_ID=MySQL_result($mysqlresult,0,'ID'); $query = "INSERT INTO mmotop (vote_id,vote_time,vote_ip,vote_char_name,vote_count) VALUES ('".$vote_id."','".$vote_time."','".$vote_ip."','".mysql_escape_string($vote_char_name)."','".$vote_count."')"; $result = mysql_query($query, dbconnect());
    Сообщение от: maestro199, 28 ноя 2013 в разделе: PW Решённые вопросы
  16. maestro199
  17. maestro199
  18. maestro199
  19. maestro199
  20. maestro199