Hmm… should try to explain how I want to work, maybe you have a better suggestion. I have a list of the 7 weekdays available. For each weekday, a dish is randomized from a mysql database. The user can click on the dish and then a new dish is generated. All this works. When generating button is clicked, the current weekday is saved to a cookie called man (monday). The rest of the weekdays have their own cookies.
If the user wants to select a dish from the entire database, the user clicks on a list that knows which weekday he clicked on and which dish he also chose.
Then it returns a call index.php?weekday=man&food=swedish meatballs
I want to save down there current querystring food to the cookie man, IF it is the weekday monday he clicked on. I do NOT want the cookie to be emptied because I need it.
Had I done this in javascript this would have looked like this and put this in a separate .js file and loaded it in body onload ().
Have tried this, but did not make it work.
If (query.veckodag == 1) {cookie.man = query.food}
If (query.veckodag == 2) {cookie.tis = query.food}
If (query.veckoday == 3) {cookie.ons = query.food}
If (query.veckodag == 4) {cookie.tor = query.food}
If (query.veckodag == 5) {cookie.fre = query.food}
If (query.veckodag == 6) {cookie.lor = query.food}
If (query.veckodag == 7) {cookie.son = query.food}
PS. The code is not correct, only for explanatory reasons
Hope you understand how I think
I’m from Sweden so my english is not perfect 