14 Commits

Author SHA1 Message Date
Sebastian Titz
f1b4aaf23a Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib 2021-11-24 13:02:08 +01:00
Sebastian Titz
e6fd1de954 lrln 2021-11-24 13:01:24 +01:00
troy
c631b51ba2 hosteurope ips 2021-11-21 09:17:33 +01:00
Sebastian Titz
3e083b4eb9 ips 2021-11-16 10:14:06 +01:00
Sebastian Titz
0c41265fb6 bot ips 2021-11-05 07:44:33 +01:00
Sebastian Titz
31a0a02366 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib 2021-11-03 07:22:50 +01:00
Sebastian Titz
233c9f5aed & in umlaute 2021-11-03 07:22:04 +01:00
troy
9c034cd935 versuch2 mit single param ohne array umbau 2021-10-15 12:48:41 +02:00
troy
d32ad04722 sql single hotfix 2021-10-15 12:21:19 +02:00
troy
32c65f7da1 sql mit einem param muss nicht mehr mit array geschrieben werden 2021-10-10 16:28:12 +02:00
troy
f736789f5b . 2021-10-09 13:44:04 +02:00
troy
973a0a1d01 microsoft ip 2021-09-21 15:14:23 +02:00
Sebastian Titz
de82116482 crawlerips 2021-08-26 15:21:59 +02:00
Sebastian Titz
5c7e2f6a8f abfangen wenn mailtext arrayst 2021-08-26 15:12:49 +02:00
4 changed files with 205 additions and 204 deletions

View File

@@ -6,5 +6,5 @@ include_once ('string.php');
include_once ('numbers.php'); include_once ('numbers.php');
include_once ('mail.php'); include_once ('mail.php');
include_once ('debug.php'); include_once ('debug.php');
include_once ('markdown.php'); // include_once ('markdown.php');
?> ?>

View File

@@ -8,11 +8,17 @@ $_ips_crawler = array (
'104.155.85.', // google '104.155.85.', // google
'114.119.1', // petalbot '114.119.1', // petalbot
'185.191.171.', // semrush bot '185.191.171.', // semrush bot
'207.46.13.124', // bing bot '207.46.13.', // bing bot
'54.36.148.', // ahrefbot '54.36.148.', // ahrefbot
'54.36.149.', // ahrefbot
'216.244.66.196', // opensiteexplorer '216.244.66.196', // opensiteexplorer
'65.21.180.26', // seekport '65.21.180.26', // seekport
'81.209.177.145', // website-datenbank.de '81.209.177.145', // website-datenbank.de
'2a01:4f8:190:4244::2' // mj12bot '2a01:4f8:190:4244::2', // mj12bot
'192.99.5.225', // ...
'157.55.39.', // microsoft???
'2a01:4f8:162:43c5::2', // mj12bot
'85.25.177.', // abuse
'85.25.210.' // hosteurope abuse
); );
?> ?>

391
sql.php
View File

@@ -1,199 +1,192 @@
<?php <?php
class SQL { class SQL {
private $h; private $h;
private $res = false; private $res = false;
private $m; private $m;
public $salt; public $salt;
public $pre; public $pre;
public $cnt_get = 0; public $cnt_get = 0;
public $cnt_set = 0; public $cnt_set = 0;
public function __construct() { public function __construct() {
require_once ('secret.php'); require_once ('secret.php');
$this->m = $_m; $this->m = $_m;
$this->pre = $_m ['pre']; $this->pre = $_m ['pre'];
$this->salt = $_m ['salt']; $this->salt = $_m ['salt'];
if (SQL_LOG) if (SQL_LOG)
$this->f = fopen ( 'sql.log', 'w' ); $this->f = fopen ( 'sql.log', 'w' );
$this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] ); $this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] );
if ($this->h->connect_errno) { if ($this->h->connect_errno) {
return false; return false;
} }
return true; return true;
} }
public function get($que, $t = '', $p = array ()) { public function get($que, $t = '', $p = array ()) {
// echo $que; // echo $que;
$this->cnt_get ++; $this->cnt_get ++;
if (SQL_LOG) if (SQL_LOG)
fputs ( $this->f, str_replace ( array ( fputs ( $this->f, str_replace ( array (
"\n", "\n",
" " " "
), array ( ), array (
' ', ' ',
'' ''
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
$statement = $this->h->prepare ( $que ); $statement = $this->h->prepare ( $que );
switch (count ( $p )) { if (is_array ( $p )) {
case 0 : switch (count ( $p )) {
break; case 0 :
case 1 : break;
$statement->bind_param ( $t, $p [0] ); case 1 :
break; $statement->bind_param ( $t, $p [0] );
case 2 : break;
$statement->bind_param ( $t, $p [0], $p [1] ); case 2 :
break; $statement->bind_param ( $t, $p [0], $p [1] );
case 3 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2] ); case 3 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
case 4 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] ); case 4 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
case 5 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] ); case 5 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
case 6 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] ); case 6 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
case 7 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] ); case 7 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
case 8 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] ); case 8 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
case 9 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] ); case 9 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
case 10 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] ); case 10 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
} break;
$statement->execute (); }
} else {
$ret = array (); $statement->bind_param ( $t, $p );
}
// print_r($statement); $statement->execute ();
if (isset ( $statement->error ) && $statement->error != '') {
if (SQL_LOG) $ret = array ();
fputs ( $this->f, $statement->error );
return false; // print_r($statement);
} if (isset ( $statement->error ) && $statement->error != '') {
$result = $statement->get_result (); if (SQL_LOG)
// print_r($result); fputs ( $this->f, $statement->error );
while ( $row = $result->fetch_assoc () ) { return false;
$ret [] = $row; }
} $result = $statement->get_result ();
return $ret; // print_r($result);
} while ( $row = $result->fetch_assoc () ) {
public function single($que, $t = '', $p = array ()) { $ret [] = $row;
$data = $this->get ( $que, $t, $p ); }
if ($data) { return $ret;
return $data [0]; }
} public function single($que, $t = '', $p = array ()) {
return false; $data = $this->get ( $que, $t, $p );
} if ($data) {
public function list($que, $t = '', $p = array ()) { return $data [0];
$data = $this->get ( $que, $t, $p ); }
if ($data) { return false;
$ret = array (); }
foreach ( $data as $d ) { public function list($que, $t = '', $p = array ()) {
foreach ( $d as $k => $v ) { $data = $this->get ( $que, $t, $p );
$ret [] = $v; if ($data) {
} $ret = array ();
} foreach ( $data as $d ) {
return $ret; foreach ( $d as $k => $v ) {
} $ret [] = $v;
return false; }
} }
public function keyval($que, $k, $v, $t = '', $p = array ()) { return $ret;
$data = $this->get ( $que, $t, $p ); }
if ($data) { return false;
$ret = array (); }
foreach ( $data as $d ) { public function keyval($que, $k, $v, $t = '', $p = array ()) {
$ret [$d [$k]] = $d [$v]; $data = $this->get ( $que, $t, $p );
} if ($data) {
return $ret; $ret = array ();
} foreach ( $data as $d ) {
return false; $ret [$d [$k]] = $d [$v];
} }
public function set($que, $t = '', $p = array (), $id = false) { return $ret;
// echo $que; }
$this->cnt_set ++; return false;
$statement = $this->h->prepare ( $que ); }
if (SQL_LOG) public function set($que, $t = '', $p = array (), $id = false) {
fputs ( $this->f, str_replace ( array ( // echo $que;
"\n", $this->cnt_set ++;
" " $statement = $this->h->prepare ( $que );
), array ( if (SQL_LOG)
' ', fputs ( $this->f, str_replace ( array (
'' "\n",
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); " "
switch (count ( $p )) { ), array (
case 0 : ' ',
break; ''
case 1 : ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
$statement->bind_param ( $t, $p [0] ); if (is_array ( $p )) {
break; switch (count ( $p )) {
case 2 : case 0 :
$statement->bind_param ( $t, $p [0], $p [1] ); break;
break; case 1 :
case 3 : $statement->bind_param ( $t, $p [0] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2] ); break;
break; case 2 :
case 4 : $statement->bind_param ( $t, $p [0], $p [1] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] ); break;
break; case 3 :
case 5 : $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] ); break;
break; case 4 :
case 6 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] ); break;
break; case 5 :
case 7 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] ); break;
break; case 6 :
case 8 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] ); break;
break; case 7 :
case 9 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] ); break;
break; case 8 :
case 10 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] ); break;
break; case 9 :
case 11 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10] ); break;
break; case 10 :
case 12 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11] ); break;
break; }
case 13 : } else {
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12] ); $statement->bind_param ( $t, $p );
break; }
case 14 : $statement->execute ();
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12], $p [13] ); if (isset ( $statement->error ) && $statement->error != '') {
break; if (SQL_LOG)
case 15 : fputs ( $this->f, $statement->error );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12], $p [13], $p [14] ); return false;
break; }
}
$statement->execute (); if ($id) {
if (isset ( $statement->error ) && $statement->error != '') { return $statement->insert_id;
if (SQL_LOG) } else {
fputs ( $this->f, $statement->error ); return $statement->affected_rows;
return false; }
} }
function __destruct() {
if ($id) { if (SQL_LOG)
return $statement->insert_id; $this->h->close ();
} else { // echo 'DESTROY';
return $statement->affected_rows; }
} }
} ?>
function __destruct() {
if (SQL_LOG)
$this->h->close ();
// echo 'DESTROY';
}
}
?>

View File

@@ -7,7 +7,8 @@ function umlaute($str) {
'ä', 'ä',
'ö', 'ö',
'ü', 'ü',
'ß' 'ß',
'&'
), array ( ), array (
'&Auml;', '&Auml;',
'&Ouml;', '&Ouml;',
@@ -15,7 +16,8 @@ function umlaute($str) {
'&auml;', '&auml;',
'&ouml;', '&ouml;',
'&uuml;', '&uuml;',
'&szlig;' '&szlig;',
'&amp;'
), $str ); ), $str );
} }
function chk($str) { function chk($str) {