PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 5th, 2013, 07:22 PM
ben.y ben.y is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Location: Adelaide, South Australia
Posts: 13 ben.y User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 46 m 24 sec
Reputation Power: 0
Get page to keep loading whilst PHP script is loading

I'm having an issue with a php script I've got running.

Basically this script is grabbing share prices from a .csv and its rather slow...

so on index.php I've got the php file 'included' (
PHP Code:
<?php include ('majorindices.php') ; ?>
) but the problem i've got is that when i load index.php it won't load any of the html after that include tag until majorindices.php has finished doing its thing....I've had a read around and someone suggested using flush() but I can't seem to get that to work either.

I'm guessing I'm going to need some sort of ajax script? If anyone could help with suggestions i'd really appreciate it.


Thanks in advance.
Ben

Reply With Quote
  #2  
Old January 5th, 2013, 08:34 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,682 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 2 h 24 m 24 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Consider moving that stuff into a cronjob. Every once in a while, like a minute, some script runs which updates the prices in your database. It would run entirely behind the scenes without your regular code having to worry about it.

Reply With Quote
  #3  
Old January 5th, 2013, 08:46 PM
ben.y ben.y is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Location: Adelaide, South Australia
Posts: 13 ben.y User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 46 m 24 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
Consider moving that stuff into a cronjob. Every once in a while, like a minute, some script runs which updates the prices in your database. It would run entirely behind the scenes without your regular code having to worry about it.


Good idea, never thought of that, thanks very much requinix

Reply With Quote
  #4  
Old January 6th, 2013, 05:56 PM
VBAssassin VBAssassin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 4 VBAssassin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 15 sec
Reputation Power: 0
You may also want to consider using APC for caching and easily sharing such data across your scripts. Beats using a database or the file system any day as long as you aren't storing so much data that it would fill up your comps ram!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Get page to keep loading whilst PHP script is loading

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap