Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsZymic Free Web HostingZymic Free Web Hosting - General Discussion & Help right
  Closed Topic Start new topic
left right
unimas-feng
post Mar 22 2009, 04:11 AM
Post #1


Newbie
*

Group: Members
Posts: 8
Joined: 17-March 09
Member No.: 87,891



I have facing a login system problem which after i logged in in my website on the frontpage . After i viewed other pages and back to the frontpage , it will show up the login box again although i din log out .
Any idea with it ? Please provide some guides for me . Thank you .
Here is my index.php .
CODE
<?php

// database connect script.

require 'db_connect.php';

if($logged_in == 1) {
'You are already logged in, '.$_SESSION['username'].'. Please proceed to <a href="http://feng1.uuuq.com/index.php">Home</a> .';
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Faculty of Engineering</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
background-color: #CCC;
}
.thrColAbsHdr #container {
position: relative; /* adding position: relative allows you to position the two sidebars relative to this container */
width: 1200; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: center; /* this overrides the text-align: center on the body element. */
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
height: auto;
background-color: #DFF2ED;
}

/* Tips for absolutely positioned sidebars with header and footer:
1. Absolutely positioned (AP) elements must be given a top and side value, either right or left. (As a default, if no top value is given, the AP element will begin directly after the last element in the source order of the page. This means, if the sidebars are first element in the #container in the document's source order, they will appear at the top of the #container even without being given a top value. However, if they are moved later in the source order for any reason, they'll need a top value to appear where you desire.
2. Absolutely positioned (AP) elements are taken out of the flow of the document. This means the elements around them don't know they exist and don't account for them when taking up their proper space on the page. Thus, an AP div should only be used as a side column if you are sure the middle #mainContent div will always contain the most content. If either sidebar were to contain more content, that sidebar would run over the bottom of the parent div, and in this case the footer as well, and the sidebar would not appear to be contained.
3. If the above mentioned requirements are met, absolutely positioned sidebars can be an easy way to control the source order of the document.
4. If the source order is changed, the top value should be equal to the height of the header since this will cause the columns to visually meet the header.
*/
.thrColAbsHdr #header {
height: 200px;
background-color: #06F;
width: 1200px;
padding: 0;
}
.thrColAbsHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.thrColAbsHdr #sidebar1 {
position: absolute;
top: 201px;
left: 4px;
width: 220px; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px;
background-color: #DFF2ED;
float: left;
}
.thrColAbsHdr #sidebar2 {
position: absolute;
top: 201px;
right: 3px;
width: 150px; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px; /* padding keeps the content of the div away from the edges */
background-color: #DFF2ED;
font-size: small;
color: #00F;
text-align: left;
}
.thrColAbsHdr #mainContent {
height: auto;
margin-top: 0;
margin-right: 170px;
margin-bottom: 0;
margin-left: 230px;
padding-top: 0;
padding-right: 10px;
padding-bottom: 0;
padding-left: 10px;
width: auto;
}
.thrColAbsHdr #footer {
font-size: small;
margin-right: 170px;
margin-left: 250px;
padding-top: 0;
padding-right: 10px;
padding-bottom: 0;
padding-left: 20px;
background-color: #DFF2ED;
}
.thrColAbsHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
text-align: left;
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
-->
</style><!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.thrColAbsHdr #sidebar1 { width: 180px; }
.thrColAbsHdr #sidebar2 { width: 190px; }
</style>
<![endif]-->
<script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #00F;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #30F;
}
a:hover {
text-decoration: underline;
color: #009;
}
a:active {
text-decoration: none;
color: #00F;
}
.thrColAbsHdr #container #sidebar1 form table tr td {
font-size: x-small;
}
.thrColAbsHdr #container #sidebar1 h1 {
color: #F00;
font-size: large;
}
.thrColAbsHdr #container #footer p {
font-size: x-small;
}
.thrColAbsHdr #container #sidebar1 p {
font-size: medium;
}
.thrColAbsHdr #container #sidebar1 #CollapsiblePanel1 .CollapsiblePanelContent p a {
font-size: x-large;
}
.thrColAbsHdr #container #sidebar1 #CollapsiblePanel1 .CollapsiblePanelContent p a {
font-size: medium;
}
.thrColAbsHdr #container #sidebar1 #CollapsiblePanel2 .CollapsiblePanelContent p a {
font-size: x-large;
}
.thrColAbsHdr #container #sidebar1 #CollapsiblePanel2 .CollapsiblePanelContent p a {
font-size: medium;
}
.thrColAbsHdr #container #sidebar1 #CollapsiblePanel3 .CollapsiblePanelContent p a {
font-size: medium;
}
.thrColAbsHdr #container #sidebar1 #CollapsiblePanel4 .CollapsiblePanelContent p {
font-size: medium;
}
.thrColAbsHdr #container #sidebar1 p {
font-size: small;
}
-->
</style></head>

<body class="thrColAbsHdr">
<div id="container">
<div id="header">
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,1,0" width="1260" height="150" title="Background">
<param name="src" value="background.swf" />
<embed src="background.swf" pluginspage="http://www.adobe.com/shockwave/download/" width="1260" height="150"></embed>
</object>
<script type="text/javascript">

swfFiles= new Array()
//Set Flash sources, widths and heights
swfFiles[0]=['Quote.swf', 1260, 50 ]
swfFiles[1]=['Quote2.swf', 1260, 50 ]
swfFiles[2]=['Quote3.swf', 1260, 50 ]
swfFiles[3]=['Quote4.swf', 1260, 50 ]
swfFiles[4]=['Quote5.swf', 1260, 50 ]
swfFiles[5]=['Quote6.swf', 1260, 50 ]

////////////////No Need to Edit Below Here//////////////

//Randomizing Unit Courtesy of Mike Winter as seen at:
//http://www.dynamicdrive.com/forums/showthread.php?p=8442
function random(n) {
return Math.floor((Math.random() % 1) * n);
}

Array.prototype.shuffle = function() {var i = this.length;
while(i--) {this.swap(i, random(i + 1));}
};
Array.prototype.swap = function(x, y) {
var t = this[x]; this[x] = this[y]; this[y] = t;
};

swfFiles.shuffle()
//End Randomizing Unit


document.write('\
<OBJECT CLASSID="clsid:166B1BCA-3F9C-11CF-8075-444553540000" \
CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,1,0" \
HEIGHT="'+swfFiles[0][2]+'" WIDTH="'+swfFiles[0][1]+'" ALIGN=""> \
<PARAM NAME="movie" VALUE="'+swfFiles[0][0]+'"> \
<PARAM NAME="quality" VALUE="high"> \
<embed src="'+swfFiles[0][0]+'" \
quality="high" \
pluginspage="http://www.adobe.com/shockwave/download/" \
type="application/x-shockwave-flash" \
height="'+swfFiles[0][2]+'" width="'+swfFiles[0][1]+'"></embed> \
</object>\
')
</script>
<noscript> <!-- Keep this tag -->
<!-- Place Flash code for non javascript enabled browsers below -->
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,1,0" width="1260" height="50" title="Quote">
<param name="src" value="Quote.swf" />
<embed src="Quote.swf" pluginspage="http://www.adobe.com/shockwave/download/" width="1260" height="50"></embed>
</object><!-- End non javascript Flash code -->
</noscript><!-- Don't remove this tag -->

</div>
<div id="sidebar1">
<?php

if (isset($_POST['submit'])) { // if form has been submitted



/* check they filled in what they were supposed to and authenticate */

if(!$_POST['uname'] | !$_POST['passwd']) {

die('You did not fill in a required field.');

}



// authenticate.



if (!get_magic_quotes_gpc()) {

$_POST['uname'] = addslashes($_POST['uname']);

}



$qry = "SELECT username, password FROM user WHERE username = '".$_POST['uname']."'";
$sqlmember = mysql_query($qry);
$info = mysql_fetch_array ($sqlmember);

$check = mysql_num_rows ($sqlmember);



if ($check == 0) {

die('That Account does not exist in our database.');

}






// check passwords match



$_POST['passwd'] = stripslashes($_POST['passwd']);

$info['password'] = stripslashes($info['password']);

$_POST['passwd'] = md5($_POST['passwd']);



if ($_POST['passwd'] != $info['password']) {

echo "Incorrect password, please try again.";

}



// if we get here username and password are correct,

//register session variables and set last login time.



$date = date('m d, Y');



$qry = "UPDATE user SET last_login = '$date' WHERE username = '".$_POST['uname']."'";

$query=mysql_query($qry);



$_POST['uname'] = stripslashes($_POST['uname']);

$_SESSION['username'] = $_POST['uname'];

$_SESSION['password'] = $_POST['passwd'];



?>
<h1>Logged in</h1>
<p>Welcome back <?php echo $_SESSION['username']; ?>, you are logged in. <a href="http://feng1.uuuq.com/logout.php">Logout</a></p>

<?php

} else { // if form hasn't been submitted

?>
<h1>Login</h1>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<table width="218" border="0" align="center" cellpadding="3" cellspacing="0">
<tr><td width="63">Username:</td><td width="144">
<input type="text" name="uname" maxlength="40">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="passwd" maxlength="50">
</td></tr>
<tr>
<td colspan="2" align="right"><a href="http://feng1.uuuq.com/registration.php">Register</a> <input type="submit" name="submit" value="Login">
</td></tr>
</table>
</form>
<?php
}
?>
<div id="CollapsiblePanel1" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Home</div>
<div class="CollapsiblePanelContent">
<p><a href="http://feng1.uuuq.com">Homepage</a></p>
<p><a href="http://www.unimas.my">Unimas Homepage</a></p>
<p><a href="http://feng1.uuuq.com/Dean message.php">Dean's Message</a></p>
<p><a href="http://feng1.uuuq.com/About Feng.php">About Feng</a></p>
</div>
</div>
<div id="CollapsiblePanel2" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Departments</div>
<div class="CollapsiblePanelContent">
<p><a href="http://feng1.uuuq.com/Civil KJ message.php">Civil</a></p>
<p><a href="http://feng1.uuuq.com/Electronics KJ message.php">Electronics</a></p>
<p><a href="http://feng1.uuuq.com/Mechanical KJ message.php">Mechanical and Manufacturing</a></p>
<p><a href="http://feng1.uuuq.com/Chemical KJ message.php">Chemical</a></p>
</div>
</div>
<div id="CollapsiblePanel3" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Gallery</div>
<div class="CollapsiblePanelContent">
<p><a href="http://feng1.uuuq.com/Facilities of Faculty Engineering.php">Facilities</a></p>
<p><a href="http://feng1.uuuq.com/Activities In Faculty Engineering.php">Activities</a></p>
</div>
</div>
<div id="CollapsiblePanel4" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Current Student</div>
<div class="CollapsiblePanelContent">
<p>Student Bulletin Board</p>
<p><a href="http://www.feng.unimas.my">Feng Bulletin Board</a></p>
<p>Registration Form</p>
<p>Academic Calender</p>
<p>Student Advisory Guide</p>
</div>
</div>
<div id="CollapsiblePanel5" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Survey</div>
<div class="CollapsiblePanelContent">
<p><a href="http://feng1.uuuq.com/Survey.php">Facilities of Faculty Engineering</a><a href="http:/feng1.uuuq.com/Survey.html"></a></p>
</div>
<!-- end #sidebar1 --></div>
</div>
<div id="sidebar2">
<p><?php include("stats.php"); ?>
</p>
<p>
<?php include("useronline.php"); ?>
&nbsp;</p>
<div id="CollapsiblePanel6" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Bank</div>
<div class="CollapsiblePanelContent">
<p><a href="http://www.rhbbank.com.my/">RHB Bank</a></p>
<p><a href="http://www.bankislam.com.my/">Bank Islam</a></p>
</div>
</div>
<div id="CollapsiblePanel7" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Government Links</div>
<div class="CollapsiblePanelContent">
<p><a href="http://www.ptptn.gov.my/">PTPTN</a></p>
</div>
</div>
<div id="CollapsiblePanel8" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Airlines</div>
<div class="CollapsiblePanelContent">
<p><a href="http://www.airasia.com/site/my/en/home.jsp">Air Asia</a></p>
<p><a href="http://www.malaysiaairlines.com/my/en/home.aspx">Malaysia Airlines</a></p>
</div>
</div>
<div id="CollapsiblePanel9" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">E-News</div>
<div class="CollapsiblePanelContent">
<p><a href="http://thestar.com.my/">The Star</a></p>
<p><a href="http://www.bharian.com.my/">Berita Harian</a></p>
</div>
</div>
<div id="CollapsiblePanel10" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Engineering Association</div>
<div class="CollapsiblePanelContent">
<p><a href="http://www.iem.org.my/wapi/mctweb.dll/getObject?MID=IEMWEB-MAIN2&amp;objID=1">IEM</a></p>
<p><a href="http://www.eac.org.my">EAC</a></p>
<p><a href="http://www.washingtonaccord.org/">Washington Accord</a></p>
</div>
<!-- end #sidebar2 -->
</div>
<p><iframe src="http://www.surveygizmo.com/s/113666/how-do-you-rate-this-website-" frameborder="0" width="110%" height="400"></iframe>
</p>
</div>
<div id="mainContent">
<h1>WELCOME TO FACULTY OF ENGINEERING</h1>
<blockquote>
<p><img src="PICTURES/1.jpg" width="250" height="187" alt="Office" /><img src="PICTURES/2.jpg" width="250" height="187" alt="Ruang tamu" /><img src="PICTURES/3.jpg" width="250" height="187" alt="Office1" /></p>
<p>&nbsp;</p>
</blockquote>
<p>&nbsp;</p>
</div>
<div id="footer">
<p>Contact Us :</p>
<p><strong>Disclaimer</strong> :All information made available as part of this website (including any bulletin boards and chat rooms) and any opinions, advice, statements or other information contained in any messages posted or transmitted by any third party are the responsibility of the author of that message and not of feng1 (unless feng1 is specifically identified as the author of the message). No part of this website may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, without prior permission or consent of the author. </p>
<!-- end #footer --></div>
<!-- end #container --></div>
<script type="text/javascript">
<!--
var CollapsiblePanel2 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel2", {contentIsOpen:false});
var CollapsiblePanel3 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel3", {contentIsOpen:false});
var CollapsiblePanel4 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel4", {contentIsOpen:false});
var CollapsiblePanel5 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel5", {contentIsOpen:false});
var CollapsiblePanel6 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel6", {contentIsOpen:false});
var CollapsiblePanel7 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel7", {contentIsOpen:false});
var CollapsiblePanel8 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel8", {contentIsOpen:false});
var CollapsiblePanel9 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel9", {contentIsOpen:false});
var CollapsiblePanel10 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel10", {contentIsOpen:false});
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
//-->
</script>
</body>
</html>
Go to the top of the page 
 
  + Quote Post
 Closed Topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 24th May 2013 - 05:33 PM