Vendetta Boss 4 years ago
parent
commit
2df2ca64ae
3 changed files with 39 additions and 0 deletions
  1. 13 0
      ajax/setBroken.php
  2. 13 0
      ajax/updateImageCount.php
  3. 13 0
      ajax/updateLinkCount.php

+ 13 - 0
ajax/setBroken.php

@@ -0,0 +1,13 @@
+<?php
+include("../config.php");
+
+if(isset($_POST["src"])) {
+	$query = $con->prepare("UPDATE images SET broken = 1 WHERE imageUrl=:src");
+	$query->bindParam(":src", $_POST["src"]);
+
+	$query->execute();
+}
+else {
+	echo "No src passed to page";
+}
+?>

+ 13 - 0
ajax/updateImageCount.php

@@ -0,0 +1,13 @@
+<?php
+include("../config.php");
+
+if(isset($_POST["imageUrl"])) {
+	$query = $con->prepare("UPDATE images SET clicks = clicks + 1 WHERE imageUrl=:imageUrl");
+	$query->bindParam(":imageUrl", $_POST["imageUrl"]);
+
+	$query->execute();
+}
+else {
+	echo "No image URL passed to page";
+}
+?>

+ 13 - 0
ajax/updateLinkCount.php

@@ -0,0 +1,13 @@
+<?php
+include("../config.php");
+
+if(isset($_POST["linkId"])) {
+	$query = $con->prepare("UPDATE sites SET clicks = clicks + 1 WHERE id=:id");
+	$query->bindParam(":id", $_POST["linkId"]);
+
+	$query->execute();
+}
+else {
+	echo "No link passed to page";
+}
+?>