Jump to content

Way is this double spacing


kat35601

Recommended Posts

Why is double spacing the results I know it's stupid simple but I can't see it. I removed $host ip so if you test put one in there.

<!doctype html>

<html lang="en">
<html>
<body>
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = "insert IP";
$ports = array(21 ,22 ,23 ,25, 80, 81, 110, 143, 443, 587, 2525, 3306);
foreach ($ports as $port)
{
    $connection = @fsockopen($host, $port, $errno, $errstr, 2);
    if (is_resource($connection))
    {
        echo '<p>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</p>';
        fclose($connection);
    }
    else
    {
        echo '<p>' . $host . ':' . $port . ' is not Open.</p>';
    }
}

?>

    </body>
</html>

 

Link to comment
Share on other sites

When you say double spacing, do you mean there's extra space between each line. So it goes

host:port...

host:port...

etc.

If so, it's because each line is surrounded with a paragraph tag. By default, browsers add space between paragraphs. You could use CSS to adjust the spacing...or you could switch to the break or list tag.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.