MC Search and Match Profile and Account Management
- Register Group with Captcha
- View Group Profile
- Edit Group Profile
- MC (Microcommunity) Search and Match
- MC (Microcommunity) Search and Match — Security
- MC (Microcommunity) Search and Match — JavaScript
- MC (Microcommunity) Search and Match — Form
- MC (Microcommunity) Search and Match — PHP
- MC Questionnaire
- Microcommunity (MC) Registration Script — Enter Questionnaire Data in Database
- MC Search and Match Profile and Account Management
- Login to MC Search and Match Profile and Account Management
- Logout of MC Search and Match Profile and Account Management
- MC Questionnaire Login
- MC Questionnaire Info
- Delete Group Account
- Forgot User Name
- Forgot Password
- Form to Send Private Message
- Send Private Message
- Private Message Outbox
- Private Message Inbox
- Delete Private Message from Inbox
- Delete Private Message from Outbox
- Private Message Logout
- Private Message Session Monitoring
- MC (Microcommunity) Search and Match Session Monitoring
- Configure File for Database Connection
- Captcha Script for Registration and Login
This script is called register-for-mc.php
The first section is at the start of the script. First, we use the checkid.php script to ensure that the session id variable is set, and send the user to register-with-captcha.php if it is not. Then we put the session variable 'username' into $U—we will be checking that it is set in a second. Then we define a named constant '_NODIRECTACCESS'. We include the config.php file (in the includes folder) which uses the PHP defined() function to check on this constant. If it is not set, we are thrown out of the config.php file like yesterday's trash.
Next we check if the session variables 'groupname', 'username', and 'userid' are set. If not, we are sent to the login-to-mc.php script. We make sure $U is still equal to the session variable 'username', that it is not an empty string, and that it's at least 6 characters long or . . . you guessed it . . . the login script. We make sure the session id is set and send them away if not.
Thee CSS section has these styles for the div whose id is links:
#links {position:absolute;font-size:18px;top:100px;left:50%;margin-left:-137px;width:275px;padding:0px 20px 20px 20px;border:2px solid black;background-color:#ddd;}
Note that the margin-left property is purposely half the width times -1 and the left property is 50%. This is the best way to center an absolutely positioned div.
The HTML section has links to Login, Logout, Register, MC Search and Match, View Profile, Edit Profile, Take or Retake Questionnaire, Delete Account, Private Messages, and both password forgetting and user name forgetting scripts that get users info if they have the right email address. However, rather than telling the user his password, a new password is generated and given to the user.
The script below is called: register-for-mc.php
<?php
include_once"checkid.php";
$U=$_SESSION['username'];
define('_NODIRECTACCESS', TRUE);
include_once"includes/config.php";
if (!isset($_SESSION['groupname']) || !isset($_SESSION['userid']) || !isset($_SESSION['username']) || $_SESSION['username']<>$U || !isset($U) || $U=="" || strlen($U)<6 || !isset($_SESSION['sessionid'])){echo '<script language="javascript">alert("Please login."); window.location = "login-to-mc.php";</script>';}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>MC Search and Match Profile and Account Management</TITLE>
<meta name="description" content="MC Search and Match Profile and Account Management">
<meta name="keywords" content="MC Search and Match Profile and Account Management,edit info,match,search,Register,php,javascript, dhtml, DHTML">
<style type="text/css">
BODY {margin-left:0; margin-right:0; margin-top:0;text-align:left}
p, li {font:13px Verdana; color:black;text-align:left}
h1 {font:bold 28px Verdana; color:black;text-align:center}
h2 {font:bold 24px Verdana;text-align:center}
h3 {font:bold 15px Verdana;}
#links {position:absolute;font-size:18px;top:100px;left:50%;margin-left:-137px;width:275px;padding:0px 20px 20px 20px;border:2px solid black;background-color:#ddd;}
</style>
</head>
<body>
<center><h1>MC Search and Match Profile and Account Management</h1></center>
<div id='links'><BR>
<a HREF="login-to-mc.php">Login</a><BR>
<a HREF="mc-logout.php">Logout</a><BR>
<a HREF="register-with-captcha.php">Register</a><BR>
<a HREF="match.php">MC Search and Match</a><BR>
<a HREF="view-profile.php">View Profile</a><BR>
<a HREF="edit-profile.php">Edit Profile</a><BR>
<a HREF="questionnaire-login.php">Take or Retake Questionnaire</a><BR>
<a HREF="delete-account.php">Delete Account</a><BR>
<a HREF="send-message-form.php">Private Messages</a><BR>
<a HREF="http://www.thebiganswer.info/">Home</a><BR>
<a href="http://www.css-resources.com/contact.html">Contact us</a><BR>
<a href='forgot-password.php'>I forgot my password</a><BR>
<a HREF='forgot-user-name.php'>I forgot my user name</a><BR>
<a HREF="http://www.thebiganswer.info/">The Big Answer</a>
</div>
</body>
</html>