Help needed!
Posted: Wed Jun 03, 2009 12:27 am
Hi, Im currently doing a school project. It seem that everytime i try to launch this .php file, it will open up another tab in Dreamweaver instead of opening it in the IE. Think its the coding error. Need help!
Code: Select all
<?php
session_start(); // load session
$_SESSION['errorMessage'] = "";
if($_POST['IOS'] != "")
{
if($_POST['IOS'] == "5r5")
{
$_SESSION['manual'] = "5r5|05|210";
header('Location: recover IOS/5r5_IOSrecovery.php');
exit();
}
if($_POST['IOS'] == "5r6")
{
$_SESSION['manual'] = "5r6|06|210";
header('Location: recover IOS/5r6_IOSrecovery.php');
exit();
}
}
if($_POST['device'] != "")
{
if($_POST['device'] == "5r2") // device name
{
$_SESSION['manual'] = "5r2|02|210"; // router name, line number, ip address
if ($_SESSION['user'] = 1)
{
$_SESSION['5r2_UserID'] = $_SESSION['UserID'];
}
header('Location: 5r2 Switch/General.php'); // page load
exit();
}
if($_POST['device'] == "5r3")
{
$_SESSION['manual'] = "5r3|03|210";
if ($_SESSION['user'] = 1)
{
$_SESSION['5r3_UserID'] = $_SESSION['UserID'];
}
header('Location: 5r3 Router/General.php');
exit();
}
if($_POST['device'] == "5r4")
{
$_SESSION['manual'] = "5r4|04|210";
if ($_SESSION['user'] = 1)
{
$_SESSION['5r4_UserID'] = $_SESSION['UserID'];
}
header('Location: 5r4 Switch/General.php');
exit();
}
if($_POST['device'] == "5r5")
{
$_SESSION['manual'] = "5r5|05|210";
if ($_SESSION['user'] = 1)
{
$_SESSION['5r5_UserID'] = $_SESSION['UserID'];
}
header('Location: 5r5 Router/General.php');
exit();
}
if($_POST['device'] == "5r6")
{
$_SESSION['manual'] = "5r6|06|210";
if ($_SESSION['user'] = 1)
{
$_SESSION['5r6_UserID'] = $_SESSION['UserID'];
}
header('Location: 5r6 Router/General.php');
exit();
}
if($_POST['device'] == "Jup1")
{
$_SESSION['manual'] = "JuniperRouter|49|210"; //Please connect your router to the correct port
header('Location: Other Routers/JuniperRouter.php');
exit();
}
if($_POST['device'] == "Sys1")
{
$_SESSION['manual'] = "LinkSys|50|210"; //Please connect your router to the correct port
header('Location: Other Routers/LinkSys.php');
exit();
}
if($_POST['device'] == "Net1")
{
$_SESSION['manual'] = "NetGear|51|210"; //Please connect your router to the correct port
header('Location: Other Routers/NetGear.php');
exit();
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unified Platform Network Deployment System</title>
<link href="stylesheet/cssStyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
</script>
<style type="text/css">
<!--
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif
}
.style2 {
font-family: "Times New Roman", Times, serif;
font-weight: bold;
font-size: 12pt;
}
.style3 {color: #FFFFFF}
.style4 {color: #000000}
-->
</style>
</head>
<body>
<center>
<img src="assets/images/unified.png" border="0" />
<table width="650px" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="header" align="center"><h1 class="style3"><span class="style4">Welcome</span> <span class="style4"><?php echo $_SESSION['UserID'] ?></span></h1></td>
</tr><br><center><b><font size="2">172.16.223.210</font></b></center>
<tr>
<td><?php if($_SESSION['Administrator'] == 'yes')
{
echo '<a href="create_users.php"><font size=2 color="blue"><p>Create New User</font></p></a>';
}
?>
</td><td>
<div align="right"><a href="Login.php"><font size=2 color="blue">Logout</font><br></a> </div></td>
</tr>
<tr>
<td class="instruct">
<p class="style1 style4"><font size="2">
This system is capable of configuring, testing and reporting performances of multi-vendor network devices. The invention offers a quick and convenient system that assists network designers and professionals to plan and deploy a network system without the need to remember all the detailed configuration commands, syntaxes and procedures specific to a particular vendor.</font><br>
<br>
</p> </td>
</tr>
<tr>
<td class="instruct"><span class="style2"><span class="style4">Select a vendor from dropdown menu to view a list of network devices available for configuration.</span></span> </td>
</tr>
<tr><td height="20px"></td>
</tr>
<tr>
<td align="center">
<!-------START selection of vendor & network devices START------->
<form name="menuList" method="post" action="<?php echo $PHP_SELF; ?>">
<p><strong>List of Devices :</strong><br />
<?php
echo "<SELECT NAME=device >";
echo "<OPTION VALUE=0>-- Choose One --</OPTION>";
echo "<OPTION VALUE=5r2>5r2 Switch</OPTION>";
echo "<OPTION VALUE=5r3>5r3 Router</OPTION>";
echo "<OPTION VALUE=5r4>5r4 Switch</OPTION>";
echo "<OPTION VALUE=5r5>5r5 Router</OPTION>";
echo "<OPTION VALUE=5r6>5r6 Router</OPTION>";
echo "<OPTION VALUE=0>-- Other Routers --</OPTION>";
echo "<OPTION VALUE=Jup1> Juniper Router</OPTION>";
echo "<OPTION VALUE=Sys1> LinkSys Router</OPTION>";
echo "<OPTION VALUE=Net1> Net Gear Router</OPTION>";
echo "</SELECT>";
$con1 = FALSE;
?>
</p>
<p></p>
<tr>
<td align="center">
<input type="submit" name="submit" id="submit" value="Start Configuration" /> </td>
</tr>
</form>
<tr><td align="center">
<form action="testconfig/testconfig.php" method="post" name="form2" id="form2" target = _new>
<br>
<input name="test_submit" type="submit" id="test_submit" value="Check Configurations" >
</form>
</td></tr>
<form action="<?php echo $PHP_SELF; ?>" method="post" name="form3">
<tr>
<td align="center">
<?php
if($_SESSION['Administrator'] == 'yes')
{
echo "<br><b>Recover network device IOS</b></br>";
echo "<select name=IOS>";
echo "<option value=0>Please select a network device</option>";
echo "<option value=5r5>5r5 Router</option>";
echo "<option value=5r6>5r6 Router</option>";
echo "</select>";
echo "<input type=submit value=Recover IOS>";
}
?> </td>
</tr>
</form>
<form action="Clearline.php" method="post" name="form" id="form">
<tr><td align="center">
<?php
if($_SESSION['Administrator'] == 'yes')
{
echo '<br><input name="test_submit" type="submit" id="test_submit" value="Clear All Lines">';
}
?>
</td></tr>
</form>
</form>
<!-------END selection of vendor & network devices END------->