-
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.. :wave:
-
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)
-
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
-
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.
-
Re: on click setcookie..
good thinking k1ll3rdr4g0n!! :D
-
1 Attachment(s)
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..
-
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.