antonysimpson Posted January 1, 2007 Share Posted January 1, 2007 <?php$valueOfgb = $_GET['gbpage'];if ($valueOfgbpage=="") {echo "first 5 comments"; echo "1";echo "2";echo "3, etc.";echo "<a href=\"page.php?gbpage=1">Next Page</a>}elseif ($valueOfgbpage=="1") {echo "next 5 comments";echo "6";echo "7";echo "8, etc.";}elseecho "Error";?> Hiya Guys, im wanting the code of print the next 5 comments and remove the previous 5 but it doesnt work!! It just continues to display the first 5 comments, can anyone help?Cheers,antony x Link to comment Share on other sites More sharing options...
boen_robot Posted January 1, 2007 Share Posted January 1, 2007 I'm not sure I see the point and the problem, but I think you need to place parenthesis at the srart and end of an else. Also, there's the "elseif" language construct: <?php$valueOfgb = $_GET['gbpage'];if ($valueOfgbpage=="") {echo "first 5 comments"; echo "1";echo "2";echo "3, etc.";echo "<a href=\"page.php?gbpage=1">Next Page</a>}elseif ($valueOfgbpage=="1") {echo "next 5 comments";echo "6";echo "7";echo "8, etc.";}else {echo "Error";}?> Link to comment Share on other sites More sharing options...
Bjørnar Posted January 2, 2007 Share Posted January 2, 2007 I believe the problem is that you're checking if $valueOfgbpage is 1, while you should be checking $valueOfgb.In other words, replace this: $valueOfgb = $_GET['gbpage']; with this: $valueOfgbpage = $_GET['gbpage']; Link to comment Share on other sites More sharing options...
antonysimpson Posted January 2, 2007 Author Share Posted January 2, 2007 Hey dude, your right. I spent hours examining my code closely last nite, and finally found the same as you. Then I logged on here to check responces and you'd spotted it too!! Thanks again!!Antony Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now