Methods

B

Berry B

Hi!
Is it possible to use the methods attribute in the tag <a> like the method
attribute in forms?
What I want is a link to send some values to a php page. Is that possible,
and could someone please give me an example on how to do that?

Tnx!
 
H

Have

Hi!
Is it possible to use the methods attribute in the tag <a> like the
method
attribute in forms?
What I want is a link to send some values to a php page. Is that
possible,
and could someone please give me an example on how to do that?

Well, you cannot send POST variables without having a form, but yes, you
can send values to a php page with the <a>-tag: <a
href='page.php?something=123&someother=234'>link</a> ... etc, if that's
what you meant(?) ... This will work like having a form with method=get.
 
C

chris

Berry B said:
Hi!
Is it possible to use the methods attribute in the tag <a> like the method
attribute in forms?
What I want is a link to send some values to a php page. Is that possible,
and could someone please give me an example on how to do that?

Tnx!


You can pass yor variables within the url.

test.php?var1=somehting&var2=somethingelse

which is the same as using the GET action in forms. Simply append that after
the filename. Theres no POST action in <a> tags as far as i know.

chris
 
S

Steve Pugh

Berry B said:
Is it possible to use the methods attribute in the tag <a> like the method
attribute in forms?

No. Normal links produce GET requests.
What I want is a link to send some values to a php page. Is that possible,
and could someone please give me an example on how to do that?

<a href="page.php?label1=value1&amp;label2=value2">link text</a>

Steve
 
J

Jukka K. Korpela

Berry B said:
Is it possible to use the methods attribute in the tag <a> like the
method attribute in forms?

No. The methods attribute was contained in early HTML specifications,
but it was not implemented and it was dropped out.

Any reason to avoid a submit button if it's a matter of submitting data
for processing, using the post method?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top