I have multiple links (e.g. 100 - 120) in my HTML page. What I really need is to send different data to another PHP page (e.g. display.php) when I click each link. I tried a pathetic approach,
<form action="display.php" method="post"> // or GET <input type="hidden" name ="data" value="Data1" /> <input type="submit" value="Link 1" /> </form>` . . . <form action="display.php" method="post"> <input type="hidden" name ="data" value="Data120" /> <input type="submit" value="Link 120" /> </form>
Is there any simple way to reduce the use of these 120 forms?
Yes of course Try using tag with id
Hope this helps
You can place data directly on the href of the tag.
For example:
Then in your display.php file:
for you.