Forum Moderators: coopster
www.example.com/directory/mypage.php?page=1 If I click on the link to display page 2, page 3 and so on...
<a href=mypage.php?page=2>Page 2</a> Most of the time it displays the page correctly, but sometimes it will just display a while background page with a "1" (w/o quotes) on the upper left part of the page.
I have checked my source repeatedly and I dont see any problem with my codes.
What seems to be the cause of this problem?
[edited by: Gian04 at 1:45 am (utc) on June 20, 2007]
There can be many different reasons why it isn't working. So you say you aren't getting any error messages?
Check your logic--make sure that everything is happening correctly. Add some echo statements to show that everything is working.
If you aren't getting any php errors, then it is not a syntax error. So it's either a logic error, or a problem with your server.
If you are confident that the logic is flawless and that there is no way a '1' could be the result of the script under certain circumstances, which may appear to be random, then it is a problem with the server; however, if its only happening with this script, than it is unlikely.
I cannot think of any other reason why the script would randomly stop working. Unfortunately without the code, you are going to have to do some investigation yourself.
We have a thread on troubleshooting [webmasterworld.com] that you may want to take a look at.
When you want to start debugging:
First, cut your source in half, match braces, and see which half the problem is in.
Second, cut your problematic source section in half, match braches, and see which half the problem is in.
Third, repeat second; until you have indentified the single line or command which causes the problem.
Finally, post that problematic line, which causes the problem even when all alone without any other PHP around it.
vincevincevince,
There is no error_log.
What makes me difficult to trace the problem is theres no pattern Im sure that its random, another problem is, if the problem is just a part of my code, at least the upper part of the page should load (header, logo, etc), in this case its a white page with "1"
You can try turning up error_reporting [php.net] in the script. Add this to the top:
error_reporting(E_ALL);
Do you have any mod_rewrites going on? What do your error documents look like? The problem doesn't make much sense...
forget about dynamic, database etc..
create a dir with 3 or 4 pages with hardcoded "hello world1, 2, etc..
use you pagination GET method and let us know how it works.
BTW
as is, if you modify in your browser the result, like changing p1 by p2 and press enter
does it deliver p2?
if entering a non existing page creates a problem
you mostly have a flaw somewhere in the pagination script.
Do you have something in your pagination that should prevent a non existing page to be called?
the pagination section should not be more than 50...+ lines
post it.
When I say non existing page its a totally different PHP page (not the page number)
www.example.com/directory/mypage.php?page=1<a href=mypage.php?page=2>Page 2</a>
When I say non existing page it is something like
http://www.example.com/nonexistingpage.php and not www.example.com/directory/mypage.php?page=nonexistingpage
And im surfing my site for more than 7 hours since my previous post wasting my bandwidth hoping that Ill be able to figure out whats the real problem.
But until now I didnt encounter the white page with "1". I really dont know what it is. I did not contact my host because I dont know how to convince them that the problem is not my code, and Im afraid that they will not be able to see a white page with "1" because it shows in random.
By the way I have seen it both on IE and FF.
[edited by: Gian04 at 7:41 am (utc) on June 21, 2007]