Ok so I basically have generated a list of links that use forms to send a variable to PHP that would allow me to load different things on the next page from each link. However, each link seems to only request the same data from the database each time. the PHP version I'm using is version 5.3.14.
Here is the first page's php code:
<?php
//DATABASE CONNECTION
$News=mysql_query("SELECT * FROM Tutorial");
while($row=mysql_fetch_array($News))
{
printf("<div class='NewsItem'><div class='title'>%s</div><form enctype='multipart/form-data' action='tutorial.php' method='post'><input type='hidden' name='tutorial' value='%s'/><input type='submit' name='submit' value='%s' id='hyperlink-style-button'/></div>", $row['Title'], $row['Title'], $row['Title']);
}
?>
And here is the second page's php code which I want the forms to allow me to display a different thing from each link
<?php
//DATABASE CONNECTION
$Tutorial=$_POST['tutorial'];
$query="SELECT * FROM Tutorial WHERE Title='$Tutorial'";
$News=mysql_query($query);
while($row=mysql_fetch_array($News))
{
printf("<div class='NewsItem'><div class='title'>%s</div>%s</div>", $row['Title'], $row['Tutorial']);
}
unset($_POST['tutorial']);
unset($Tutorial);
?>
Any ideas on how to stop it from always using the same data no matter which link is clicked? Also if you need to see the code in action here is the link to the first page:Example of the website