I'm new to web programming and I have a problem with the website I'm trying to do : I want to send some data to another .php page when the user clicks a link (there are several links, each link is the title of an newspaper article and when the user clicks one of them, it sends the id of the article because the next page has to load the content of the article). But I must not use Javascript.
Here is my previous code :
<h2> Articles </h2>
<?php
$articlesSql = "SELECT id, title FROM Article A, ApproveArticle VA WHERE A.id = VA.article AND VA.state='published';";
$articlesQuery = pg_query($connect, $articlesSql);
while($articlesResult = pg_fetch_array($articlesQuery)) {
echo "<form id=\"linkArticle\" action=\"article.php\">";
echo "<input type=\"hidden\" name=\"article\" value=\"$articlesResult[id]\"> </form>";
echo "<a href='#' onclick='document.getElementById(\"linkArticle\").submit()'> $articlesResult[title] </a> <br/>";
}
?>
Is there a way to avoid using Javascript? If so, how do I do?
Thank you for your help in this matter and have a nice day.