How to refresh a php-script? menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    TFE-Wow's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to refresh a php-script?

    hi all,

    iam looking for a refresh script for our server status.

    ive tryed the
    *meta-code(html)*= (<meta http-equiv="refresh" content="240;url=blabla">)
    *function refreshme (java)

    ive also found some php-script, but the problem is with these scrips is that the reload/refresh the howl page.

    This is a example of the script i currently using:


    <?php

    $ip = "#myip";
    $port = "#serverport";

    if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
    echo "<img src='../images/image_offline.jpg' />";
    else{
    echo "<img src='../images/image_online.jpg' />";
    fclose($sock);
    }
    ?>
    What i need is a script that only reload/refesh this part

    How to refresh a php-script?
  2. #2
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    javascript:window.location.reload()

    ↑ Tried that?

  3. #3
    TFE-Wow's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its not exactly what i am looking for.
    these scripts when the reload leave a fraction of a sec a ugly white background



    there is a fixed background image, but that one gets reloaded aswell

  4. #4
    Berusadeankan's Avatar Member
    Reputation
    11
    Join Date
    Dec 2007
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use jQuery!

    Code:
    $(document).ready(function () {    
                var refreshId = setInterval(function()
                {            
                     $('#updateDiv').load('updatePhp.php');
                }, 500);            
            });
    Then just make a div like this
    HTML Code:
    <div id="updateDiv"></div>
    and you're done!

  5. #5
    Sirupsen's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    260
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you do: header(Location: pagename.php);
    It should work as well, or else you might wanna look up the header() php function.



  6. #6
    Berusadeankan's Avatar Member
    Reputation
    11
    Join Date
    Dec 2007
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the header(Location: ...) function only redirects the user to another page. It has no repeating redirect so to say ;>

  7. #7
    Kirth's Avatar Active Member
    Reputation
    58
    Join Date
    Nov 2007
    Posts
    274
    Thanks G/R
    2/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Berusadeankan View Post
    Use jQuery!

    Code:
    $(document).ready(function () {    
                var refreshId = setInterval(function()
                {            
                     $('#updateDiv').load('updatePhp.php');
                }, 500);            
            });
    Then just make a div like this
    HTML Code:
    <div id="updateDiv"></div>
    and you're done!
    jQuery is indeed your best bet. Whereas other methods reload the entire page, the jQ method only reloads the text within the updateDiv.

  8. #8
    Erra's Avatar Member
    Reputation
    10
    Join Date
    Apr 2007
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Kirth View Post
    jQuery is indeed your best bet. Whereas other methods reload the entire page, the jQ method only reloads the text within the updateDiv.
    Can be done using only javascript, don't need jQuery though it simplifies it, so maybe it's the smarter choice!

Similar Threads

  1. [RELEASE]Web Registration Script(guided), Secured, 4 steps Registration PHP script
    By Viking.nor in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-31-2008, 03:59 AM
  2. PVP RANKINGS [php] script?
    By Algorithm in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-16-2008, 12:31 PM
  3. How to fix this LUA Script???
    By marcosgue in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-08-2008, 07:51 AM
All times are GMT -5. The time now is 06:41 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search