diff --git a/index.php b/index.php index 0316ced..377fdd9 100644 --- a/index.php +++ b/index.php @@ -18,8 +18,8 @@ if (!empty($idcko)){ if ($stmt1->num_rows() < 1) { die("Nonexistent link"); } - if (empty($_POST['action'])){ - while ($stmt1->fetch()) { + while ($stmt1->fetch()) { + if (empty($_POST['action'])){ $stmt2 = $mysqli->prepare("SELECT `Content` FROM Content WHERE `ContentID` = ?"); $stmt2->bind_param("s", $contentid); $stmt2->bind_result ($content); @@ -39,14 +39,14 @@ if (!empty($idcko)){ } } - } - else{ - $action = $_POST['action']; - $extrainfo = $_POST['extrainfo']; - $stmt4 = $mysqli->prepare("INSERT INTO Logs (`Action`, `ExtraInfo`, `LinkID`, `ContentID`, `Datetime`, `Nickname`, `IP`) VALUES (?, ?, ?, ?, ?, ?);"); - $stmt4->bind_param('sssssss', $action, $extrainfo, $idcko, $contentid, $curdate, $nickname, $ipcka); - $stmt4->execute(); - $stmt4->store_result(); + else{ + $action = $_POST['action']; + $extrainfo = $_POST['extrainfo']; + $stmt4 = $mysqli->prepare("INSERT INTO Logs (`Action`, `ExtraInfo`, `LinkID`, `ContentID`, `Datetime`, `Nickname`, `IP`) VALUES (?, ?, ?, ?, ?, ?, ?);"); + $stmt4->bind_param('sssssss', $action, $extrainfo, $idcko, $contentid, $curdate, $nickname, $ipcka); + $stmt4->execute(); + $stmt4->store_result(); + } } } else{