Location: PHPKode > projects > NetLink > netlink_os/main.php
<?php
session_start();
if (!isset($_SESSION['login']))
 {include("index.php");
 exit();}
?>

<html>
<head>
<link REL="SHORTCUT ICON" HREF="net.ico">
<link media="screen" type="text/css" rel="stylesheet"  href="main.css" />
<title>
<?php
if (!$_SESSION['login'])
{
  require("login.php");
	exit();
}
extract($_GET);
extract($_POST);
if (!$id)
  $title='welcome';
elseif ($id=="cms")
  $title="Site Manager";
elseif ($id=="copy")
	$title="Copyright Material";
elseif ($id=="cmsu")
{
  $user=$_GET['user'];
  $title="CMS for $user";
}
else
	$title=$id;
$title=ucfirst($title);

echo "NetLink&copy; - $title";

if (!$id)
  $id='welcome';

?>
</title>
<link media="screen" type="text/css" rel="stylesheet"  href="main.css" />
</head>

<body>
<a name='top'/>
<table summary='top' border='0' width='100%'>
<tr>
<td>
<a href='main.php'><img src='Images/netlink.gif' alt='' border='0'/></a>
</td>
<td align='right' valign='bottom' style='font-size:10pt;'>
Logged in as: 
<?php 
$user=$_SESSION['login'];
$user=strtolower($user);

echo "<b>".$user."</b><br/>"; 

//DB Connect
include("db.php");
$dbh=mysql_connect ($host,$mysql_user,$pass) or die ('MySQL Error: ' . mysql_error());
mysql_select_db ($table); 
$sql="SELECT * FROM Accounts WHERE Username='$user';";
$rs=mysql_query($sql,$dbh);
$row=mysql_fetch_array($rs);
$f_name=$row['FirstName'];
$l_name=$row['LastName'];
$login_date=$row['last'];
$login_ip=$row['ip'];


echo "Name: <b>$f_name $l_name</b>";
if ($login_date=="")
  $login_date="None Recorded";
if ($login_ip=="")
  $login_ip="None Recorded";
  
echo "<br/>Last Login: <b>$login_date</b>";
echo "<br/>From: <b>$login_ip</b>";

$my_ip=$REMOTE_ADDR;
$my_time = date("n/j/y") . " @ " . date('h:i a');

$sql2="UPDATE Accounts SET last='$my_time', ip='$my_ip' WHERE Username='$user'";
$rs=mysql_query($sql2,$dbh);

mysql_close($dbh);
//DB Close
?>

<br/><a href='?id=profile'>Edit Profile</a> 
<b>| <a href='logout.php'>Logout</a></b>
</td>
</tr>
</table>

<!--INFO SECTION-->
<hr color='#000000' style='margin-bottom:0px'/>
<table summary='netlink' border='0' width='100%' style='margin:0px;'>
<tr>
<td  class='nav' valign='top' align='center' width='135px'>
<?php
include("menu.php");
?>
</td>
<td width='10px'/>
<td valign='top'>
<?php
if ($id=="copy")
include("http://kaibasoftware.com/c_info.php");
else
include($id.".php");
?>
</td>
</tr>
</table>
<hr color='#000000' style='margin:0px;'/>
<table summary='footer' width='100%'>
<tr>
<td style='font-size:10pt;' align='right'>
<?php
include('footer.php');
?>
</td>
</tr>
</table>
Return current item: NetLink