Jump to content

[SOLVED] Maintaining a tab value?


unsider

Recommended Posts

Let's say you have 3 tabs:

 

1 | 2 | 3

 

When the page is loaded for first time it is defaulted to "1". The user, regardless of log-in status, sets the tab to "2".

 

I would like to maintain the tab value of "2" from visit to visit.

 

What would be the best method of doing this? I would think cookies, and it would make the most sense, but I have no idea.

 

If this wasn't clear please let me know.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/120959-solved-maintaining-a-tab-value/
Share on other sites

cookies would definitely be the way to go for something so simple.  if you only want it to stay for the duration of their browsing, you could use sessions like anything else, but clearly you want it to persist forever and ever and ever, amen.  so cookies are your solution.

 

another option would be to store it in the database by IP, but IP's are notoriously unreliable and intermittently get recycled by some ISPs (depending on their DHCP settings).

cookies would definitely be the way to go for something so simple.  if you only want it to stay for the duration of their browsing, you could use sessions like anything else, but clearly you want it to persist forever and ever and ever, amen.  so cookies are your solution.

 

another option would be to store it in the database by IP, but IP's are notoriously unreliable and intermittently get recycled by some ISPs (depending on their DHCP settings).

 

Alright, great!

 

Thanks for confirming.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.