From 632c21f96d3d20c93d5a7b2df812daecd1a3972a Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Tue, 7 Aug 2018 16:26:36 -1000 Subject: [PATCH] fixed clicking on edit title ranks with no title ranks actually selected --- includes/titleranks-editor.php | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php index c1ba101..9dbb0c3 100644 --- a/includes/titleranks-editor.php +++ b/includes/titleranks-editor.php @@ -6,18 +6,23 @@ error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); # delete the above when shit finally works -echo '
'; -$ph = implode(",", $_POST['editstitle']); -$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)"); -$sredit->bind_param("i", $_SESSION['tid']); -$sredit->execute(); -$result = $sredit->get_result(); -while ($row = $result->fetch_assoc()) { - echo ''; - echo ''; - echo ''; +if (isset($_POST['editstitle'])) { + echo '
stnameidtitlenameidstnamestpointsstrankDelete?
'; + $ph = implode(",", $_POST['editstitle']); + $sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)"); + $sredit->bind_param("i", $_SESSION['tid']); + $sredit->execute(); + $result = $sredit->get_result(); + while ($row = $result->fetch_assoc()) { + echo ''; + echo ''; + echo ''; + } + echo '
stnameidtitlenameidstnamestpointsstrankDelete?

'; + echo '

'; + echo 'Return to title manager'; +} else { + echo 'No title ranks selected! Please press the back button on your browser to return to the previous page.

'; + echo 'Return to title manager'; } -echo '
'; -echo '

'; -echo 'Return to title manager'; ?> \ No newline at end of file