Welcome to Help4Web.co.uk - Web Design Help, Html Tutorial, Php, Asp , SQL help and CCNA, MCSE definitions!
Google
Webkpop-web.com

     Main Menu

· Home
· Free Downloads
· Computing FAQ
· Contact Us
· Free Software Downloads
· Tech Forum
· Technology News
· Web Design Help
· Web Links
· Your Online Account
· Your PM



     Web Browser


     Website Links
Supermediastore! #1 in Computer media & Accessory

White Papers IT
Learn Korean
Chinese Pop Music
Advertise Kpop
Korean Pop Site Map
Web Design
Pop Music
Chinese Girls
HK Pop Korean Music
Lee Hyori
Hyori
Boa Park Ji Yoon
Baby Vox YG Family
Jeon Ji Hyun
1 Tym Ha Ji Won
Shyne Rain Bi
Shin Mina SM Town
Fly to the Sky
Korean Girls and Models
Nicholas Tse
161 Clan
보아
Edison Chen
Sung Hi Lee
Shinhwa
Andy Lau Jay Chou
White Papers
Case Study SES
Kelly Chen
Liu Yi Fei Sammi Cheng
Jordan Chan Music
Computer Jobs IT

Computer Help Forum and Programming Advice :: View topic - router config with php
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log inLog in 

router config with php

 
Post new topic   Reply to topic    Computer Help Forum and Programming Advice Forum Index -> Php
View previous topic :: View next topic  
Author Message
trekkie
Web Design Newbie
Web Design Newbie


Joined: Oct 18, 2005
Posts: 15

PostPosted: Tue Oct 18, 2005 6:56 pm    Post subject: router config with php Reply with quote

Hi! I'm currently doing on a pj which need to make amendment to the source code written by others. It is some sort of web-based configuration of Router/Switch using php programming. The source code which was done previously had problem showing full information of router/switch.

Using HypterTerminal
E.g: show run configuration information.
It has a limited maximum no. of lines to display the informations, (30 lines). Once it reached the line tat say "more", you will have to press either spacebar to display the remaining information or enter to display line by line.

Web-Based Configuration
After loggin into the router config, u will be direct to it general page which display the show run config information. After the "more", we found the first 3 lines missing. Provided below is the source code tat program tis part. I have stated the comments tat I don't understand. Do hope there's ppl willin to help me solve this problem.

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

 if (!$fp)
 {
   $results = "Error: could not open socket connection";
}
else
{
   fputs ($fp, $login_info[2]."\n");
   fputs ($fp, "en\n");
   fputs ($fp, $login_info[3]."\n");
   fputs ($fp, "show run\n");
   fputs ($fp, "\r");

//Require more explanation on tis portion till the end. Solve the problems.
$i = 0;
for ($i=0; $i<=30; $i++)
{
 //how do tis function? substr() meaning...
    if (substr($tmpecho, 0, 9) != " --More--")
       $moredetails .= fgets ($fp, 1024);
}
fputs ($fp, "\r");

//How does tis looping and checking functions.
while (true) {
   fputs ($fp, " ");
   $tmpecho = fgets ($fp, 1024);
     if (substr($tmpecho, 0, 9) != " --More--"){
         $moredetails .= $tmpecho;
    }
     if (substr($tmpecho, 0, 3) == 'end') {
  break;
    }
}
}
fclose($fp);


I'm appreciate if u could spend some time with me. Thanks ppl.
Back to top
View user's profile Send private message
Jon
Web Design Admin
Web Design Admin


Joined: Jul 12, 2004
Posts: 72

PostPosted: Tue Oct 18, 2005 6:58 pm    Post subject: Reply with quote

I supose you are playing with Cisco Routers , if so I can give you a trick. When you are on enable you can use the command "terminal length 0" which makes that every time you issue a command the Cisco Dev will output all results without asking for More and More.

Hope this helps you!
_________________
Free MusicCpopServer Definition
Back to top
View user's profile Send private message Visit poster's website
trekkie
Web Design Newbie
Web Design Newbie


Joined: Oct 18, 2005
Posts: 15

PostPosted: Tue Oct 18, 2005 7:00 pm    Post subject: Reply with quote

cool thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Computer Help Forum and Programming Advice Forum Index -> Php All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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







Learn Chinese | Learn cantonese | Learn Mandarin | Grace Park | Party Organisers | Kaila yu | Phone Card | Twins | Chinese Society | Loans UK | BokuMaro | CV Help Book | Chinese Wife | Korean Singles | British Born Chinese | Bae Yong Jun | Speak Korean | Chinese Models | Music | Information Security Management | Maritime Greenwich Campus | Covering Letters Help | Chinese Music | Jang Nara | SES | YG Family | Learn Korean | Firewall Definition | Server Definition | Wireless Network Definition | E-Commerce Definition | Sales Leads | Application Firewall | CCNA definitions | Research Papers | Webcast | CV Help

Author KPop Music :- Jon Bock ( Chinese Pop Music Learn Korean )
Produced by Kpop-Web Design Associates, all rights not reserved.
Internet Marketing and Search Engine Optimisation Software Defined Radio