INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

PHP page loads slowly and always needs to be refreshed before loading correctly.

PHP page loads slowly and always needs to be refreshed before loading correctly.

PHP page loads slowly and always needs to be refreshed before loading correctly.

(OP)
I have a main user php page that has a lot of stuff going on. I return a lot of php data into a table that only shows 10 rows at a time using javascript. I also have an add new form under that. The issue that when opening that page I almost always get the data listed without the html and css being rendered in the browser and I have to refresh the page 2, 3 or sometimes 4 times before it renders correctly. How can I make that page load quicker and without needing to refresh all the time. This happens on various pcs using various browsers and I've also changed the css style sheets and that didn't make any difference. I'm listing the js page links at the bottom of the page too. Is it just the amount of data being returned? There are 2364 records in this particular table.

Thanks!

RE: PHP page loads slowly and always needs to be refreshed before loading correctly.

The first step to resolving this would be to run it through a HTML validation service.
http://validator.w3.org/

This will expose quirks in the HTML that may be throwing your browsers for a loop.

You'd probably need to share a sample URL for anyone here to offer specific suggestions.

RE: PHP page loads slowly and always needs to be refreshed before loading correctly.

Without seeing the code that is rendering the page its very difficult to say. However if you are only showing 10 rows, why are you returning 2364?

There are ways to optimize data loading, but we would need to know your structure and page functionality to offer any specific advice.

But as a warning, this is not something you can just add a couple of lines of code to and have it work better. This is more likely a re-engineering of the page which will probably take some time.

Also since HTML is static it would probably be a good idea to post in forum434: PHP.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech

RE: PHP page loads slowly and always needs to be refreshed before loading correctly.

(OP)
Sorry guys I was busy with clients for the end of last week.

Quote:


However if you are only showing 10 rows, why are you returning 2364?

The table shows 10 rows at a time with Next and Previous buttons. User can re-order the listing by any column header or sort by first letter of last name.

The user also wants me to add a Search name feature too. I'll be working on that today.

Quote:


The first step to resolving this would be to run it through a HTML validation service.

Looks like I have some cleaning up according to the scan.

Thanks guys!

RE: PHP page loads slowly and always needs to be refreshed before loading correctly.

It seems like your page is (slowly) returning 2364 rows of hidden results, which your javascript then accesses to serve up ten rows at a time. That might not be the best way to do it.

Have you considered an AJAX approach - where your initial page load includes no data at all, and you use Javascript to request data as you need it?

You also might want to examine the database query (or whatever else it is) that populates the 2364 rows of results in the first place. Are there things you can do to speed that up?

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd

RE: PHP page loads slowly and always needs to be refreshed before loading correctly.

(OP)
Hi Chris,

You may be correct. On this particular page the data is a list of Donors and the last names are made to link to their Donation Details. There are a couple of thousand right now and that will only grow over time. Can you get me started on the ajax?

Thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close