How to send data to PHP page when link is clicked?
P粉311464935
P粉311464935 2024-01-09 21:34:41
0
2
529

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?

P粉311464935
P粉311464935

reply all(2)
P粉267791326

Yes of course Try using tag with id

link1

Hope this helps

P粉933003350

You can place data directly on the href of the tag.
For example:

Click here

Then in your display.php file:

for you.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template