I have a page with tabs using twitter bootstrap and for tabs I’m using this modification https://github.com/twitter/bootstrap/pull/581#issuecomment-4828029 that gives me url’s like index.php?id=1#/profile ( in case profile tab is active ), index.php?id=1#/contact ( in case contact tab is active ).
The problem is when I’m submitting a form the page that handles the form sends me back with $_SERVER[‘HTTP_REFERER’] but its not redirecting me to index.php?id=1#/profile it redirects me to index.php. As I understand it’s because the the #/profile is client side and the index.php is server-side. Is there any way making the page that handles the form redirect back and make the last visited tab active ?
Add a hidden field to the form and put the hash in it. Then have your form processing script append the hash to the referer when constructing the redirect.
Another option is to put the current tab in a cookie, and select that tab whenever the page is opened.