pageBegin.php -
Code: Select all
<?php
session_start();
//Expiry, or time set for expiration of session, is in login.php.
if($_SESSIONї'sessionLength'])//If this exists, so should username, et al.
{
if( ( ($_SESSIONї'sessionLength']) - time() ) <= 0 )
{
session_destroy();
echo "<script>window.location = "/index.php?syslogout=1"</script>\n\n";
}
else
{
$_SESSIONї'sessionLength'] = time() + $_SESSIONї'expiry'];
}
}
header("Cache-control: private"); //IE 6 Fix
header("Content-Type: text/html; charset=ISO-8859-4");
if( !($_SESSIONї'alerted']) )
{
$_SESSIONї'alerted'] = 1;
echo "<script>alert("****************.")</script>\n\n";
}
?>
<?php
require("includes/functions.php");
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>***************************</title>
<link rel="stylesheet" href="css/default.css" type="text/css">
</head>
<body>
<p>
<table cellspacing="1" cellpadding="7" border="0">
<tr>
<!--Date & Time-->
<td class="datetime" colspan="3" align="right">
<?php
echo date ("h:i:s A T");
echo "<br>\n\n";
echo date ("l dS of F Y");
?>
</td>
</tr>
<tr>
<!--1 Cor. 14:26-->
<td class="verse">***********************</td>
<!--*************-->
<td class="header" valign="top">
<p><h4>*********</h4></p>
<p><h6>**********************</h6></p>
<hr>
<p class="lil">****************************</p>
</td>
</tr>
<tr>
<!--Nav & News-->
<td class="navnews" valign="top">
<?php
if($_SESSIONї'username'])
{
?>
<!--Nav-->
<a class="loginoutlink" href="/login.php?mode=logout">Logout</a><br><br>
<a class="menulink" href="/index.php">Home</a><br>
<a class="menulink" href="/articles.php?mode=list&sort=0">Articles</a><br>
<a class="menulink" href="javascript:void(0)" onclick="window.open('****************')">Message Boards</a><br>
<a class="menulink" href="/profile.php?mode=list">Profile</a><br>
<a class="menulink" href="/links.php">Links</a><br>
<a class="menulink" href="/tou.php">Terms of Use</a>
<?php
if($_SESSIONї'admin'] == "admin")
{
?>
<br><a class="menulink" href="/admin.php?mode=index">Administration</a>
<?php
}
}
else
{
?>
<a class="loginoutlink" href="/login.php?mode=loginReq">Login</a> / <a class="loginoutlink" href="/login.php?mode=register">Register</a><br><br>
<a class="menulink" href="/index.php">Home</a><br>
<?php
}
?>
<hr>
<!--News-->
<p class="bold"><a class="menulink" href="/news.php">News</a></p>
<p>
January 22, 2004<br><br>
***********************
</p>
</td>
<!--Content-->
<td class="content" valign="top">
<?php
if($_SESSIONї'username'])
{
$uname = $_SESSIONї'username'];
if($_SESSIONї'admin'])
{
echo "Welcome, Administrator " . $_SESSIONї'username'] . ".<hr>\n\n";
}
else
{
echo "Welcome, " . $_SESSIONї'username'] . ".<hr>\n\n";
}
//Do DB connect, check for actRemind in user_info
$mysqlLinkCheckActivated = mysql_connect("localhost","****************","**********")
or die("Could not connect: " . mysql_error());
mysql_select_db("****************")
or die("Could not select database: " . mysql_error());
$mysqlQueryCheckActivated = "SELECT actRemind FROM user_info WHERE username='$uname'";
$mysqlResultCheckActivated = mysql_query($mysqlQueryCheckActivated);
while( list($actRemind) = mysql_fetch_row($mysqlResultCheckActivated) )
{
if($actRemind == 1)
{
echo "<h6 class="alert">Your Edified.org Forums account has recently been activated.<hr></h6>";
$mysqlQueryMarkActivated = "UPDATE user_auth SET actRemind=0 WHERE username='$uname'";
mysql_query($mysqlQueryMarkActivated)
or die("Failed query: " . mysql_error());
}
}
mysql_free_result($mysqlResultCheckActivated);
mysql_close($mysqlLinkCheckActivated);
}
?>Code: Select all
<?php
require("includes/pageBegin.php");
?>
<?php
if(!($_SESSIONї'username']))
{
echo "No trespassing!\n\n";
}
else
{
$mode = $_GETї'mode'];
$uname = $_SESSIONї'username'];
if($mode == "list")
{
$mysqlLinkGetProfile = mysql_connect('localhost','*********','***********')
or die("Could not connect: " . mysql_error());
mysql_select_db('dentariz_edified_reg')
or die("Could not select database: " . mysql_error());
$mysqlQueryGetProfile = "SELECT * FROM user_info WHERE username='$uname'";
$mysqlResultGetProfile = mysql_query($mysqlQueryGetProfile)
or die("Query failed : " . mysql_error());
while(
list($username,
$email,
$gender,
$maritalstatus,
$birthdate,
$age,
$fname,
$minitial,
$lname,
$location,
$aim,
$icq,
$msnmess,
$yahoomess,
$churchlocation,
$churchname,
$admin,
$forumstat,
$actRemind,
$parent)
= mysql_fetch_row($mysqlResultGetProfile)
)
{
echo "<p><a class="contentlink" href="/profile.php?mode=change">Change Somethin</a></p>\n\n";
?>
<table cellspacing="3" cellpadding="3" border="0">
<tr>
<td>
Username:
</td>
<td>
<?php echo "$username\n" ?>
</td>
</tr>
<tr>
<td>
Full Name:
</td>
<td>
<?php echo "$fname $minitial $lname\n" ?>
</td>
</tr>
<tr>
<td>
E-Mail Address:
</td>
<td>
<?php echo "$email\n" ?>
</td>
</tr>
<tr>
<td>
Gender:
</td>
<td>
<?php ($gender == "M" ? $gender = "Male" : $gender="Female") ?>
<?php echo "$gender\n" ?>
</td>
</tr>
<tr>
<td>
Marital Status:
</td>
<td>
<?php if($maritalstatus == "S") $maritalstatus = "Single" ?>
<?php if($maritalstatus == "C") $maritalstatus = "Courting" ?>
<?php if($maritalstatus == "M") $maritalstatus = "Married" ?>
<?php if($maritalstatus == "DW") $maritalstatus = "Divorced or Widowed" ?>
<?php echo "$maritalstatus\n" ?>
</td>
</tr>
<tr>
<td>
Parent:
</td>
<td>
<?php if($parent == "Y") $parent = "Yes" ?>
<?php if($parent == "N") $parent = "No" ?>
<?php echo "$parent\n" ?>
</td>
</tr>
<tr>
<td>
Church:
</td>
<td>
<?php echo "$churchname in $churchlocation\n" ?>
</td>
</tr>
<tr>
<td>
Location:
</td>
<td>
<?php echo "$location\n" ?>
</td>
</tr>
<tr>
<td>
Birthdate:
</td>
<td>
<?php echo "$birthdate\n" ?>
</td>
</tr>
<tr>
<td>
Age:
</td>
<td>
<?php echo "$age\n" ?>
</td>
</tr>
<tr>
<td>
AIM:
</td>
<td>
<?php echo "$aim\n" ?>
</td>
</tr>
<tr>
<td>
ICQ:
</td>
<td>
<?php echo "$icq\n" ?>
</td>
</tr>
<tr>
<td>
MSN Messenger:
</td>
<td>
<?php echo "$msnmess\n" ?>
</td>
</tr>
<tr>
<td>
Yahoo Messenger:
</td>
<td>
<?php echo "$yahoomess\n" ?>
</td>
</tr>
</table>
<?php
}//while
mysql_free_result($mysqlResultGetProfile);
mysql_close($mysqlLinkGetProfile);
}//if
else if($mode == "change")
{
echo "Change.";
}
}//else
?>
<?php
require("includes/pageEnd.php");
?>Code: Select all
<?php
echo "<hr>\n\n";
print_r($_SESSION);
?>
</td>
</tr>
<tr>
<!--Copyright-->
<td colspan="2" class="copyright" align="right">Copyright © 2002-2004 <a class="copylink" href="mailto:webmaster@*******">***********</a>. All Rights Reserved.</td>
</tr>
<tr>
<!--Powered-->
<td class="powered" colspan="2">
<table class="powered" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML!">
<img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-css" alt="Valid CSS!">
<img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xml10" alt="Valid XML!">
<img style="border:0;width:88px;height:31px" src="/img/php.gif" alt="Powered by PHP!">
<img style="border:0;width:88px;height:31px" src="/img/mysql.gif" alt="Powered by MySQL!">
</td>
<td align="right" valign="top">
<a class="poweredlink" href="mailto:webmaster@*******">Tell it to the Webmaster</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>I just don't know. Anyone give it a gander?
-Kurasoe