Jump to content

Unwanted Character


Manny
 Share

Recommended Posts

The following post relates to an issue on this page:http://mercury.chris-mann.co.uk/burndenaces/news/In the grey divs at the top and bottom of the main content, you will see the pagination "1 ( Page 1 of 2 ) NEXT LAST".I can't work out why the "1" is there at the beginning and is there also if you click on the next link.The section of my code which the problem will probably lie with is:

//10. Display drop down of news archive by monthecho '			<div class="titlestrip_sub_paging">				', require("archivedropdown.php"),'';//11. Paginationif ($page != 1) { $prevpage = $page-1;echo '				<a href="' . $_SERVER["PHP_SELF"] . '?archive=', $archiveMonth, '&page=1">FIRST</a>				<a href="' . $_SERVER["PHP_SELF"] . '?archive=', $archiveMonth, '&page=', $prevpage, '">PREV</a>';}//Next we inform the user of his current position in the sequence of available pages.if ($numrows > $rows_per_page) { echo '				( Page ', $page, ' of ', $lastpage, ' )';}//This code will provide the links for any following pages.if ($page != $lastpage) { $nextpage = $page+1;echo '				<a href="' . $_SERVER["PHP_SELF"] . '?archive=', $archiveMonth, '&page=', $nextpage, '">NEXT</a>				<a href="' . $_SERVER["PHP_SELF"] . '?archive=', $archiveMonth, '&page=', $lastpage, '">LAST</a>';}echo '			</div>';

I've checked the markup and it shows that it isn't to do with the actual pagination links, leading me to believe I've done something wrong with the require statement at the top. Here is the markup:

1				( Page 1 of 2 )				<a href="/burndenaces/news/index.php?archive=January 2010&page=2">NEXT</a>				<a href="/burndenaces/news/index.php?archive=January 2010&page=2">LAST</a>

Link to comment
Share on other sites

<a href="' . $_SERVER["PHP_SELF"] . '?archive=', $archiveMonth,'&page=', $prevpage,'">PREV</a>Nevermind. Disregard this post.

Edited by RahXephon
Link to comment
Share on other sites

//10. Display drop down of news archive by monthecho '			<div class="titlestrip_sub_paging">				', require("archivedropdown.php"),'';

You're echoing the result of require("archivedropdown.php"). The result is 1 (well, it's actually true, but true is displayed as "1").

Link to comment
Share on other sites

OK, I changed it to this and it sorted the problem. Thanks Synook.

echo '			<div class="titlestrip_sub_paging">				'; require("archivedropdown.php");

Edited by Manny
Link to comment
Share on other sites

Remember that including/requiring content is equivalent (more or less) to copying the included file's contents and pasting it into the location of the include call. This is unlike, say, invoking file_get_contents(), where the contents of the file is returned with the function and then can be manipulated and output.

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
 Share

×
×
  • Create New...