Location: PHPKode > projects > Admbook > user-registration.php
<?php
	class Timer {
		var $startTime;
		var $endTime;
		function start() {
			$this->startTime = gettimeofday();
		}
		function stop() {
			$this->endTime = gettimeofday();
		}
		function elapsed() {
			return (($this->endTime["sec"] - $this->startTime["sec"]) * 1000000 + ($this->endTime["usec"] - $this->startTime["usec"])) / 1000000;
		}
	}
	$timer = new Timer();
	$timer->start();
	session_start();
	include("config-data.php");
	include("settings-data.php");
	include("lib.php");
	if (!isset($user))
		$user = null;
	if (!isset($userLogin))
		$userLogin = "";
	if (!isset($registered))
		$registered = false;
	if (!isset($error))
		$error = "";
	if (!isset($style))
		$style = "";
	if (!isset($icq))
		$icq = "";
?>
<html>
<head>
<title>admbook :: version <?=$constant['version']?></title>
<?php
	if ($constant['charset'] != "")
	{
?>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$constant['charset']?>"/>
<?php
	}
?>
<link href="style.css" type="text/css" rel="stylesheet"/>
<style type="text/css">
<!--
#error {
	color : <?=$constant['error-color']?>
}

.text {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['text-color']?>}

.link {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['link-color']?>
}

.messagetext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['message-text-color']?>
}

.messagelink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['message-link-color']?>
}

.admintext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['admin-message-text-color']?>
}

.adminlink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['admin-message-link-color']?>
}

.headertext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['header-text-color']?>
}

.headerlink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['header-link-color']?>
}

<?=$style?>
-->
</style>
</head>
<body bgcolor="<?=$constant['background-color']?>" text="<?=$constant['text-color']?>" link="<?=$constant['link-color']?>" vlink="<?=$constant['link-color']?>" alink="<?=$constant['link-color']?>" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center" height="100%">
<tr>
	<td valign="top" class="text" height="1%">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext" id="book-title">Admbook versi0n <?=$constant['version']?></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
		<?php @include("temp/top.inc"); ?>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><b>Registration</b></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
	</td>
</tr>
</tr>
	<form action="registration.php" method="post">
	<td align="center">
		<table border="0" cellpadding="0" cellspacing="0">
<?php
	if ($registered)
	{
		session_unregister("icq");
		session_unregister("email");
		session_unregister("day");
		session_unregister("month");
		session_unregister("year");
		session_unregister("city");
		session_unregister("country");
?>
		<tr>
			<td class="text">User <?=$userLogin?> registration is successful. <a href="index.php#post" class="link">Send message</a>.</td>
		</tr>
<?php
	}
	else
	{
		if ($error != "")
		{
?>
		<tr>
			<td colspan="3" class="text">
				<b>Detect following errors:</b><br>
				<span id="error"><?=$error?></span>
				<br>
			</td>
		</tr>
<?php
			session_unregister("error");
			session_unregister("style");
		}
?>
		<tr>
			<td class="text"><span class="userLogin">name&nbsp;*:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170"><input type="text" size="16" name="userLogin" value="<?php if (isset($userLogin)) { print stripslashes($userLogin); session_unregister("userLogin"); }?>" maxlength="30" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text"><span class="usermail">mail&nbsp;*:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170"><input type="text" size="16" name="userMail" value="<?php if (isset($userMail)) { print stripslashes($userMail); session_unregister("userMail"); }?>" maxlength="128" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text"><span class="userpassword">password&nbsp;*:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170"><input type="password" size="16" name="userPassword" value="<?php if (isset($userPassword)) { print stripslashes($userPassword); session_unregister("userPassword"); }?>" maxlength="30" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text"><span class="userpassword">confirm&nbsp;password&nbsp;*:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170"><input type="password" size="16" name="confirmUserPassword" value="<?php if (isset($confirmUserPassword)) { print stripslashes($confirmUserPassword); session_unregister("confirmUserPassword"); }?>" maxlength="30" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text"><span class="url">url:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td><input type="text" size="15" name="url" value="<?php if (isset($url)) { print stripslashes($url); session_unregister("url"); } ?>" maxlength="128" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text" nowrap><span class="icq">icq:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170"><input type="text" size="16" name="icq" value="<?php if (isset($icq)) { print stripslashes($icq); session_unregister("icq"); }?>" maxlength="30" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text" nowrap><span class="country">country:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170">
				<select name="country">
					<option value="">&nbsp;</option>
<?php
		if (isset($country))
			session_unregister("country");
		else
			$country = array();
		while (list($key, $value) = each($config['country']))
		{
			$selected = false;
			if ($country == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="text" nowrap><span class="city">city:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170"><input type="text" size="16" name="city" value="<?php if (isset($city)) { print stripslashes($city); session_unregister("city"); }?>" maxlength="30" class="longfield"/></td>
		</tr>
		<tr>
			<td class="text" nowrap><span class="birthday">birthday:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td width="170">
				<select name="day">
					<option value="">&nbsp;</option>
<?php
		if (isset($day))
			session_unregister("day");
		else
			$day = array();
		while (list($key, $value) = each($config['day']))
		{
			$selected = false;
			if ($day == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select><select name="month">
					<option value="">&nbsp;</option>
<?php
		if (isset($month))
			session_unregister("month");
		else
			$month = array();
		while (list($key, $value) = each($config['month']))
		{
			$selected = false;
			if ($month == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select><input type="text" size="16" name="year" value="<?php if (isset($year)) { print stripslashes($year); session_unregister("year"); }?>" maxlength="4" class="shortfield"/>
			</td>
		</tr>
		<tr>
			<td colspan="3" height="10"><spacer width="1" height="10" type="block"></td>
		</tr>
		<tr>
			<td colspan="3" align="right"><input type="button" value="back" class="halfbutton" onClick="javascript:window.location.href='index.php?page=<?=$page?>'"/><input type="submit" value="registration" class="halfbutton"/></td>
		</tr>
<?php
	}
	$timer->stop();
?>
		</table>
	</td>
	</form>
</tr>
<tr>
	<td valign="bottom" align="right" height="1">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="50%" bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><span class="text">&copy;&nbsp;</span>trent&nbsp;<a href="http://www.low.ru/dev/guestbook/" class="text" target="_top">Download this guestbook</a>&nbsp;</td>
			<td width="50%" bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><span class="text">&nbsp;&nbsp;&nbsp;</span><a href="http://www.mylov.ru" onclick="location.href='http://partner.mylov.ru/link.phtml?pid=10359084&lid=553';return false;" class="link" target="_top">Çíàêîìñòâà è îáùåíèå</a>&nbsp;</td>
		</tr>
		</table>
	</td>
</tr>
</table>
<!-- generation time <?=$timer->elapsed()." sec";?> -->
</body>
</html>
Return current item: Admbook