I need to hide or show a div that have a slideshow inside.
The idea is to give to the users a link for them to hide or show the div.
At the moment I call the slideshow on the body of the page with <?php include('slideshow.php'); ?>
After the user clicks on the link to hide/show the div I will like to call a second file (
<?php include('no-slideshow.php'); ?> ) which contain a diferent div.
As far as I had found there is no way to achieve this with sessions, or at least I did’t find a solution to this problem.
My guess is that this need to be done with cookies, but I don’t understend how.
If you don’t want to use JavaScript only way to achieve that is to use link (requires page to be reloaded).
This is basic logic only, not a complete solution, but think you’ll get the point.
Create a link on web page to the server-side script.
Create script togle_visibility.php to process user’s request.
All you need now (after return to original page) is to check value stored in cookie and decide do you want od not to show that div to do user.
EDIT: $hidediv condition.
It works if user has JavaScript disabled but doesn’t work if cookies has been disabled in browser settings.
I did not check this code, so same typos are possible.