www.webdeveloper.com
Results 1 to 5 of 5

Thread: PHP Content Update and scrolling

  1. #1
    Join Date
    Jul 2009
    Posts
    48

    Angry PHP Content Update and scrolling

    Hello all,

    Is there a way in which I can see if a file size is different after 500 milliseconds and if it is refresh the page? And this part isn't PHP but javascript, is there a way I can scroll an iframe to the bottom of its self?

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    Javascript can't access the file system so the only way I know of doing it is to use AJAX (which is esentially javascript) to send a request to a server side script like PHP to check the file size. If the file size has changed the server side script returns true to the ajax function otherwise it returns false.

    If the ajax function receives a 'true' response then you can use javascript to reload the web page.

    You can use setInterval() function to send the ajax request at set intervals. But 500 milliseconds is pretty short and you might have problems with a second ajax reqiest being sent to the server before the previous one has completed.

  3. #3
    Join Date
    Jul 2009
    Posts
    48
    Ive always known that javascript can't access the file system, but PHP can and all the PHP would have to do (I think) is get the filesize and use the echo function to make it into a javascript variable. P.S. I DO NOT know a single thing about Ajax

  4. #4
    Join Date
    Nov 2009
    Posts
    61
    php doesn't auto-refresh, you do have to use ajax. Look it up.

  5. #5
    Join Date
    Mar 2010
    Posts
    97
    Quote Originally Posted by esquilado View Post
    php doesn't auto-refresh, you do have to use ajax. Look it up.
    PHP Code:
    header("refresh: 15; url=$url"); 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles