Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

submitting a hyperlink by GET or POST

Tags:

html

php

So there's this hyperlink - it's happy being a hyperlink - it does not want to change to a button or a form element - it wants to stay a link!

But it would really help me if I could submit it via GET or POST (something which I switch on my pages due to design criteria). Is there ANY way that I can do this

thanks Giles

like image 224
giles Avatar asked May 12 '26 19:05

giles


1 Answers

You're in luck... clicking a hyperlink already does a GET request.

If you want to add query parameters, append them to the query string like so:

<a href="/my/page/foo.php?onions=no&pickles=yes">link text</a>
like image 61
Dagg Nabbit Avatar answered May 15 '26 08:05

Dagg Nabbit