There used to be a button, when clicked, the variable $ sec was transferred to another page. Now I have links and need to do the same. I assume that you can do this using the hidden field. Maybe there are other ways?
include('set.php'); echo "<form method='post' action='obj.php'>"; $sql = mysql_query("select * from `obj` order by `id`"); for ($i = 1; $i <= mysql_num_rows($sql); $i++) { while ($s = mysql_fetch_array($sql)) { echo '<a href="obj.php">"<img src='.$s['img']. '>'.$s['id']. '</a>'; } $sec = $s['id']; } echo "</form>";
javascript, but not onphp. You can process click on the link, fill in thehiddenfield and makesubmitforms. Or you can use thejQuerylibrary'spostmethod. - PyramidheadGETinstead ofPOST. And, accordingly, links like<a href="obj.php?sec=значение">содержимое ссылки</a>. - Pyramidhead