| Current Path : /var/www/html/mmishra/irp/pcstore/ |
| Current File : /var/www/html/mmishra/irp/pcstore/page_header.inc |
<?php
/*
$realm = 'Restricted area';
//user => password
$users = array('admin' => 'mypass', 'guest' => 'guest');
if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Digest realm="'.$realm.'",qop="auth",nonce="'.uniqid(1).'",opaque="'.md5($realm).'"');
die('Sorry ! you must authenticate with correct credentials');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) || !isset($users[$data['username']]))
die('Wrong Credentials!');
// generate the valid response
$A1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]);
$A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);
if ($data['response'] != $valid_response)
die('Wrong Credentials!');
// ok, valid username & password
echo 'Your are logged in as: ' . $data['username'];
// function to parse the http auth header
function http_digest_parse($txt)
{
// protect against missing data
$needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1);
$data = array();
preg_match_all('@(\w+)=(?:([\'"])([^\2]+)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER);
foreach ($matches as $m) {
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
unset($needed_parts[$m[1]]);
}
return $needed_parts ? false : $data;
}
//=========================
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Sorry! you must authenticate yourself';
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}
*/
include "db_connect.inc";
include "db_tables.inc";
require "mcell_library.php";
session_start();
$_SESSION["s_login_status"] = '';
$_SERVER["PHP_AUTH_USER"] = '';
$_SERVER["PHP_AUTH_PASSWD"] = '';
$rid = $_REQUEST["row_id"];
$scrollx = $_REQUEST["scrollx"];
$scrolly = $_REQUEST["scrolly"];
?>
<html><head>
<base href='http://<? echo $_SERVER["SERVER_NAME"]?>/'></base>
<link rel=stylesheet href='style.css' type='text/css'>
<script Language="JavaScript"><!--
if(document.forms[0].elements[1]) document.forms[0].elements[1].focus();
//-->
</script>
<script language=javascript><!--
function scrollToCoordinates() {
window.scrollTo(<?=$scrollx?>,<?=$scrolly?>);
}
function saveScrollCoordinates() {
document.myForm.scrollx.value = (document.all)?document.body.scrollLeft:window.pageXOffset;
document.myForm.scrolly.value = (document.all)?document.body.scrollTop:window.pageYOffset;
}
//-->
</script>
</head>
<STYLE TYPE="text/css">
<!--
FORM.tb {display:inline;}
.twidth{width:100%}
.include{ font-size: 75%; font-family: verdana, arial, helvetica;}
.includebig{font-family: verdana, arial, helvetica;}
.includebig A:link { color: blue; }
.includebig A:visited { color: purple; }
.include A:link { color: blue; }
.include A:visited { color: purple; }
.submitter { font-size: 75%; font-family: verdana, arial, helvetica; }
.codehighlight {background:#eee}
.WRy1{background:#fc0}
.WRy2{background:#fff3ac}
pre.code {color: #660099; margin-left:5%}
address {text-align: right}
a:hover{background:#FD3;}
body {background:#FFFFFF; margin-left: 5%; margin-right: 5%}
.WRBannerCenter {margin-left:-5%; margin-right:-5%; margin-top:8px; margin-bottom:8px; text-align:center}
-->
</STYLE>
<!-- START AD --><div class="WRBannerCenter" align="center"><script language="JavaScript"><!--
function show(object) {
if (document.getElementById) {
document.getElementById(object).style.visibility = 'visible';
}
else if (document.layers && document.layers[object]) {
document.layers[object].visibility = 'visible';
}
else if (document.all) {
document.all[object].style.visibility = 'visible';
}
}
function hide(object) {
if (document.getElementById) {
document.getElementById(object).style.visibility = 'hidden';
}
else if (document.layers && document.layers[object]) {
document.layers[object].visibility = 'hidden';
}
else if (document.all) {
document.all[object].style.visibility = 'hidden';
}
}
//--></script>
<div style="position: absolute; top: 100px; right: 200px; visibility: hidden; margin-right: 0px; filter:alpha(opacity=98);-moz-opacity:.98;opacity:.98; z-index: 100;" id="j_dj" onMouseOver="show('j_dj')" onMouseOut="hide('j_dj')">
<a href="http://pcstore.iiita.ac.in"><img src="image/cdrw.jpg" width="100" height="100" hspace="0" vspace="0" border="0"></a>
<a href="http://pcstore.iiita.ac.in"><img src="image/hdd.jpg" width="100" height="100" hspace="0" vspace="0" border="0"></a>
<a href="http://pcstore.iiita.ac.in"><img src="image/mainboard.jpg" width="100" height="100" hspace="0" vspace="0" border="0"></a>
<a href="http://pcstore.iiita.ac.in"><img src="image/smps.jpg" width="100" height="100" hspace="0" vspace="0" border="0"></a>
<a href="http://pcstore.iiita.ac.in"><img src="image/monitor.jpg" width="100" height="100" hspace="0" vspace="0" border="0"></a>
<a href="http://pcstore.iiita.ac.in"><img src="image/pc.jpg" width="100" height="100" hspace="0" vspace="0" border="0"></a>
</div>
<!-- END AD -->
<table cellpadding=0 cellspacing=0 width='98%' id='green_box'>
<tr valign='center'>
<td width='10%' align='center'><a href="http://pcstore.iiita.ac.in" onMouseOver="show('j_dj')" onMouseOut="hide('j_dj')"><img src='image/pc.jpg' width='50' height='50'></a></td>
<td width='80%' align='center'><font face='verdana' size='+1'>INDIAN INSTITUTE OF INFORMATION TECHNOLOGY, ALLAHABAD</font>
<!--background='image/top.jpg' align='right' valign='bottom' style="padding: 0px; background-repeat: no-repeat;">-->
<br><font color='black'>Devghat, Jhalwa, Allahabad - 211012</font>
<br><br><font size='3px' color='green'>(Innovative & Support Centre)</font></td>
<td width='10%' align='center'><a href="http://www.iiita.ac.in" onMouseOver="show('j_dj')" onMouseOut="hide('j_dj')"><img src='image/iiita.jpg' width='50' height='50'></a></td></tr>
<tr><td colspan='2' nowrap style='border-top: orange 1px solid;'>
<?
require "menu.php";
?>
<marquee title='Developed by Mithilesh Kr. Mishra, Programmer, IIIT Allahabad' scrollamount='1' scrolldelay='10' behavior='alternate' width='65%'><font color='blue'><b><a href="developer.php" onMouseOver="show('j_dj')" onMouseOut="hide('j_dj')">pcStore Ver. 2.0</a></b></font></marquee>
</td><td nowrap align='center' style='border-bottom: green 1px solid; border-top: orange 1px solid; border-left: green 1px solid'> <? echo date("D, d-m-Y")?> </td></tr>
<tr valign='top'><td id='id1' colspan='3' height='520' align='left'>
<?
echo "<form name='myForm' method='post' action='" . $_SERVER["SCRIPT_NAME"] . "/' enctype='multipart/form-data' onSubmit=\"saveScrollCoordinates()\">";
//echo $_SESSION["s_login_status"] . "check";
//echo session_name() . "=" . session_id();
if (session_is_registered()) echo "reg";
?>
<input type="hidden" name="scrollx" value="0">
<input type="hidden" name="scrolly" value="0">