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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.