Advertisement
Guest User

Untitled

a guest
May 5th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <?php
  2. $server = "155.133.43.118";
  3. $database = "YGRoulette";
  4. $username = "root";
  5. $password = "sraka";
  6.  
  7. $mysqlConnection = mysql_connect($server, $username, $password);
  8. if (!$mysqlConnection) {
  9. die("Przerwa techniczna. Zmieniamy serwer wracamy o 14:40 ");
  10. } else {
  11. mysql_select_db($database, $mysqlConnection);
  12. mysql_query("SET NAMES utf8");
  13. }
  14.  
  15. $colors = ['rgb(41, 95, 153)','rgb(255, 127, 0)','rgb(255, 255, 0)','rgb(127, 0, 127)','rgb(0, 168, 51)','rgb(255, 0, 0)','rgb(183, 201, 221)','rgb(119, 58, 0)','rgb(112, 148, 187)','rgb(187, 95, 0)','rgb(27, 119, 119)','rgb(255, 85, 0)','rgb(255, 255, 170)','rgb(76, 15, 42)','rgb(255, 255, 85)','rgb(102, 7, 85)','rgb(13, 143, 85)','rgb(255, 42, 0)','rgb(170, 226, 17)','rgb(170, 0, 85)','rgb(85, 197, 34)','rgb(212, 0, 42)'];
  16.  
  17. function logsqlerror($error)
  18. {
  19. $errortofile=$error."\n\r\n\r";
  20. $file='logsqlerror.txt';
  21.  
  22. // Write the contents of a file,
  23. // Using the flag FILE_APPEND flag to append content to the file
  24. // Flag LOCK_EX to prevent the recording of the file someone else at this time
  25. file_put_contents($file, $errortofile, FILE_APPEND | LOCK_EX);
  26. }
  27.  
  28. function fetchinfo($rowname,$tablename,$finder,$findervalue) {
  29. if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
  30. else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
  31. $row = mysql_fetch_assoc($result);
  32. return $row[$rowname];
  33. }
  34.  
  35. function generateCLST($length = 6) {
  36. $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  37. $charactersLength = strlen($characters);
  38. $randomString = '';
  39. for ($i = 0; $i < $length; $i++) {
  40. $randomString .= $characters[rand(0, $charactersLength - 1)];
  41. }
  42. return $randomString;
  43. }
  44.  
  45. function convertid($id) {
  46. if (strlen($id) === 17) {
  47. $converted = substr($id, 3) - 61197960265728;
  48. } else {
  49. return (string) "wrong input";
  50. }
  51. return (string) $converted;
  52. }
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement