Hello
I have used a code snippet from http://www.triquitips.com/php_scripts/image_gallery_session_iframe.php
on my website.
The code basically uses what was apparently a loophole in pre PHP 4.2.3 to pass session variables to an image switcher. The code in the include "gallery.php" is this:
<?php
// 7 = number of pictures in the folder
session_start();
$id += $add;
if ($id < 1){$id = 7;}
if ($id > 7){$id = 1;}
session_register("id");
?>
with a link to the first picture like this:
<img src="/pathtoimage/image-<?php echo $id; ?>.jpg" alt="" />
There are then two Previous / Next links on the main page like this:
<a href="gallery.php?add=-1" target="iframe"> Prev</a> |
<a href="gallery.php?add=1" target="iframe">Next </a>
It's great, it's simple - but it doesn't work now I've switched hosts to a server running PHP 4.4.2 (with register_globals turned off).
I get an error message saying something about session.bug_compat_42 and
session.bug_compat_warn. The first image displays, but the previous / next links don't work.
I have looked in php.net manual and it says to change to using $_SESSION instead of session_register, which I have tried to do in several different combinations, none of which work. I'm just wondering whether I should give up now as this type of script will NEVER work in 4.4.2, or if there is a workaround / hack, that someone can help out with.
any suggestions are very, very gratefully received.
Cheers,
Rupie