Jump to content

Jonnyfencing1

New Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jonnyfencing1

  • Rank
    Newbie
  1. I have a new project I'm working on where I am making an affiliate program and I am making a bit where if the same IP visits the link more thna 5 times it blocks it from adding on 1 click and I get this error whenever I try to test it out its on Line 17 I will paste my full PHP file below with line 17 in Bold and Underlined. <?php session_start(); if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { die('Invalid id'); } $conn = mysqli_connect("redacted", "redacted", "redacted", "redacted"); if (!$conn) { die("Connection failed: ".mysqli_connect_error()); } $ip = $_SERVER['REMOTE_ADDR']; $sql = ("SELECT ip FROM ips WHERE ip='$ip'"); $qry = $conn->query($sql); if ($qry = 0) { $insert = ("INSERT INTO ips (ip) VALUES ($ip)"); $insertqry = $conn->query($insert); } $sql = ("SELECT times FROM ips WHERE ip='$ip'"); $qry = $conn->query($sql); if ($qry < 5) { $sql = ("UPDATE ips SET times = times+1 WHERE"); $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $id = (int)$_GET['id']; $qry= "UPDATE affiliate SET clicks = clicks+1 WHERE ID='$id'"; $conn->query($qry); $input = array("https://order.abcgam...f.php?aff=47", "https://discord.gg/CjzZRBq"); $answer = array_rand($input, 1); //one key header("Location: $input[$answer]"); //use the key to get the array element } elseif ($qry > 5) { $input = array("https://order.abcgam...f.php?aff=47", "https://discord.gg/CjzZRBq"); $answer = array_rand($input, 1); //one key header("Location: $input[$answer]"); //use the key to get the array element } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.