Author Archives: cbroccoli

GNS3 Configuration

To get an external connection to the WLAN, GNS3 needs to use the Windows7 bridged adapter and the Microsoft loopback adapter.

The first step is to add the MS Loopback Adapter in device manager (Action->Add Legacy Hardware->Install Manually->Network Adapters->MS Loopback Adapter).  Once this is done, go into adapter settings and add both the loopback adapter and the WLAN adpater to the Network bridge.

Then in GNS3, you can create a cloud and connect it to the NIO Ethernet to the Loopback adapter.  Remember to run GNS3 as admin or it won’t work.

How to manage menus in web pages

One of the reasons I started working with CSS was to get rid of my old Frames based web pages.  One of the main benefits of frames was that you could maintain your menus in a single file/frame and the information was valid for all content.  Unfortunately, just be implementing CSS this problem is not solved (although it is often written that CSS is a replacement for frames based web pages).

Thanks now to having been exposed to PHP, I have figured out the last piece of the puzzle… in PHP there are two functions… include() and require().  These two functions will take the  content from another page and place it into your web page.  Without knowing much else, these can be inserted in any page (renamed with a .PHP extension and made executable) and all of the static menu configuration from each page can be placed in the file you call.  This way, one can maintain the menu items in a single file and it will be valid for all content pages.  See the following tutorial for more information… PHP Includes.

Variable passing with require() and include()

Something new… variables are passed to require() and include() from the main page.  So based on the variable you set in the main page, you can return different pieces of code, menu items, etc.

In the main page you set the variable, call the file, and display the output.

<?php
$x=2;
require(“menu.php”);
echo $message;
?>

In the called file, evaluate the variable, set the output variable and return it to the main page.

<?php
if ($x==1)
$message=”Have a nice weekend!”;
else
$message=”Have a \”nice\” day!”;
return $message;
?>

Note that nested quotes need a \ preceeding them.  The code above would put… Have a “nice” day! … in the page.

The switch() function would probably make more sense if more than two or three values are expected.