Jump to content

Echo comments next 5


antonysimpson

Recommended Posts

<?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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...