Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9268253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:45:46+00:00 2026-06-18T14:45:46+00:00

I have the script below, and it can ping any IP statically put in

  • 0

I have the script below, and it can ping any IP statically put in the file, but when I post to it it always fails.

<?php
$server = $_POST['ip'];
if (!$socket = @fsockopen("$server", 80, $errno, $errstr))
{
  echo "<font color='red'><strong>Offline!</strong></font>";
}
else 
{
  echo "<font color='green'><strong>Online!/strong></font>";


  fclose($socket);
}

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:45:48+00:00Added an answer on June 18, 2026 at 2:45 pm

    I’ve added several functions:

    <?php
    function port($Host, $Port = '')
       {
       if (strstr($Host, ':'))
          {
          if (strstr($Host, '/'))
             {
             $Output = substr($Host, strpos($Host, ':') +1, (strpos($Host, '/') -1) - strpos($Host, ':'));
             }
          else
             {
             $Output = substr($Host, strpos($Host, ':') +1);
             }
          }
    
       if ((isset($Output)) and ($Output != ''))
          {
          return $Output;
          }
       else
          {
          if ($Port != '')
             {
             return $Port;
             }
          }
       }
    
    function server($Host)
        {
       if (strpos($Host, '//'))
          {
          $Host = substr($Host, strpos($Host, '//') +2);
          }
    
       if(strstr($Host,"/"))
            {
            $Host = substr($Host, 0, strpos($Host, "/"));
            }
    
       if(strstr($Host,":"))
            {
            $Host = substr($Host, 0, strpos($Host, ":"));
            }
    
        return $Host;
        }
    
        $Host = $_GET['ip'];
        $Host = server($Host);
    
        $churl = @fsockopen($Host, 80, $errno, $errstr, 10);
    
    if (!$churl) { 
        echo("<div><b>Offline</b></div>"); 
        } 
        else 
        { 
        echo("<div><b>Online</b></div>"); 
        }
    
    
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the below script: <script type=text/javascript> function get(row){ alert(row); $.post ('getpeopleinjobs.php',{ postvarposition: form.position1.value,
I have the following script below where I try to mimic a file upload
I have a small script which im using to test PHP mail(), as below:
I have a php script below known as cancelimage.php where it will display a
I have a php script below known as cancelimage.php where it will display a
I have php script as below; $ages = array(Peter=>32, Quagmire=>30, Joe=>34); $ages2 = 'Peter=>32,
i have a problem with the imagerotate() PHP function. I run the script below,
I have the below script to import data from a csv file on my
I have the script listed below that I can't seem to get the issue
I have this script below that i would like to tweak so it can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.