Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ////////////////////////////////////////////////////////////
- //////// script created by Shady on GNU/GPL license ////////
- //////// gg 15530223 | mail izzypjchamp@gmail.com ////////
- ////////////////////////////////////////////////////////////
- /**************** DATABASE : idiots *****************
- field: id (int 11) auto_increment PRIMARY
- field: time (int 11)
- field: ip (varchar 18)
- field: agent (text)
- *****************************************************/
- $title = 'Image title';
- $srcimg = 'http://site.com/image.png';
- echo '
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>'.$title.'</title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <meta http-equiv="content-language" content="en" />
- <meta name="description" content="Εmieszne obrazki i codzienna dawka humoru!" />
- <meta name="keywords" content="kwejk, demotywatory, obrazki, memy" />
- <meta http-equiv="pragma" content="no-cache" />
- <meta name="robots" content="none" />
- </head>
- <body>
- <img src="'.$srcimg.'" alt="'.$title.'" title="'.$title.'" />
- ';
- function true_ip() {
- if(isset($_SERVER['HTTP_CLIENT_IP'])) $ip = $_SERVER['HTTP_CLIENT_IP'];
- elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
- else $ip = $_SERVER['REMOTE_ADDR'];
- return $ip;
- }
- try {
- $db = new PDO ('mysql:host=localhost;dbname=base_name;encoding=utf8', 'user', 'pass');
- $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $db -> exec("INSERT INTO idiots (time, ip, agent) VALUES ('".date('d.m.y H:i:s')."', '".true_ip()."', '".$_SERVER['HTTP_USER_AGENT']."')");
- }
- catch(PDOException $error) {
- exit('Error communicating with the database!<br/>'.$error);
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement