I’m not sure what to post as the whole script is on one page. At the bottom right before the footer is this code. “$pages” is here. I can echo the $pages like this:
echo “Total Number of Pages: $pages<br /><br />”;
on the bottom of the page but it doesn’t work if I put it in the top. $pages isn’t mentioned in the script until the bottom when pagination script starts.
when you say ‘at the top’… I assume you mean at some point AFTER $pages is DEFINED… right?
PHP operates on a linear single-parse, whenever possible. If you put echo $pages; $pages = 1;, you wont get 1 out, because you havent changed $pages at the time you try to echo it.