Jump to content

Unwanted Character


Manny

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.

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...