NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Output not shown in IDE *solved*


Joined: 07 Apr 2005
Posts: 3
Reply with quote
I've a simple php-script that works, but after I insert the first two echo lines, the output is no longer shown in the ide.
(PHPed 3.3 Build 3332)

The script works fine when I upload it to the production system.

Any hints are very welcome.

Thanks
Bernhard


Code:
<?
 echo "<html><head><title>Find Hostnames in IP-Range</tilte></head>";
 echo '<body background="/images/kuglight.jpg">';

$register_globals = (bool) ini_get('register_gobals');
If ($register_globals)
{
   $self = $PHP_SELF;
   $ipadress=getenv("remote_addr");
}
else
{
   $self   = $_SERVER['PHP_SELF'];
   $ipadress=$_SERVER['REMOTE_ADDR'];
   $submit = $_POST['submit'];
};

  if (isset($_POST['input']) and !empty($_POST['input']))
  {
    $err = false;
    $input = trim(stripslashes($_POST['input']));
    if (ip2long($input))
    {
      $ipadress = $input;
    }
    else
    {
      $ipadress = gethostbyname($input);
      if ($ipadress == $input)
      {
        echo 'Error: Wrong input';
        $err = true;
      }
    }
    if (!$err)
    {
      // Auswertung der IP
      list($ip1,$ip2,$ip3,$ip4)=explode('.',$ipadress);
      echo "<table>";
      for ($a=1;$a<255;$a++)
      {
        $scanip="$ip1.$ip2.$ip3.$a";
        $scanip= preg_replace ("/[^A-Za-z0-9.-]/","",$scanip);
        $newhostname=gethostbyaddr($scanip);

        echo "<tr><td>$scanip</td><td><img src=\"/images/pfeil.jpg\" width=40 height=20></td><td><a href=\"http://$newhostname\">$newhostname";
        echo "</a></td></tr>";
      }
      echo "</table>";
    }
  }
  else
  {
    echo "Usage: input ip-adress or hostname<br>";
    echo "You will get a list of hostnames that are configured within the same ip-range.<br>";
  }
  echo '<form method="post" action="'.$self.'">';
  echo '<p><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">';
  echo '<b>Hostname or Ipaddress :</b>';
  echo '<input type="text" name="input" size="40" value="">';
  echo $ipaddress;
  echo '</font></p>';
  echo '<p> <font face="Verdana, Arial, Helvetica, sans-serif">';
  echo '<input type="submit" name="submit" value="Find_all_hosts">';
  echo '</font></p></form>';
  echo '</body></html>';
?>
View user's profileFind all posts by Bernhard BuchreiterSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
while debugging the script please check a) if anything shown in the Errors tabbed window (see it in the right bottom corner of the IDE) and b) if anything is shown in the Output tabbed window nearby.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Apr 2005
Posts: 3
Reply with quote
There is no error shown, and the output in the output-windows looks ok.
The problem was a typo in the first echo line
Code:

echo "<html><head><title>Find Hostnames in IP-Range</tilte></head>";

I wrote "tilte" in case of "title".

By the way (with the wrong "tilte" string):
In the outputwindow the output is shown in one very, very long line and it is not possible to go to the end of the line with the scroll-bar (click the scrollbar and move it to the right). The "right" arrow in the scrollbar works correct! (Maybe a little bug in this version)

Thanks for your answer anyway.
Bernhard
View user's profileFind all posts by Bernhard BuchreiterSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Code:
In the outputwindow the output is shown in one very, very long line and it is not possible to go to the end of the line with the scroll-bar

It was done intentionally. The bottom scrollbar maintains a fixed range for scrolling to avoid re-calculating the length of each visible line whenever you modify any line (by typing, inserting, pasting etc) or scroll vertically. It speeds up the work. And yes you can scroll to the most right position by the right arrow. What I'd like to have there as a workaround is word-wrap feature enabled.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Output not shown in IDE *solved*
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic