hides line

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
akazukin
Forum Newbie
Posts: 4
Joined: Thu Oct 06, 2005 8:29 pm

hides line

Post by akazukin »

How can i hide this line "newSwitch#terminal length 0" from printing out??
part of the Output
Password:
newSwitch>en
Password:
newSwitch#terminal length 0
newSwitch#show run
Building configuration...

Current configuration : 2027 bytes
!
version 12.1
part of the source code

Code: Select all

$fp = fsockopen ($host, $port, $errno, $errstr);

  if (!$fp)
   {

  $results = "Error: could not open socket connection";
  }
else
  {
  	fgets ($fp, 1024);

	  fputs ($fp, $login_info[2]."\n");
	  fputs ($fp, "en\n");
	  fputs ($fp, $login_info[3]."\n");
	  fputs ($fp, "terminal length 0\n");
	  fputs ($fp, "sh vlan\n");
	  fputs ($fp, "\r");

	while (true)
	{
 		$tmpecho = fgets ($fp, 1024);

   		$moredetails .= $tmpecho;
   		fputs ($fp, "\r");

    	if (substr($tmpecho, 0,  == '------- ')
    	{
			break;
   		}
	}
   }
fclose($fp);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

comment the line from the code out :?
akazukin
Forum Newbie
Posts: 4
Joined: Thu Oct 06, 2005 8:29 pm

Post by akazukin »

i can't comment tat out. If i did, it won't show the complete information. Instead it will pause at certain max. no. of line. The output was printed out by the looping. tat is why i was wondering how can i dump tat cisco command out from the output but it still doin the job?
akazukin
Forum Newbie
Posts: 4
Joined: Thu Oct 06, 2005 8:29 pm

Post by akazukin »

problem solved. :lol:
Post Reply