redirecting...

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by TarinC, Oct 25, 2005.

  1. TarinC

    TarinC New Member

    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    0
    now i remember! last time i did i made the script i used the code before u edited it. can u put the code you put in before?
     
  2. Bryon

    Bryon I Fix Things

    Messages:
    8,149
    Likes Received:
    101
    Trophy Points:
    48
    I'm not sure what one you mean... Is it posted in another post earlier in this thread?
     
  3. Chirantha

    Chirantha New Member

    Messages:
    738
    Likes Received:
    0
    Trophy Points:
    0
    Last edited: Nov 9, 2005
  4. Bryon

    Bryon I Fix Things

    Messages:
    8,149
    Likes Received:
    101
    Trophy Points:
    48
    You should always close the file opened with fopen().. The overhead shouldn't really matter.
     
  5. TarinC

    TarinC New Member

    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    0
    sorry for bumping this old thread but i need help!

    Code:
    <?php
    [color=#0000bb]$handle = @fopen("[url="http://tps.servecounterstrike.com:27016/"]http://tps.servecounterstrike.com:27016/[/url]", "r");
    if ($handle) 
    {
    fclose($handle);
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Regular Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"<A href="http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td">http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td width=\"50%\">Online! <a href=\"steam: &quot;-applaunch 10 -game cstrike +connect tps.servecounterstrike.com:27016&quot;\">(Connect)</a></td></tr>"
    ."</table>";
    $content .= "</center><br><br>";
    } else {
    fclose($handle);
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Regular Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"<A href="http://tps.x10hosting.com/tps/custom/images/red-status.gif\"></td><td">http://tps.x10hosting.com/tps/custom/images/red-status.gif\"></td><td width=\"50%\">Offline!</td></tr>"
    ."</table>";
    $content .= "</center><br><br>";
    }[/color]
    [color=#0000bb]
    $handle = @fopen("[url="http://tps.servecounterstrike.com:27014/"]http://tps.servecounterstrike.com:27014/[/url]", "r");
    if ($handle) 
    {
    fclose($handle);
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Wc3FT Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"<A href="http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td">http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td width=\"50%\">Online! <a href=\"steam: &quot;-applaunch 10 -game cstrike +connect tps.servecounterstrike.com:27014&quot;\">(Connect)</a></td></tr>"
    ."</table>";
    $content .= "</center>";
    } else {
    fclose($handle);
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Wc3FT Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"<A href="http://tps.x10hosting.com/tps/custom/images/red-status.gif\"></td><td">http://tps.x10hosting.com/tps/custom/images/red-status.gif\"></td><td width=\"50%\">Offline!</td></tr>"
    ."</table>";
    $content .= "</center>";
    }
    ?>[/color]
    
    it stopped working after corey started the working on the server.
    does it look right? do i have everything i need? Will it start working after corey is done?
    is there a way i could put a time limit when it checks if the site exists?

    sorry for all the questions
     
    Last edited: Dec 21, 2005
  6. Brandon

    Brandon Guest

    I get an error with line 9

    PHP:
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"<A href="http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td">http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td width=\"50%\">Online! <a href=\"steam: &quot;-applaunch 10 -game cstrike +connect tps.servecounterstrike.com:27016&quot;\">(Connect)</a></td></tr>"
     
    Last edited by a moderator: Dec 21, 2005
  7. Bryon

    Bryon I Fix Things

    Messages:
    8,149
    Likes Received:
    101
    Trophy Points:
    48

    On line 9 try:

    Code:
    
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td">http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td width=\"50%\">Online! <a href=\"steam: &quot;-applaunch 10 -game cstrike +connect tps.servecounterstrike.com:27016&quot;\">(Connect)</a></td></tr>"
    
    Edit: *shudders* It's really bad HTML, but that should get rid of the error.
     
    Last edited: Dec 21, 2005
  8. Brandon

    Brandon Guest

    Parse error: parse error, unexpected ':' in /home/*******/public_html/****/****.php on line 9
     
    Last edited by a moderator: Dec 21, 2005
  9. TarinC

    TarinC New Member

    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    0
    thats weird... i dont get any errors. it used to work before corey started working on the server. maybe the new security settings dont allow it? im not sure...

    here... lemme post the whole file
    PHP:
    <?php
    if (stristr($_SERVER['SCRIPT_NAME'], "block-Servers.php")) {
        
    Header("Location: ../index.php");
        die();
    }
    $handle = @fopen("http://tps.servecounterstrike.com:27016/""r");
    if (
    $handle
    {
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Regular Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td width=\"50%\">Online! <a href=\"steam: &quot;-applaunch 10 -game cstrike +connect tps.servecounterstrike.com:27016&quot;\">(Connect)</a></td></tr>"
    ."</table>";
    $content .= "</center><br><br>";
    } else {
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Regular Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"http://tps.x10hosting.com/tps/custom/images/red-status.gif\"></td><td width=\"50%\">Offline!</td></tr>"
    ."</table>";
    $content .= "</center><br><br>";
    }
     
    $handle = @fopen("http://tps.servecounterstrike.com:27014/""r");
    if (
    $handle
    {
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Wc3FT Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"http://tps.x10hosting.com/tps/custom/images/green-status.gif\"></td><td width=\"50%\">Online! <a href=\"steam: &quot;-applaunch 10 -game cstrike +connect tps.servecounterstrike.com:27014&quot;\">(Connect)</a></td></tr>"
    ."</table>";
    $content .= "</center>";
    } else {
    $content .= "<center>";
    $content .= "<table>"
    ."<tr><td colspan=\"2\"><p align=\"center\"><b>Wc3FT Counter-Strike Server</b></td></tr>"
    ."<tr><td width=\"50%\"><p align=\"center\"><img src=\"http://tps.x10hosting.com/tps/custom/images/red-status.gif\"></td><td width=\"50%\">Offline!</td></tr>"
    ."</table>";
    $content .= "</center>";
    }
    ?>
     
    Last edited: Dec 21, 2005
  10. Jordan K

    Jordan K [B]tags dont work:([/B]

    Messages:
    1,528
    Likes Received:
    0
    Trophy Points:
    0
    You have an : where it's not supposed to be.
     
  11. TarinC

    TarinC New Member

    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    0
    the one u checked was messed up... all my links automatically added the <a> tag. the new one is the exact thing i have in the file.
     
  12. TarinC

    TarinC New Member

    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    0
    i think i know why it doesnt work. the port 27016 and 27014 must have been blocked when corey finished the sucurity fixes.

    is it possible to tell the "fopen" command to check if the site exists for a time limit?
     
    Last edited: Dec 25, 2005

Share This Page