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

SEO, Google, Privacy
   and Anonymity
Browser Insanity
Popups and Tooltips
Free Website Search
HTML Form Creator
Buttons and Menus
Image Uploading
Website Poll
IM and Texting
   or Not MySQL
Personal Status Boards
Content Management
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

Register by Email with PHP

PHP can do just about anything. The script below will concentrate on registering people by email.

Sometimes you need to get people to register for something that you are putting on, giving away, offering, allowing, or whatever. You do not need CGI or CGI bins to do this. A simple HTML form and a simply PHP script will do the job just fine. We are assuming you don't need to store the person's registration information in a MySQL database. There are other scripts on this website that deal with such issues—just search with our search box. This script does not store anything. It just sends the site owner a simple email giving the info provided by the registrant.

Note that a simple captcha is used to prevent spam. The image login-question.png is used for this purpose. It contains a text question that is an image so the spammers have a nasty time trying to read it. But they must also answer the question correctly. Here it is:

A thinking spambot is probably a pretty rare creature!

There is nothing special about the form. It uses the captcha question and its action is to use the PHP file form.php.

The PHP file is used to validate the submitted form info. It gets the name, email, phone and zip POSTed to it and the captcha answer as well. If the submitted captcha answer is right and the phone or email info looks like it might be okay, the rest of the script is run. If the captcha is wrong or the submitted email or phone info look insincere (not long enough), most of the script is skipped and the user gets a message that "Wrong captcha answer or inadequate info. Try again."

The PHP substr() function makes sure no input has over 62 characters. The PHP strip_tags() function dumps tags found in input. Next the PHP preg_replace() function throws out all characters in the inputs that are unacceptable. For everything except email, that means dumping everything but letters, numbers, space, - and _. For email input, that means anything not allowed in emails. The 047 in the second regular expression pattern is the single quote—which is in this form because single quotes surround the regular expression.

The website owner's email address goes into the $e variable. This is in the "To" field of the email. If the input passes the smell test, the registrant sees the message "Thanks for registering. I will get back to you ASAP." If the input "stinks," the would-be-registrant sees "Wrong captcha answer or inadequate info. Try again."

The HTML Script (Contact-Me.html) for Registering by Email

<P><b>Limited Offer: </b>If you'd like to have a FREE Consultation, simply Register, using the form below.<BR><BR><BR>
<table width="570" border="1" align="center" cellpadding="0" cellspacing="1" bgcolor="#ffffff">
<form id="form" name="form" method="post" action="form.php">
<table width="570" border="0" cellpadding="3" cellspacing="1" bgcolor="#ffffff">
<tr><td colspan='3' align='center'>FREE Consultation<BR><BR></td><tr>
<td align="right" width="150">Name: </td>
<td width="360"><input name="name" type="text" id="name" size="62" maxlength="62"></td>
<td width="50"> </td>
<td align="right">Email: </td>
<td><input name="email" type="text" id="email" size="62" maxlength="62"></td>
<td width="50"> </td>
<td align="right">Phone: </td>
<td><input name="phone" type="text" id="websiteURL" size="62" maxlength="62"></td>
<td width="50"> </td>
<td align="right">Zip: </td>
<td><input name="zip" type="text" id="websiteURL" size="62" maxlength="62"></td>
<td width="50"> </td>
<td align="right">Captcha: </td>
<td><IMG SRC="login-question.png" WIDTH=294 HEIGHT=36 BORDER=0></td>
<td width="50"> </td>
<td align="right">Answer: </td>
<td><input name="answer" type="text" id="answer" size="20" maxlength="20"></td>
<td width="50"> </td>
<td valign="top"> </td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit" value="Reset"></td>
<td width="50"> </td>

The PHP Script (form.php) for Registering by Email



if($answer=="of" && (strlen($email)>6 || strlen($phone)>6)){

$pattern1 = '/[^a-zA-Z0-9\\_\\s\\-]/i';
$pattern2 = '/[^a-zA-Z0-9\\.\\,\\!\\;\\-\\_\\*\\@\\=\\+\\$\\/\\&\\[\\]\\#\\?\\047\\:\\(\\)]/i';
$replacement = '';
$zip=preg_replace($pattern1, $replacement, $zip);
$phone=preg_replace($pattern1, $replacement, $phone);
$email=preg_replace($pattern2, $replacement, $email);
$name=preg_replace($pattern1, $replacement, $name);


$to = $e;
$subject = "Registrants for FREE Consultation";
$message = "Name: ".$name."\n\nEmail: ".$email."\n\nPhone: ".$phone."\n\nZip: ".$zip."\n\n";
$headers = "From: ".$email."\r\nReply-To: ".$email;
$mail_sent = mail($to, $subject, $message, $headers);
echo '<script language="javascript">alert("Thanks for registering. I will get back to you ASAP."); window.location="Contact-Me.html";</script>';

}else{echo '<script language="javascript">alert("Wrong captcha answer or inadequate info. Try again."); window.location="Contact-Me.html";</script>';}