Guest elthomo Posted April 2, 2008 Share Posted April 2, 2008 Ok well my code on on the plus just sets the value to 10 rather than adding 10 to the value $startrow and the minus just sets the value to -10 rather than taking away 10 from the value start row. Any Ideas chaps?? echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow +10).'&zoek='.($zoek).'&searchcriteria='.($searchcriteria).'">Next</a>'; echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow -10).'&zoek='.($zoek).'&searchcriteria='.($searchcriteria).'">Previous</a>'; Quote Link to comment Share on other sites More sharing options...
ansarka Posted April 2, 2008 Share Posted April 2, 2008 echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow +10).'&zoek='.($zoek).'&searchcriteria='.($searchcriteria).'">Next</a>'; if($startrow <10 ) { echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow=0&zoek='.($zoek).'&searchcriteria='.($searchcriteria).'">Previous</a>'; }else { echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow -10).'&zoek='.($zoek).'&searchcriteria='.($searchcriteria).'">Previous</a>'; } Quote Link to comment Share on other sites More sharing options...
Guest elthomo Posted April 2, 2008 Share Posted April 2, 2008 Thanks for the quick reply but the problem is with the +10 -10 actually setting the value to 10 or -10 rather than adding or subtracting 10. So the webadress looks like http://www.myurl.com/search.php?startrow=-10 when the previous value was 10. (so it should have been 0) and clicking next always looks like http://www.myurl.com/search.php?startrow= 10 not 20,30,40 and so on. Quote Link to comment Share on other sites More sharing options...
Guest elthomo Posted April 2, 2008 Share Posted April 2, 2008 Ok stupid error and I'm kicking myself now I hadn't declared the var $startrow till after that code SoLVED Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.