SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast weicool's Avatar
    Join Date
    Jul 2004
    Location
    USA
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting POST Variables

    Is there some way to set POST variables without using a form? I just want for variables to be set when a user clicks a link, which shouldn't be sent through a query string using GET.
    Pokemon Dream - The greatest Pokemon website of all...

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    store the value in a session variable
    my mobile portal
    ghiris.ro

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know your scenario but if you only don't want to show the value in the form and still you are allowed to use the form then you can use form's hidden elements. I assume there is button or something to click in your page, so just simply submit the form on onClick event of that link.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Session or cookie are your only options if your user isn't actually submitting a form.

  5. #5
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by weicool View Post
    I just want for variables to be set when a user clicks a link, which shouldn't be sent through a query string using GET.
    Why is that?

  6. #6
    SitePoint Enthusiast weicool's Avatar
    Join Date
    Jul 2004
    Location
    USA
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to display special data for certain links users that click (like a special image or something). For example, if a user clicks a specific link on a menu, I'd like to expand that menu on the next page.
    Pokemon Dream - The greatest Pokemon website of all...

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by weicool View Post
    I want to display special data for certain links users that click (like a special image or something). For example, if a user clicks a specific link on a menu, I'd like to expand that menu on the next page.
    Then why don't you want to use the querystring? If you use some other method (such as sending the data through POST), then the user won't be able to use the browsers navigational features. This includes the back button, bookmarks or even opening the page in a different tab/window.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •