Methods

Discussion in 'HTML' started by Berry B, Feb 18, 2004.

  1. Berry B

    Berry B Guest

    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!
    Berry B, Feb 18, 2004
    #1
    1. Advertising

  2. Berry B

    Have Guest

    On Wed, 18 Feb 2004 23:48:12 +0100, Berry B <> wrote:

    > 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.


    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
    E-mail: Replace no with com
    Have, Feb 18, 2004
    #2
    1. Advertising

  3. Berry B

    chris Guest

    "Berry B" <> schrieb im Newsbeitrag
    news:4033ed20$...
    > 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
    chris, Feb 18, 2004
    #3
  4. Berry B

    Steve Pugh Guest

    "Berry B" <> wrote:

    >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

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Feb 18, 2004
    #4
  5. "Berry B" <> wrote:

    > 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?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Feb 20, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neo
    Replies:
    1
    Views:
    515
    Scott Allen
    Jan 7, 2005
  2. Buster Copley
    Replies:
    5
    Views:
    556
    Gianni Mariani
    Jul 7, 2003
  3. Tron Thomas
    Replies:
    10
    Views:
    1,073
    Tom Widmer
    Nov 10, 2004
  4. Oliver Wong
    Replies:
    14
    Views:
    1,609
    Chris Uppal
    Jun 13, 2006
  5. Kenneth McDonald
    Replies:
    5
    Views:
    311
    Kenneth McDonald
    Sep 26, 2008
Loading...

Share This Page