Results 1 to 7 of 7

Thread: on click setcookie..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    on click setcookie..

    How will i set the cookie after a click on a link. like if i have north,east,south,west links.. if i click north i want to setcookie("grid","NORTH") or if i click east setcookie("grid","EAST") for east.. then reloads the page. Thanks for your future help..

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: on click setcookie..

    I presume that when you click on the different links they take you to a different page? eg Click on north link and you goto north.php?

    If so, add the setcookie code to each of the pages. (north.php, south.php, east.php, west.php)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    Re: on click setcookie..

    not quite.. i am thinking of.. having a global value like region then everytime i click the link i change it's value.. like a global value in VB.. so using cookie it might be possible.

    i am calling the same page index.php so i must preserve the values. FYI

  4. #4
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: on click setcookie..

    Maybe you can add a checkbox for each direction and a submit button, then at the top of your index.php page do a check for which checkbox (or radio button list) was checked.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  5. #5
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: on click setcookie..

    good thinking k1ll3rdr4g0n!!

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    Re: on click setcookie..

    i was thinking of this kinda page.. see attachment. i want to only expose branches within the specified grid below the choices.. i wan it all only at one page.. and without forms. actually i have made a site and just want to improve it.. i used forms in this site.

    i am also having probles such as unidentified variables.. i just started php last month so obviously em not good at it..
    Attached Images Attached Images  
    Last edited by titan7262; Nov 10th, 2005 at 12:33 AM.

  7. #7
    Junior Member
    Join Date
    Oct 2005
    Posts
    17

    Re: on click setcookie..

    You cannot use the setcookie() function if headers have already been sent to the page. In other words, if ANYHING has been outputted to the page, you can't use it. You will have to do like they said and make it submit to itself, then using post/get variables find out which direction they submitted.

Posting Permissions

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



Click Here to Expand Forum to Full Width