code only works once

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mgoerz
Forum Newbie
Posts: 1
Joined: Mon Apr 21, 2003 3:47 am

code only works once

Post by mgoerz »

Hi,

I'm trying to put a magazine on the internet. Each page is a jpg-file, the
files are numbered in order (000.jpg, 001.jpg...). The site consists of a
frameset, the top frame (zeit_seite.php) displays the page, the bottom frame (zeit_nav.php) handels the navigation using PHP. In zeit_nav.php the back-button has the following code:

<?
//Back-Button
echo '<a href="zeit_nav.php?datei=' . length3(neg2null($_GET['datei']-1)) . '&rot=0&titel=' . datei2titel(length3(neg2null($_GET['datei']-1))) . '" target="_self"> <img src="zeitung/pics/bw_prev.gif" width="32" height="32" border="0" onClick="parent.mainFrame.location=''zeit_seite?datei=' . length3(neg2null($_GET['datei']-1)) . '&rot=0''"> </a></td>';
?>

Thus, when you click the button, a new navigtion page is generated (the
variables rot and titel are not really important here) in the bottom frame
and also the top frame is passed the new information which page to load
next. This works fine - but only once. When I have the last page loaded (by a standard link) and click the back-button, the previous page appears as it should. However, when I click the back-button again, nothing happens (i.e. the page reloads but it is exactly as before). The same is (respectivley) true for the next-button. Is there any explanation that the button works only once? Any help would be appreceated!

Greetings,
Michael Goerz
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

check the value of the variables you pass in the URL?
Post Reply