R
E
S
O
U
R
C
E
S
       Home      Products & Services      Contact Us      Links


WebHatchers will design & develop your site for you.
_______________________

Website Menu Heaven: menus, buttons, etc.
_______________________

Send us your questions.
_______________________

site search by freefind
_______________________

HOME
SEO, Google, Privacy
   and Anonymity
Browser Insanity
JavaScript
Popups and Tooltips
Free Website Search
HTML Form Creator
Animation
Buttons and Menus
Counters
Captchas
Image Uploading
CSS and HTML
PHP
AJAX
XPATH
Website Poll
IM and Texting
Databases—MySQL
   or Not MySQL
Personal Status Boards
Content Management
   Systems
Article Content
   Management Systems
Website Directory
   CMS Systems
Photo Gallery CMS
Forum CMS
Blog CMS
Customer Records
   Management CMS
Address Book CMS
Private Messaging CMS
Chat Room CMS
JavaScript Charts
   and Graphs




Free Personal Status Boards (PSB™)

Free Standard Free PSB

Free PSB Pro Version

Free Social PSB

Free Social PSB Plus (with Email)

Free Business PSB

Free Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement



Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

MC Search and Match Questionnaire

This script is called questionnaire.php

The first thing the user sees is not a questionnaire but a captcha. To see the questionnaire—ever—the captcha must be correctly solved. It consists of a 1-digit number being added to or subtracted from a 2-digit number. NOT rocket science.

The first PHP 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.

Next we get to the JavaScript section. We allow only numbers for most of the user input, so we use onlynum(e) to ensure only numbers are entered. Note that
var ch=e.charCode? e.charCode : e.keyCode; is because some browsers recognize charCode, some keyCode, so the code says grab the onkeypress event results with charCode if you can—otherwise use keyCode. The dozens of text input boxes of the questionnaire form all contain onkeypress="return onlynum(event)". The return word is to allow the input to be allowed and validated or disallowed and invalidated, because the onlynum(e) function can return true (allow) or false (disallow). The result is that, since there is a maxlength='2' attribute in the input tag, users may type one or two numbers or backspace or tab and nothing else. If JavaScript is turned off, the questionnaire script won't work at all and even if the user somehow managed to run the form's action script, register-for-an-mc.php, that script allows one or two numbers as well, and NOTHING else.

The function validatecaptcha() does essentially the same thing as the above, but the form allows more characters to be input even though the function validatecaptcha() allows only 2. It's just another way of doing it. The essential difference is that the onlynum(e) function is proactive (contols input as they type) and the function validatecaptcha() is reactive, waiting until the onsubmit event triggers the validator script to control input. The regular expression pattern
/^[0-9]{1,2}$/ simply says "one or two numbers only, please." If they mess up, they get an alert and the script returns false, which means the submission of captcha data is invalidated. The PHP script will check the correct captcha answer against the user's answer, of course, and they will never see the questionnaire script unless they get the captcha. The coolest thing about this captcha validator is that if they put in acceptable input, the captcha diappears. This happens because we use DHTML display property changing on the captcha div. Of course, the PHP validator will check the answer and the captcha may still reappear if the answer is incorrect.

The function grabselected() grabs all 13 select/option box inputs and all 57 questionnaire inputs (if they leave a text input box at its default 0 value, that is fine—0 is an OK input). How does it get the inputs? The submit button for the questionnaire is not a submit button at all but just an input button with an onclick event on it that runs a function with 13 parameters in it that are all of this form: this.form.Employment.options, and 57 parameters in it that all are of this form: this.form.needchildcare.value. In this latter case the form is sending the value in the text input box named "needchildcare". Once the input values are received by the function grabselected(), these values are put into parameters called q1, q2, q3, and so on to q57.

The 57 text input box values need no further processing so they will be stuck into a hidden field with the name "g" as a long string with 57 comma-separated numbers in it—ready for form submission to the form's action script, register-for-an-mc.php.

The 13 options are a different story. There's a separate little script for each of these. The function's parameters define that these options go into o1, o2, up to o13. It turns out that when we send option values from a form as parameters of the form this.form.Employment.options, you get option arrays. That's what we address now.

We use the array length to limit the looping we'll do for each array of input. Every array element with a selected property gets its value stuck into a JavaScript array
v[]. If nothing in the options of the select tag was selected, the v[] array gets a 0 in its element 0. The whole v[] array gets put into a string with the toString() function. Then the array is emptied with use of a simple v=[] command. All 13 of these stringified comma-separated arrays get concatenated into one longer string, with the use of the character | as array separators. This string will need no further processing so it gets stuck into a hidden field with the name "u" as a long string. It is ready for form submission to the form's action script, register-for-an-mc.php. This we accomplish with the submit() method.

Now for some more PHP. We POST the 'entering' and 'answer' fields to the script to check their captcha solving. If the user is not logged in, his username session variable will not be available so we send him to login. If it's OK and the session id is set as well, as it should be, then we go to the MySQL database table and see if his username is there. If not, he gets an alert and is sent to login. If his captcha answer is no good, we reload the page, giving him another try. If it is good, we ask him to fill out the questionnaire.

If anything goes wrong $N gets a 1. If $N is 1 or $Entering (the "captcha was submitted" flag) is 0 (not submitted yet) the user sees only the captcha. Yes, the form uses a captcha. We used the official captcha method in our Personal Status Board (PSB™) scripts, but designed a less cumbersome method for our MC questionnaire scripts.

Take a gander at the captcha code: <IMG SRC="captcha-with-sessions.php" alt='captcha'>. A pretty strange type of image, to be sure! Browsers do NOT mind PHP scripts sitting in for PNG, BMP, GIF, or JPG images, believe it or not. You'll see "If you see no Captcha, disable your ad blocker." Ad blockers with strong settings may knock the captcha out of the form. But Pop-up Blockers do not molest our captcha since it is NOT a pop-up. So your users were informed about the ad blocker nastiness when they registered—we doubt they will forget. The captcha is a random PNG image created using functions from the GD library, which is in all recent PHP versions. (To use the recommended bundled version of the GD library, which was first bundled in PHP 4.3.0, get your server hosts to use the configure option "--with-gd". Most already do this.)

The captcha image uses the font Holisb__.ttf, which is the Holiday Springs BTN True Type Font (get at MyFonts.com), but you may use other types if you wish. If you find arial.ttf in your C:\WINDOWS\Fonts\ directory on your computer, make sure it is in your folder with your PHP scripts on your server. Holisb__.ttf does a much cooler job, and will be harder for any automatic spambot script to read (and get the right answer for the arithmetic problem). For the captcha script, go to: Captcha Script for Registration and Login.

Even though we stick a hidden username field in the form and stick the username in it, we handle the username via session variables, so we don't even bother to get the POSTed username in this captcha script, but when we run the questionnaire form action script register-for-an-mc.php, we do get the POSTed username and the script only works if you just came from the questionnaire.php script.

Next, if they passed the captcha test, they will see the questionnaire form, whose action script is register-for-an-mc.php. Most of the input is with text input boxes with a maxlength of 2 and the function onlynum() run from the onkeypress event. The last 13 inputs are from select/option list boxes with the multiple attribute in effect so you can select multiple options. There's no standard submit button—just an input button whose onclick event runs the main JavaScript script discussed above.

There's also another input button that says "I will do it some other time." and leads to the login script Login to MC Search and Match Profile and Account Management.



The script below is called: questionnaire.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 Questionnaire</TITLE>
<meta name="description" content="MC Search and Match Questionnaire">
<meta name="keywords" content="MC Search and Match Questionnaire,Register for MC Search and Match,add info,match,search,Register Script,registration,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;}
.k {text-align:right}
.j {position:absolute;top:50px;left:50%;margin-left:-300px;width:600px}
.m {margin-left:130px}
#myform {position:absolute;top:20px;left:50%;margin-left:-450px;width:900px;border:2px solid black;background-color:#8aa;}
#captcha {position:absolute;top:100px;left:50%;margin-left:-200px;width:400px;}
#captchaform {position:absolute;top:100px;left:400px;width:300px;}
#t {position:absolute;width:860px;padding:9px;top:100px;left:300px;z-index:99}
#c {width:860px;padding:9px;margin-left:-170px}
</style>
<script type="text/javascript">

function onlynum(e){
var ch=e.charCode? e.charCode : e.keyCode;
if (ch!=8 && ch!=9){ //allow backspace or tab key
if (ch<48||ch>57){return false}}}

function validatecaptcha(){

var ck_captcha = /^[0-9]{1,2}$/;
if (document.captchaform.captcha.value.search(ck_captcha)==-1)
{alert("Please only enter 1 or 2 numbers for captcha answer.");return false}
var e=document.getElementById(captcha);e.style.display='none';
var q=document.getElementById(captchaform);q.style.display='none';
return true;}

function grabselected(o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,
q11,q12,q13,q14,q15,q16,q17,q18,q19,q20,q21,q22,q23,q24,q25,q26,q27,q28,
q29,q30,q31,q32,q33,q34,q35,q36,q37,q38,q39,q40,q41,q42,q43,q44,q45,q46,
q47,q48,q49,q50,q51,q52,q53,q54,q55,q56,q57){
var v = new Array();
for (var i=0; i < o1.length; i++) {
if (o1[i].selected){x=v.length;v[x]=o1[i].value;}}
if (v.length<1){v[0]=0;};z=v.toString();v=[];
for (var i=0; i < o2.length; i++) {
if (o2[i].selected){x=v.length;v[x]=o2[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o3.length; i++) {
if (o3[i].selected){x=v.length;v[x]=o3[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o4.length; i++) {
if (o4[i].selected){x=v.length;v[x]=o4[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o5.length; i++) {
if (o5[i].selected){x=v.length;v[x]=o5[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o6.length; i++) {
if (o6[i].selected){x=v.length;v[x]=o6[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o7.length; i++) {
if (o7[i].selected){x=v.length;v[x]=o7[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o8.length; i++) {
if (o8[i].selected){x=v.length;v[x]=o8[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o9.length; i++) {
if (o9[i].selected){x=v.length;v[x]=o9[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o10.length; i++) {
if (o10[i].selected){x=v.length;v[x]=o10[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o11.length; i++) {
if (o11[i].selected){x=v.length;v[x]=o11[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o12.length; i++) {
if (o12[i].selected){x=v.length;v[x]=o12[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();v=[];
for (var i=0; i < o13.length; i++) {
if (o13[i].selected){x=v.length;v[x]=o13[i].value;}}
if (v.length<1){v[0]=0;};z=z+"|"+v.toString();
document.formpw.u.value=z;
document.formpw.g.value=q1+","+q2+","+q3+","+q4+","+q5+","+q6+","
+q7+","+q8+","+q9+","+q10+","+q11+","+q12+","+q13+","+q14+","
+q15+","+q16+","+q17+","+q18+","+q19+","+q20+","+q21+","+q22+","
+q23+","+q24+","+q25+","+q26+","+q27+","+q28+","+q29+","+q30+","
+q31+","+q32+","+q33+","+q34+","+q35+","+q36+","+q37+","+q38+","
+q39+","+q40+","+q41+","+q42+","+q43+","+q44+","+q45+","+q46+","
+q47+","+q48+","+q49+","+q50+","+q51+","+q52+","+q53+","+q54+","
+q55+","+q56+","+q57;
document.formpw.submit();}

</script>

</head>
<body>

<?php

$Entering=$_POST['entering'];
$A=$_POST['answer'];
$N=0;

if(!isset($U))
{$N=1;unset($U);echo '<script language="javascript">alert("Please login again.");window.location="login-to-mc.php";</script>;';}

if($U==$_SESSION['username'] && isset($_SESSION['sessionid'])){
$check_user_data = mysql_query("SELECT * FROM mc_members WHERE username = '$U' LIMIT 1") or die(mysql_error());
if(mysql_num_rows($check_user_data) == 0)
{$N=1;unset($U);echo '<script language="javascript">alert("This user name does not exist. Please login again.");window.location="login-to-mc.php";</script>;';
}else{

if($Entering==1 && $A<>$_SESSION['a__________a']){$N=1;echo '<script language="javascript">alert("Wrong captcha answer. Please try again.");window.location="questionnaire.php";</script>;';
}else{

if($Entering==1 && $A==$_SESSION['a__________a']){$Entering=2;$N=0;echo '<script language="javascript">alert("Please fill out Questionnaire.");</script>;';
}}

if($N==1||$Entering==0){ ?>

<center><h1>MC Search and Match Questionnaire</h1></center>

<center><div class='j'><b>Before you Register for MC Search and Match, please meet with all your group members and agree on all the answers to the questions below:</b></div></center>

<div id='captcha'><BR><h3 class='m'>Are you human?</h3><BR><table id='c' border='0' cellspacing=0 cellpadding=2>
<form id='captchaform' name="captchaform" method="post" action="questionnaire.php" onsubmit="return validatecaptcha()">
<tr><td class='k'>
<input type="hidden" name="entering" value="1">
<input type="hidden" name="username" value="">
&nbsp;</td><td><IMG SRC="captcha-with-sessions.php" alt='captcha'>
</td></tr>
<tr><td class='k'><label for="Captcha answer"><b>Captcha answer: </b></td><td><input type="text" name="answer" size="20" maxlength="20" value=""></label></td></tr>
<tr><td align=left colspan=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you see no Captcha, disable your ad blocker.</td></tr>
<tr><td class='k'>&nbsp;</td><td><BR><input type="submit" value="Submit">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Reset"></td></tr></form></table><BR>
</div>

<script language="javascript">
var u = <?php echo json_encode($U); ?>;
document.captchaform.username.value=u;
</script>

<?php
}else{
?>

<div id='myform'><BR><center><h3>Questionnaire</h3></center><table id='tttttt' border='0' cellspacing=0 cellpadding=2></td></tr><tr><td>
<form id='formpw' name="formpw" method="post" action="register-for-an-mc.php">
<center>
<table style='margin:-200px 0 0 100px' width='500' cellspacing=0 cellpadding=0 border=1><tr><th colspan='2'><b>Group Configuration</b></th></tr>
<tr><td>How many males in your group are 0-3 years old? </td><td><input type="text" name="males03" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 4-7 years old? </td><td><input type="text" name="males47" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 8-11 years old? </td><td><input type="text" name="males811" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 12-14 years old? </td><td><input type="text" name="males1214" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 15-17 years old? </td><td><input type="text" name="males1517" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 18-23 years old? </td><td><input type="text" name="males1823" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 24-34 years old? </td><td><input type="text" name="males2434" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 35-49 years old? </td><td><input type="text" name="males3549" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 50-65 years old? </td><td><input type="text" name="males5065" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 66-79 years old? </td><td><input type="text" name="males6679" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many males in your group are 80 or more years old? </td><td><input type="text" name="males80" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><td>How many females in your group are 0-3 years old? </td><td><input type="text" name="females03" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 4-7 years old? </td><td><input type="text" name="females47" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 8-11 years old? </td><td><input type="text" name="females811" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 12-14 years old? </td><td><input type="text" name="females1214" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 15-17 years old? </td><td><input type="text" name="females1517" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 18-23 years old? </td><td><input type="text" name="females1823" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 24-34 years old? </td><td><input type="text" name="females2434" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 35-49 years old? </td><td><input type="text" name="females3549" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 50-65 years old? </td><td><input type="text" name="females5065" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 66-79 years old? </td><td><input type="text" name="females6679" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many females in your group are 80 or more years old? </td><td><input type="text" name="females80" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><td>How many adults in your group are childless? </td><td><input type="text" name="childless" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are empty nesters? </td><td><input type="text" name="emptynesters" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are widows? </td><td><input type="text" name="widows" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are widowers? </td><td><input type="text" name="widowers" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are married? </td><td><input type="text" name="married" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are living together? </td><td><input type="text" name="livingtogether" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are separated? </td><td><input type="text" name="separated" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are divorced? </td><td><input type="text" name="divorced" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are engaged? </td><td><input type="text" name="engaged" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adults in your group are single? </td><td><input type="text" name="single" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><td>How many adult men in your group are gay? </td><td><input type="text" name="gaymales" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many adult women in your group are lesbian? </td><td><input type="text" name="lesbian" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><td>How many people in your group are White? </td><td><input type="text" name="white" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are Black? </td><td><input type="text" name="black" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are Asian? </td><td><input type="text" name="asian" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are Hispanic? </td><td><input type="text" name="hispanic" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are Native Hawaiian or Pacific Islander? </td><td><input type="text" name="hawaiian" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are Mixed? </td><td><input type="text" name="mixed" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group have criminal records? </td><td><input type="text" name="criminal" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><th colspan='2'><b>Schools</b></th></tr>
<tr><td>How many children in your group are being home schooled? </td><td><input type="text" name="homeschooled" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many children in your group go to public schools? </td><td><input type="text" name="publicschools" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many children in your group go to private schools? </td><td><input type="text" name="privateschools" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many children in your group go to religious schools? </td><td><input type="text" name="religiousschools" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many children in your group go to special schools? </td><td><input type="text" name="specialschools" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><th colspan='2'><b>Health</b></th></tr>
<tr><td>How many people in your group have serious allergies? </td><td><input type="text" name="allergies" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group have chronic illnesses? </td><td><input type="text" name="chronic" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group have mental illnesses? </td><td><input type="text" name="mental" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group have serious disabilities? </td><td><input type="text" name="disabilities" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group need accessibility ramps? </td><td><input type="text" name="ramps" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr><BR><BR>

<tr><th colspan='2'><b>Care</b></th></tr>
<tr><td>How many people in your group are willing to do eldercare? </td><td><input type="text" name="willingeldercare" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are available to do eldercare? </td><td><input type="text" name="availableeldercare" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many elders in your group need eldercare? </td><td><input type="text" name="needeldercare" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are willing to do childcare? </td><td><input type="text" name="willingchildcare" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group are available to do childcare? </td><td><input type="text" name="availablechildcare" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr>
<tr><td>How many people in your group need childcare? </td><td><input type="text" name="needchildcare" size='2' maxlength='2' value='0' onkeypress="return onlynum(event)"></td></tr></table></center><BR><BR>

<center><table style='margin:0px 0 0 100px' width='675' cellspacing=0 cellpadding=0 border=1>
<tr><th colspan='2'><b>Preferences (use ctrl key for multiple selections)</b></th><tr>
<tr><td><b>Smoking/Drinking</b></td><td><SELECT multiple="multiple" name="Smoking_Drinking">
<OPTION value="0">No preference
<OPTION value="1">Prefer nonsmokers
<OPTION value="2">Smoking not an issue
<OPTION value="3">Prefer nondrinkers
<OPTION value="4">Drinking not an issue
</SELECT></td></tr>

<tr><td><b>Preferred Housing Type</b></td><td><SELECT multiple="multiple" name="Preferred_Housing_Type">
<OPTION value="0">No preference
<OPTION value="1">Row houses
<OPTION value="2">Apartments
<OPTION value="3">Mobile homes
<OPTION value="4">Manufactured homes
<OPTION value="5">Condominium
<OPTION value="6">Co-op
<OPTION value="7">Hotel
<OPTION value="8">Motel
<OPTION value="9">Farm
<OPTION value="10">Rural
<OPTION value="11">City
<OPTION value="12">Suburbs
<OPTION value="13">Retirement community
<OPTION value="14">Gated community
<OPTION value="15">Pocket neighborhoods
</SELECT></td></tr>
<tr><td>(Pocket neighborhoods are intimate neighborhoods<BR>featuring groupings of detached cottages and<BR>small homes clustered around garden courtyards)

<tr><td><b>Willing to relocate? (one selection only)</b></td><td><SELECT name="Willing_to_relocate">
<OPTION value="0">No preference
<OPTION value="1">Yes, anywhere
<OPTION value="2">Yes, up to 1000 miles
<OPTION value="3">Yes, up to 500 miles
<OPTION value="4">Yes, up to 200 miles
<OPTION value="5">Yes, up to 100 miles
<OPTION value="6">Yes, up to 50 miles
<OPTION value="7">Yes, up to 10 miles
<OPTION value="8">Yes, up to 2 miles
<OPTION value="9">No
</SELECT></td></tr>

<tr><td><b>MC type sought</b></td><td><SELECT multiple="multiple" name="MC_type_sought">
<OPTION value="0">No preference
<OPTION value="1">With children
<OPTION value="2">Without children
<OPTION value="3">Children not an issue
<OPTION value="4">Singles MC
<OPTION value="5">Married MC
<OPTION value="6">Mixed MC
<OPTION value="7">Marital status not an issue
</SELECT></td></tr>

<tr><td><b>Open to be in mixed race MC?</b></td><td><SELECT multiple="multiple" name="Open_to_be_in_mixed_race_MC">
<OPTION value="0">No preference
<OPTION value="1">Prefer to be in MC of my own race
<OPTION value="2">Prefer to be in MC with racial diversity
<OPTION value="3">Race not an issue
</SELECT></td></tr>

<tr><td><b>Sexuality</b></td><td><SELECT multiple="multiple" name="Sexuality">
<OPTION value="0">No preference
<OPTION value="1">Prefer not to answer
<OPTION value="2">Open to be in mixed sexual preference MC
<OPTION value="3">Prefer to be in MC of my own sexual preference
<OPTION value="4">Prefer to be in MC with sexual preference diversity
<OPTION value="5">Sexual preference not an issue
</SELECT></td></tr>

<tr><td><b>Religious Openness</b></td><td><SELECT multiple="multiple" name="Religious_Openness">
<OPTION value="0">No preference
<OPTION value="1">Open to be in mixed religion MC
<OPTION value="2">Prefer to be in MC of my own religion
<OPTION value="3">Prefer to be in MC with religious diversity
<OPTION value="4">Religion not an issue
<OPTION value="5">Prefer not to answer
</SELECT></td></tr>

<tr><td><b>Religion</b></td><td><SELECT multiple="multiple" name="Religion">
<OPTION value="0">No preference
<OPTION value="1">Agnostic
<OPTION value="2">Apostolic or New Apostolic
<OPTION value="3">Assemblies of God
<OPTION value="4">Atheist
<OPTION value="5">Baha'I
<OPTION value="6">Baptist
<OPTION value="7">Buddhist
<OPTION value="8">Catholic
<OPTION value="9">Christian Reform
<OPTION value="10">Christian Science
<OPTION value="11">Christian no denomination supplied
<OPTION value="12">Church of God
<OPTION value="13">Church of the Brethren
<OPTION value="14">Church of the Nazarene
<OPTION value="15">Churches of Christ
<OPTION value="16">Congregational or United Church of Christ
<OPTION value="17">Deity
<OPTION value="18">Disciples of Christ
<OPTION value="19">Druid
<OPTION value="20">Eckankar
<OPTION value="21">Episcopalian or Anglican
<OPTION value="22">Ethical Culture
<OPTION value="23">Evangelical or Born Again
<OPTION value="24">Foursquare Gospel
<OPTION value="25">Full Gospel
<OPTION value="26">Fundamentalist
<OPTION value="27">Hindu
<OPTION value="28">Holiness or Holy
<OPTION value="29">Humanist
<OPTION value="30">Independent Christian Church
<OPTION value="31">Jehovah's Witness
<OPTION value="32">Jewish
<OPTION value="33">Lutheran
<OPTION value="34">Mennonite
<OPTION value="35">Methodist or Wesleyan
<OPTION value="36">Mormon or Latter Day Saints
<OPTION value="37">Muslim
<OPTION value="38">Native American
<OPTION value="39">New Age
<OPTION value="40">No religion
<OPTION value="41">Nondenominational
<OPTION value="42">Orthodox Eastern
<OPTION value="43">Other unclassified
<OPTION value="44">Pagan
<OPTION value="45">Pentecostal or Charismatic
<OPTION value="46">Presbyterian
<OPTION value="47">Protestant no denomination supplied
<OPTION value="48">Quaker
<OPTION value="49">Rastafarian
<OPTION value="50">Reformed or Dutch Reform
<OPTION value="51">Salvation Army
<OPTION value="52">Santeria
<OPTION value="53">Scientologist
<OPTION value="54">Secular
<OPTION value="55">Seventh Day Adventist
<OPTION value="56">Sikh
<OPTION value="57">Spiritualist
<OPTION value="58">Taoist
<OPTION value="59">Unitarian or Universalist
<OPTION value="60">Wiccan
</SELECT></td></tr>

<tr><td><b>Childrearing Style and Preferences</b></td><td><SELECT multiple="multiple" name="Childrearing_Style_and_Preferences">
<OPTION value="0">No preference
<OPTION value="1">Liberal or permissive
<OPTION value="2">Authoritative
<OPTION value="3">Authoritarian
<OPTION value="4">Liberal and authoritative mix
<OPTION value="5">Liberal and authoritarian mix
<OPTION value="6">Authoritative and authoritarian mix
</SELECT></td></tr>

<tr><td><b>Pets</b></td><td><SELECT multiple="multiple" name="Pets">
<OPTION value="0">No preference
<OPTION value="1">Have dogs
<OPTION value="2">Have cats
<OPTION value="3">Have birds
<OPTION value="4">Have other pets
<OPTION value="5">Have barking dogs
<OPTION value="6">Have screeching birds
<OPTION value="7">Tolerant of neighbors' pet sounds
<OPTION value="8">Not tolerant of neighbors' pet sounds
</SELECT></td></tr>

<tr><td><b>Personal Entertainment</b></td><td><SELECT multiple="multiple" name="Personal_Entertainment">
<OPTION value="0">No preference
<OPTION value="1">Tolerant of neighbors' loud music or TV
<OPTION value="2">Not tolerant of neighbors' loud music or TV
</SELECT></td></tr>

<tr><td><b>Housing—Interested in Common Shared Space for:</b></td><td><SELECT multiple="multiple" name="Housing_Interested_in_Common_Shared_Space_for">
<OPTION value="0">No preference
<OPTION value="1">Cooking
<OPTION value="2">Laundry
<OPTION value="3">Exercise
<OPTION value="4">Childcare
<OPTION value="5">Eldercare
<OPTION value="6">Home schooling
<OPTION value="7">Meetings
<OPTION value="8">Entertainment
<OPTION value="9">Not interested in common space
</SELECT></td></tr>

<tr><td><b>Employment</b></td><td><SELECT multiple="multiple" name="Employment">
<OPTION value="0">No preference
<OPTION value="1">Management, business, and financial
<OPTION value="2">Professional and related
<OPTION value="3">Office and administrative support
<OPTION value="4">Service
<OPTION value="5">Installation, maintenance, and repair
<OPTION value="6">Transportation and material moving
<OPTION value="7">Construction and extraction
<OPTION value="8">Production
<OPTION value="9">Sales and related
<OPTION value="10">Farming, fishing, and forestry
<OPTION value="11">Armed forces
<OPTION value="12">Part-time
<OPTION value="13">Temporary
<OPTION value="14">Retired
<OPTION value="15">Unemployed
<OPTION value="16">Independently wealthy
</SELECT></td></tr>

<br><br>
<tr><td class='k'>
<input type="hidden" name="flag" value="1">
<input type="hidden" name="username" value="">
<input type="hidden" value="" name="u">
<input type="hidden" value="" name="g">&nbsp;</td><td><BR>

<INPUT TYPE=BUTTON VALUE="Submit"
ONCLICK="grabselected(this.form.Smoking_Drinking.options,this.form.Preferred_Housing_Type.options,
this.form.Willing_to_relocate.options,this.form.MC_type_sought.options,
this.form.Open_to_be_in_mixed_race_MC.options,this.form.Sexuality.options,
this.form.Religious_Openness.options,this.form.Religion.options,
this.form.Childrearing_Style_and_Preferences.options,this.form.Pets.options,
this.form.Personal_Entertainment.options,
this.form.Housing_Interested_in_Common_Shared_Space_for.options,
this.form.Employment.options,this.form.males03.value,this.form.males47.value,
this.form.males811.value,
this.form.males1214.value,this.form.males1517.value,this.form.males1823.value,
this.form.males2434.value,this.form.males3549.value,this.form.males5065.value,
this.form.males6679.value,this.form.males80.value,this.form.females03.value,
this.form.females47.value,this.form.females811.value,
this.form.females1214.value,this.form.females1517.value,
this.form.females1823.value,this.form.females2434.value,
this.form.females3549.value,this.form.females5065.value,
this.form.females6679.value,this.form.females80.value,
this.form.childless.value,this.form.emptynesters.value,
this.form.widows.value,this.form.widowers.value,this.form.married.value,
this.form.livingtogether.value,this.form.separated.value,this.form.divorced.value,
this.form.engaged.value,this.form.single.value,this.form.gaymales.value,
this.form.lesbian.value,this.form.white.value,this.form.black.value,
this.form.asian.value,this.form.hispanic.value,this.form.hawaiian.value,
this.form.mixed.value,this.form.criminal.value,this.form.homeschooled.value,
this.form.publicschools.value,this.form.privateschools.value,
this.form.religiousschools.value,this.form.specialschools.value,
this.form.allergies.value,this.form.chronic.value,this.form.mental.value,
this.form.disabilities.value,this.form.ramps.value,this.form.willingeldercare.value,
this.form.availableeldercare.value,this.form.needeldercare.value,
this.form.willingchildcare.value,this.form.availablechildcare.value,
this.form.needchildcare.value)">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Reset"></td></tr></table></center>
</form></td></tr></table><BR>
</div>

<div style='position:absolute;top:80px;left:400px;z-index:999'><form>
<INPUT TYPE="BUTTON" VALUE="I will do it some other time." ONCLICK="window.location.href='login-to-mc.php'">
</form></div>

<script language="javascript">
var un = <?php echo json_encode($U); ?>;
document.formpw.username.value=un;
</script>

<?php
}}}
?>

</body>
</html>