php - Appending URL via href - more than once on same page -


i have 2 menus, , i'd each able append url , stack these appends. achievable via php , html alone?

so instance, when user clicks selection in first menu, url append "?variable=example" , link like:

<a href="?variable=example"> 

but i'd user able select second menu , add "?variable2=example2" or "&variable2=example2" if second selection user has made. if make links in second menu "&variable2=example2" appends base url not want.

the tricky part i'd users able start either menu. can done without javascript?

while pretty sure can in plain php, bit of arduous , obtuse process. task javascript meant for, if determined via php, have store url in cookie. have menus each read in , modify cookie , post request. big issue each menu have refresh page since have read in cookie, rewrite cookie each time wanted make change url. php not maintain "state," or "memory," php sends , receives requests.

while can typical programming operations in php, again issue maintaining state between php requests.

for not server related , in semi-real-time, should use javascript correct application (ajax better). php should left interfacing servers.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -