Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_SERVER['HTTP_REFERER']) == 'l.facebook.com') {
- if(isset($_GET['id'])) {
- if(strlen($_GET['id']) == 5) {
- require('../include/config.php');
- $url = mysqli_real_escape_string($conn, $_GET['id']);
- $urlQuery = "SELECT * FROM url_data WHERE urlCode = '{$url}'";
- $result = mysqli_query($conn, $urlQuery);
- if(isset($_SERVER['HTTP_REFERER']) == 'l.facebook.com') {
- if (mysqli_num_rows($result) > 0) {
- $redirectUrl = mysqli_fetch_assoc($result);
- $countQuery = "UPDATE url_data SET v_facebook=v_facebook + 1 WHERE urlCode = '{$redirectUrl['urlCode']}' ";
- if(!mysqli_query($conn, $countQuery)) {
- header('Location: index.php');
- die();
- }
- }
- }
- header('Location: ' . $redirectUrl['initialUrl']);
- die();
- }
- } else {
- header('Location: ../index.php');
- die();
- }
- }
- if(isset($_SERVER['HTTP_REFERER']) == 'l.instagram.com') {
- if(isset($_GET['id'])) {
- if(strlen($_GET['id']) == 5) {
- require('../include/config.php');
- $url = mysqli_real_escape_string($conn, $_GET['id']);
- $urlQuery = "SELECT * FROM url_data WHERE urlCode = '{$url}'";
- $result = mysqli_query($conn, $urlQuery);
- if(isset($_SERVER['HTTP_REFERER']) == 'l.instagram.com') {
- if (mysqli_num_rows($result) > 0) {
- $redirectUrl = mysqli_fetch_assoc($result);
- $countQuery = "UPDATE url_data SET v_instagram=v_instagram + 1 WHERE urlCode = '{$redirectUrl['urlCode']}' ";
- if(!mysqli_query($conn, $countQuery)) {
- header('Location: index.php');
- die();
- }
- }
- }
- header('Location: ' . $redirectUrl['initialUrl']);
- die();
- }
- } else {
- header('Location: ../index.php');
- die();
- }
- }
- if(isset($_SERVER['HTTP_REFERER']) == '') {
- if(isset($_GET['id'])) {
- if(strlen($_GET['id']) == 5) {
- require('../include/config.php');
- $url = mysqli_real_escape_string($conn, $_GET['id']);
- $urlQuery = "SELECT * FROM url_data WHERE urlCode = '{$url}'";
- $result = mysqli_query($conn, $urlQuery);
- if(isset($_SERVER['HTTP_REFERER']) == '') {
- if (mysqli_num_rows($result) > 0) {
- $redirectUrl = mysqli_fetch_assoc($result);
- $countQuery = "UPDATE url_data SET visitas=visitas + 1 WHERE urlCode = '{$redirectUrl['urlCode']}' ";
- if(!mysqli_query($conn, $countQuery)) {
- header('Location: index.php');
- die();
- }
- }
- }
- header('Location: ' . $redirectUrl['initialUrl']);
- die();
- }
- } else {
- header('Location: ../index.php');
- die();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement