I am working on a task and have set up my code as follows:
On index.php
I include a file, which serves as a view with the code:
include 'Controller/CallArticleData.php';
$i = count($display) - 1;
while ($i >= 0) {
echo "<a href='index.php?editID=" . $display[$i]['ID'] . "'>" . $display[$i]['title'] . "</a><br/>";
$i--;
}
Basically, I call the controller, which calls the relevant model and then I use the data to setup the URL - I want it to set $_POST['editID']
whenever a user clicks on the respective link.
However, the variable still remains unset upon hitting the link, even though the URL changes to index.php?editID=12345
. I performed this check both in index.php and in the respective view.
What am I doing wrong?