PHP Registration Form - PHP mail

Hi,
I have a registration form with the following field
id, fname, lname, email, address, city, telephone1, telephone2, username, password1
and I want after the user submits the form to send an email to the admin that a user has registered and an email to the user welcoming them to the site.
How can I do that?
dino_angelidesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rjdownCommented:
Check out the mail() function: http://php.net/manual/en/function.mail.php and read through the examples.

It should be self-explanatory, but if you need more information or further examples, please paste the code from your current form.
0
dino_angelidesAuthor Commented:
this is the sample i had but it does not send any email
this is on the registration verification page....and its on a live server
<?php 
error_reporting(E_ALL);

// SEND MAIL FROM A FORM

// A FUNCTION TO CLEAN UP THE DATA - AVOID BECOMING AN OPEN-RELAY FOR SPAM
function clean_string($str)
{
    $str = stripslashes($str);
    $str = trim(preg_replace("/ +/", " ", $str));
    $str = preg_replace('/^ a-zA-Z0-9&+:?_\.\-/', '', $str);
    return $str;
}

// REQUIRED VALUES ARE PREPOPULATED - CHANGE THESE FOR YOUR TEST

$to  = $_POST['email'];
$from  = "noreply@liteways.com";
$subj  = "RealEstateOnline Registration";

// IF THE DATA HAS BEEN POSTED
if (!empty($_POST['email']))
{

// CLEAN UP THE POTENTIALLY BAD AND DANGEROUS DATA
         $fname         = clean_string($_POST["fname"]);
	 $lname         = clean_string($_POST["lname"]);
	 $email         = clean_string($_POST["email"]);
	 $address       = clean_string($_POST["address"]);
	 $city          = clean_string($_POST["city"]);
	 $telephone1    = clean_string($_POST["telephone1"]);
	 $telephone2    = clean_string($_POST["telephone2"]);
	 $username      = clean_string($_POST["username"]);
	 $password1     = clean_string($_POST["password1"]);
	 $password2     = clean_string($_POST["password2"]);
    // CONSTRUCT THE MESSAGE
  
    $content   .= "Test Registration Email\n\n";
    $content   .= "Thank You\n\n";
	$content   .= "Real Estate Online\n\n";
	
    // To Admin
   $to1    = "info@dinoangelides.com";
   $from1  = "noreply@liteways.com";
   $subj1  = "RealEstateOnline - Member Registration";
  // CONSTRUCT THE MESSAGE
    $message    = '';
    $message   .= "There is a new registration from $name \n\n";

      // SEND MAIL
  
    mail( $email, $subj, $content, "From: $from\r\n");
    mail( $to1, $subj1, $content, "From: $from1\r\n");

}
?>

Open in new window

0
rjdownCommented:
I can't see anything obvious, aside from the end of your $content and $message which should say /r/n and not /n/n

Where you have

mail( $email, $subj, $content, "From: $from\r\n");

You could try

if ( !mail( $email, $subj, $content, "From: $from\r\n") )
{
echo "error sending email";
}

if you get the error, there is something wrong with your server configuration and you'll need to contact your hosting provider.
0
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

hieloCommented:
you did not initialize $content before you began appending to it. Also, try adding a To field/header explicitly. Lastly, lines 17-19 should be within the if clause:
<?php 
error_reporting(E_ALL);

// SEND MAIL FROM A FORM

// A FUNCTION TO CLEAN UP THE DATA - AVOID BECOMING AN OPEN-RELAY FOR SPAM
function clean_string($str)
{
    $str = stripslashes($str);
    $str = trim(preg_replace("/ +/", " ", $str));
    $str = preg_replace('/^ a-zA-Z0-9&+:?_\.\-/', '', $str);
    return $str;
}


// IF THE DATA HAS BEEN POSTED
if (isset($_POST['email']) && !empty($_POST['email']))
{
	// REQUIRED VALUES ARE PREPOPULATED - CHANGE THESE FOR YOUR TEST
	$to  = clean_string($_POST['email']);
	$from  = "noreply@liteways.com";
	$subj  = "RealEstateOnline Registration";

	// CLEAN UP THE POTENTIALLY BAD AND DANGEROUS DATA
	$fname         = clean_string($_POST["fname"]);
	$lname         = clean_string($_POST["lname"]);
	$email         = clean_string($_POST["email"]);
	$address       = clean_string($_POST["address"]);
	$city          = clean_string($_POST["city"]);
	$telephone1    = clean_string($_POST["telephone1"]);
	$telephone2    = clean_string($_POST["telephone2"]);
	$username      = clean_string($_POST["username"]);
	$password1     = clean_string($_POST["password1"]);
	$password2     = clean_string($_POST["password2"]);

	// CONSTRUCT THE MESSAGE
	$content ='';
	$content   .= "Test Registration Email\n\n";
	$content   .= "Thank You\n\n";
	$content   .= "Real Estate Online\n\n";
        
    mail( $to, $subj, $content, "To:$to\r\nFrom: $from\r\n");


	// To Admin
	$to1    = "info@dinoangelides.com";
	$from1  = "noreply@liteways.com";
	$subj1  = "RealEstateOnline - Member Registration";

	// CONSTRUCT THE MESSAGE
	$message    = '';
	$message   .= "There is a new registration from $name \n\n";

	// SEND MAIL
    mail( $to1, $subj1, $message, "To:$to1\r\nFrom: $from1\r\n");

}
?>

Open in new window

0
dino_angelidesAuthor Commented:
Well, still it did not work....
the weird thing is that, the code I inserted in my comment above, I have it in other places, like in contacts or send to a friend forms and it works just fine.....
now with the registration it does not want to go thru.....
0
hieloCommented:
did you verify that the email did NOT end in a SPAM folder? Did BOTH emails failed?
0
rjdownCommented:
Did you receive the error using my example?
0
dino_angelidesAuthor Commented:
both mails failed yeah, not in the spam folder either
0
hieloCommented:
can you post the <form> you are using? The code I gave you above relies on:
a. A <form> with method='post'
b. the method must point to the php file containing the php code above.
c. a field named 'email'
0
dino_angelidesAuthor Commented:
This is the registration page code
<?php require_once('Connections/RealEstateOnlineCy.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
  $MM_dupKeyRedirect="/RealEstateOnline/usernameVerification.php";
  $loginUsername = $_POST['username'];
  $LoginRS__query = sprintf("SELECT username FROM registration WHERE username=%s", GetSQLValueString($loginUsername, "text"));
  mysql_select_db($database_RealEstateOnlineCy, $RealEstateOnlineCy);
  $LoginRS=mysql_query($LoginRS__query, $RealEstateOnlineCy) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);

  //if there is a row in the database, the username was found - can not add the requested username
  if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
    header ("Location: $MM_dupKeyRedirect");
    exit;
  }
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
  
  
  // *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
  $MM_dupKeyRedirect="/RealEstateOnline/emailVerification.php";
  $loginEmail = $_POST['email'];
  $LoginRS__query = sprintf("SELECT email FROM registration WHERE email=%s", GetSQLValueString($loginEmail, "text"));
  mysql_select_db($database_RealEstateOnlineCy, $RealEstateOnlineCy);
  $LoginRS=mysql_query($LoginRS__query, $RealEstateOnlineCy) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);

  //if there is a row in the database, the username was found - can not add the requested username
  if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requseremail=".$loginEmail;
    header ("Location: $MM_dupKeyRedirect");
    exit;
  }
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}     

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registrationForm")) {
  $insertSQL = sprintf("INSERT INTO registration (id, fname, lname, email, address, city, telephone1, telephone2, username, password) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, md5(%s))",
                       GetSQLValueString($_POST['id'], "int"),
                       GetSQLValueString($_POST['fname'], "text"),
                       GetSQLValueString($_POST['lname'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['address'], "text"),
                       GetSQLValueString($_POST['city'], "text"),
                       GetSQLValueString($_POST['telephone1'], "text"),
                       GetSQLValueString($_POST['telephone2'], "text"),
                       GetSQLValueString($_POST['username'], "text"),
                       GetSQLValueString($_POST['password1'], "text"));

  mysql_select_db($database_RealEstateOnlineCy, $RealEstateOnlineCy);
  $Result1 = mysql_query($insertSQL, $RealEstateOnlineCy) or die(mysql_error());

  $insertGoTo = "/RealEstateOnline/regverification.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

?>
<? session_start(); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Template1.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Real Estate Online | Your Source For Cyprus Real Estate</title>
 <script type="text/javascript">
    function checkPass(){
      //Store the password field objects into variables ...
      var password1 = document.getElementById('password1');
      var password2 = document.getElementById('password2');
      //Store the Confimation Message Object ...
      var message = document.getElementById('confirmMessage');
      //Set the colors we will be using ...
      var goodColor = "#66cc66";
      var badColor = "#ff6666";
      //Compare the values in the password field 
      //and the confirmation field
      if(password1.value == password2.value){
        //The passwords match. 
        //Set the color to the good color and inform
        //the user that they have entered the correct password 
        password2.style.backgroundColor = goodColor;
        message.style.color = goodColor;
        message.innerHTML = "Passwords Match!"
      }else{
        //The passwords do not match.
        //Set the color to the bad color and
        //notify the user.
        password2.style.backgroundColor = badColor;
        message.style.color = badColor;
        message.innerHTML = "Passwords Do Not Match!"
      }
    }  
  </script>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
#footer {
	margin-top: 20px;
	width: 1030px;
}
#wrapper {
	background-color: #FFFFFF;
	height: auto;
	width: 1030px;
	margin-right: auto;
	margin-left: auto;
}
#wrapper #TopLogoSearch {
	height: 71px;
	width: 1030px;
}
#wrapper #mainContent {
	height: 800px;
	width: 1029px;
	background-image: url(/RealEstateOnline/images/MainPlaceHolder7.jpg);
}
#wrapper #mainContent #header1 {
	padding-left: 10px;
	padding-top: 10px;
}
#wrapper #mainContent #leftContent {
	padding-top: 20px;
	padding-left: 30px;
	width: 190px;
	height: auto;
}
#wrapper #mainContent #centerContent {
	width: 620px;
	float: right;
	padding-right: 20px;
	padding-top: 10px;
}
#wrapper #mainContent #rightContent {
	float: right;
	height: auto;
	width: 187px;
	padding-top: 10px;
}
#wrapper #mainMenus {
	height: 31px;
	width: 1030px;
	background-image: url(/RealEstateOnline/images/navigationMenuBg.jpg);
}
#wrapper #footerNotes {
	height: 100px;
	width: 1031px;
	background-color: #ededed;
}
#wrapper #footerNotes table tr {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-align: center;
}
#wrapper #mainMenus ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#wrapper #mainMenus ul li {
	display: inline;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	float: left;
	font-style: normal;
	font-weight: normal;
	color: #000;
	padding-top: 8px;
	padding-right: 40pt;
	padding-left: 42pt;
	padding-bottom: 5px;
	margin: 0px;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style2 {
	float: right;
}
#wrapper #separatorNew {
	color: #FFF;
	padding-top: 9px;
}
#wrapper #separatorNew1 {
	padding-top: 9px;
}
#footer ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#footer ul li {
	display: inline;
}
#footer ul li a {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
	text-decoration: none;
}
#footer ul li a:hover {
	color: #333333;
}
.style2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
.style8 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.style13 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
}
#content {	height: 400px;
	width: 598px;
}
.style26 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #2B409C;
}
#wrapper #mainMenus ul li a {
	color: #000;
	text-decoration: none;
}
#wrapper #mainMenus ul li a:hover {
	color: #666;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style2 a {
	color: #000;
	text-decoration: none;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style2 a:hover {
	color: #666;
}
#wrapper #footer table tr td ul li table tr .style2 div a:hover {
	color: #666;
}
#wrapper #footer table tr td ul li table tr .style2 div a:hover {
	color: #666;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style8 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
.style81 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
#wrapper #TopLogoSearch table tr td #form1 table tr td div .style81 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
#wrapper #TopLogoSearch table tr td table tr td table tr td div a {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000;
	text-decoration: underline;
}
#wrapper #footerNotes table tr td a {
	color: #000;
	text-decoration: none;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style21 {	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
#wrapper #mainContent #centerContent #registrationForm .style21 a {
	color: #000;
}
#wrapper #mainContent #centerContent .style8 a {
	color: #000;
	text-decoration: underline;
}
-->
</style>
<script src="/RealEstateOnline/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="/RealEstateOnline/SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
<link href="/RealEstateOnline/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="/RealEstateOnline/SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
</head>

<body>
<!-- ******** BEGIN LIKNO WEB MODAL WINDOWS CODE FOR likno-modal-project ******** -->
<script type="text/javascript">var lwmwLinkedBy="LiknoWebModalWindows [1]",lwmwName="likno-modal-project",lwmwBN="128";lwmwAltUrl="";</script><script charset="UTF-8" src="likno-scripts/likno-modal-project.js" type="text/javascript"></script>
<!-- ******** END LIKNO WEB MODAL WINDOWS CODE FOR likno-modal-project ******** -->

<div id="wrapper">
  <div id="TopLogoSearch">
    <table width="100%" border="0">
      <tr>
        <td width="33%"><table width="100%" border="0">
          <tr>
            <td width="60%" height="61"><img src="/RealEstateOnline/images/logo.jpg" width="179" height="66" border="0" usemap="#Map" /></td>
            <td width="40%"><table width="100%" border="0">
            </table>
              <table width="100%" border="0">
                <tr>
                  <td width="100%"><div align="right" class="style81">
                    <div align="left">
                      <?php 
//header("Expires: Tue, 15 May 2001 10:00:01 GMT");
//header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
//header ("Cache-Control: no-cache, must-revalidate");
//header ("Pragma: no-cache");


$dbHost = "mysql3.namesco.net";
$dbUser = "litewayscom";
$dbPass = "8wpspd47";
$dbName = "db_realestat";
$db = mysql_connect($dbHost,$dbUser,$dbPass);
mysql_select_db($dbName,$db);

if(isset($_POST['submit'])) {
        foreach($_POST as $key=>$value)  {  
        $$key = $value;  
        }
        $query = mysql_query("SELECT * FROM registration WHERE username = '$username' && password = '".md5($password)."'") or die(mysql_error());
        $numrows = mysql_num_rows($query);
        if($numrows <= 0) {
                $errormsg = 'Invalid Username or Password. Please Try Again.';
        } elseif($numrows = 1 && $errormsg == '') {
                $_SESSION['username'] = $username;
        }
}

if(!isset($_SESSION['username'])) {
        echo "<td width='33%'>
        <form id='form1' name='form1' method='post' action='$_SERVER[PHP_SELF]'>         
                <tr> 
                <td colspan='3'>
                <span class='style2'> 
                <div align='right' class='style2'>";
                if($errormsg > '') {
                        echo $errormsg.'<p>';
                }
                echo "
				        <div align='right'><span class='style2'>Not a member yet?</span> <a href='/RealEstateOnline/registration.php'>Register Here</a></div>
                        Username: <input name='username' type='text' id='username' class='style2' value='username' size='15' maxlength='20' /> 
                        Password: <input name='password' type='password' id='password' class='style2' value='password' size='15' maxlength='20' /> 
                        <input type='submit' name='submit' class='style2' id='submit' value='Login' /> 
						
                </div>
                <span class='style2'></span>
                <span class='style2'></span>
                </td>
                </tr>
        </form>";
} else {
        echo "<td width='33%'>
	   	   <tr> 
                <td colspan='3'>
                <span class='style2'> 
                <div align='right' class='style2'>";
	            echo "
			   Welcome <strong>$_SESSION[username].</strong> <a href='logout.php'>Logout</a>
			   <br>
			   <a href='/RealEstateOnline/memberarea.php'><span class='style211'>Member Area</a></span></br>
      </div>
                <span class='style2'></span>
                <span class='style2'></span>
                </td>
                </tr>";
}
echo "</table>"; 
?>
                    </div>
                  </div></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
      </tr>
    </table>
  </div>
  <div id="separatorNew"></div>
  <div id="mainMenus">
    <ul>
      <li> <a href="/RealEstateOnline/index.php">HOME</a></li>
  <li><a href="/RealEstateOnline/buying.php">BUYING</a></li>
       <li><a href="/RealEstateOnline/selling.php">SELLING</a></li>
      <li><a href="/RealEstateOnline/resources.php">RESOURCES</a></li>
      <li></li>
    </ul>
  </div>
  <div id="separatorNew1"> </div>
  <!-- InstanceBeginEditable name="MainContentEdit" -->
  <div id="mainContent">
    <div id="header1"><img src="images/RegistrationHeader.jpg" alt="" width="1010" height="58" /></div>
    <div id="rightContent"><br />
      <br />
      <br />
      <br />
      <br />
      <br />
    </div>
    <div id="centerContent"><span class="style8"><strong>Important Note:</strong> You can login to your account using the login section on the top of the page<br />
      Once you are logged in you can browse to your <a href="/RealEstateOnline/memberarea.php">Member Area <br />
      </a><br /> 
      If you do not have an account with <strong>Real Estate Online</strong>, please fill in the form below to create your account <br />
<br />
<strong>ALL FIELDS ARE REQUIRED</strong><br />
    </span>
      <form action="<?php echo $editFormAction; ?>" id="registrationForm" name="registrationForm" method="POST">
        <table width="100%" border="0">
          <tr>
            <td class="style8"><input type="hidden" name="id" id="id" /></td>
            <td class="style21">&nbsp;</td>
          </tr>
          <tr>
            <td width="21%" class="style8"><strong>First Name:</strong></td>
            <td class="style21"><span id="sprytextfield1">
              <label>
                <input name="fname" type="text" id="fname" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your First Name.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Last Name:</strong></td>
            <td class="style21"><span id="sprytextfield2">
              <label>
                <input name="lname" type="text" id="lname" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your Last Name.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Email:</strong></td>
            <td class="style21"><span id="sprytextfield3">
            <label>
              <input name="email" type="text" id="email" size="30" maxlength="30" />
            </label>
            <span class="textfieldRequiredMsg">Please Enter Your Email.</span><span class="textfieldInvalidFormatMsg">Please Re-Enter Your Email.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Address:</strong></td>
            <td class="style21"><span id="sprytextfield4">
              <label>
                <input name="address" type="text" id="address" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your Address.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>City:</strong></td>
            <td class="style21"><span id="sprytextfield5">
              <label>
                <input name="city" type="text" id="city" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your City.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Telephone 1:</strong></td>
            <td class="style21"><span id="sprytextfield6">
              <label>
                <input type="text" name="telephone1" id="telephone1" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter a Telephone Number.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Telephone 2:</strong></td>
            <td class="style21"><span id="sprytextfield7">
              <label>
                <input type="text" name="telephone2" id="telephone2" />
                <span id="sprytextfield8"> <span class="textfieldRequiredMsg">Please Enter a Telephone Number.</span></span></label>
            </span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Username:</strong></td>
            <td class="style21"><span id="sprytextfield9">
              <label>
                <input type="text" name="username" id="username" />
              </label>
            <span class="textfieldRequiredMsg">Please Choose a Username.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Password:</strong></td>
            <td class="style21"><span id="sprypassword1">
              <label>
                <input type="password" name="password1" id="password1" />
              </label>
            <span class="passwordRequiredMsg">Please Enter Your Password.</span><span class="passwordMinCharsMsg">Your Password Must Be at Least 6 Characters.</span><span class="passwordMaxCharsMsg">Your Password Must Be 10 Characters Long.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Verify Password:</strong></td>
            <td class="style21"><label><span id="sprypassword2">
              <input type="password" name="password2" id="password2"  onkeyup="checkPass(); return false;" />
               <span id="confirmMessage" class="confirmMessage"></span>
            <span class="passwordRequiredMsg">Please Enter Your Password.</span><span class="passwordMinCharsMsg">Your Password Must Be at Least 6 Characters.</span><span class="passwordMaxCharsMsg">Your Password Must Be 10 Characters Long.</span></span>            </label></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><span class="style21">
<?php
//echo $errormsg;
?>
              <?php
//echo $successmsg;
?>
            </span></td>
          </tr>
          <tr>
            <td><label>
              <input type="submit" name="register" id="register" value="Register" />   
            </label></td>
            <td>&nbsp;</td>
          </tr>
        </table>
<span class="style21"><br />
          By registering you are accepting our Terms of Use. If you haven't reviewed them yet, please do so by <a href="/RealEstateOnline/terms.php" target="_blank">clicking here</a><br />
        </span>
<input type="hidden" name="MM_insert" value="registrationForm" />
      </form>
      <span class="style8"><br />
<br />
    </span></div>
    <div class="style8" id="leftContent"><img src="/RealEstateOnline/images/profileIcon1.jpg" alt="" width="142" height="120" /></div>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <br />
  </div>
  <script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1", {minChars:6, maxChars:10, validateOn:["blur", "change"]});
var sprypassword2 = new Spry.Widget.ValidationPassword("sprypassword2", {minChars:6, maxChars:10, validateOn:["blur", "change"]});
//-->
  </script>
  <!-- InstanceEndEditable -->
  
</div>

</body>
<!-- InstanceEnd --></html>

Open in new window

0
hieloCommented:

<?php require_once('Connections/RealEstateOnlineCy.php'); ?>
<?php 
error_reporting(E_ALL);

// SEND MAIL FROM A FORM

// A FUNCTION TO CLEAN UP THE DATA - AVOID BECOMING AN OPEN-RELAY FOR SPAM
function clean_string($str)
{
    $str = stripslashes($str);
    $str = trim(preg_replace("/ +/", " ", $str));
    $str = preg_replace('/^ a-zA-Z0-9&+:?_\.\-/', '', $str);
    return $str;
}


// IF THE DATA HAS BEEN POSTED
if (isset($_POST['email']) && !empty($_POST['email']))
{
	// REQUIRED VALUES ARE PREPOPULATED - CHANGE THESE FOR YOUR TEST
	$to  = clean_string($_POST['email']);
	$from  = "noreply@liteways.com";
	$subj  = "RealEstateOnline Registration";

	// CLEAN UP THE POTENTIALLY BAD AND DANGEROUS DATA
	$fname         = clean_string($_POST["fname"]);
	$lname         = clean_string($_POST["lname"]);
	$email         = clean_string($_POST["email"]);
	$address       = clean_string($_POST["address"]);
	$city          = clean_string($_POST["city"]);
	$telephone1    = clean_string($_POST["telephone1"]);
	$telephone2    = clean_string($_POST["telephone2"]);
	$username      = clean_string($_POST["username"]);
	$password1     = clean_string($_POST["password1"]);
	$password2     = clean_string($_POST["password2"]);

	// CONSTRUCT THE MESSAGE
	$content ='';
	$content   .= "Test Registration Email\n\n";
	$content   .= "Thank You\n\n";
	$content   .= "Real Estate Online\n\n";
        
    mail( $to, $subj, $content, "To:$to\r\nFrom: $from\r\n");


	// To Admin
	$to1    = "info@dinoangelides.com";
	$from1  = "noreply@liteways.com";
	$subj1  = "RealEstateOnline - Member Registration";

	// CONSTRUCT THE MESSAGE
	$message    = '';
	$message   .= "There is a new registration from $name \n\n";

	// SEND MAIL
    mail( $to1, $subj1, $message, "To:$to1\r\nFrom: $from1\r\n");

}
?>

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
  $MM_dupKeyRedirect="/RealEstateOnline/usernameVerification.php";
  $loginUsername = $_POST['username'];
  $LoginRS__query = sprintf("SELECT username FROM registration WHERE username=%s", GetSQLValueString($loginUsername, "text"));
  mysql_select_db($database_RealEstateOnlineCy, $RealEstateOnlineCy);
  $LoginRS=mysql_query($LoginRS__query, $RealEstateOnlineCy) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);

  //if there is a row in the database, the username was found - can not add the requested username
  if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
    header ("Location: $MM_dupKeyRedirect");
    exit;
  }
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
  
  
  // *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
  $MM_dupKeyRedirect="/RealEstateOnline/emailVerification.php";
  $loginEmail = $_POST['email'];
  $LoginRS__query = sprintf("SELECT email FROM registration WHERE email=%s", GetSQLValueString($loginEmail, "text"));
  mysql_select_db($database_RealEstateOnlineCy, $RealEstateOnlineCy);
  $LoginRS=mysql_query($LoginRS__query, $RealEstateOnlineCy) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);

  //if there is a row in the database, the username was found - can not add the requested username
  if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requseremail=".$loginEmail;
    header ("Location: $MM_dupKeyRedirect");
    exit;
  }
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}     

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registrationForm")) {
  $insertSQL = sprintf("INSERT INTO registration (id, fname, lname, email, address, city, telephone1, telephone2, username, password) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, md5(%s))",
                       GetSQLValueString($_POST['id'], "int"),
                       GetSQLValueString($_POST['fname'], "text"),
                       GetSQLValueString($_POST['lname'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['address'], "text"),
                       GetSQLValueString($_POST['city'], "text"),
                       GetSQLValueString($_POST['telephone1'], "text"),
                       GetSQLValueString($_POST['telephone2'], "text"),
                       GetSQLValueString($_POST['username'], "text"),
                       GetSQLValueString($_POST['password1'], "text"));

  mysql_select_db($database_RealEstateOnlineCy, $RealEstateOnlineCy);
  $Result1 = mysql_query($insertSQL, $RealEstateOnlineCy) or die(mysql_error());

  $insertGoTo = "/RealEstateOnline/regverification.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

?>
<? session_start(); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Template1.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Real Estate Online | Your Source For Cyprus Real Estate</title>
 <script type="text/javascript">
    function checkPass(){
      //Store the password field objects into variables ...
      var password1 = document.getElementById('password1');
      var password2 = document.getElementById('password2');
      //Store the Confimation Message Object ...
      var message = document.getElementById('confirmMessage');
      //Set the colors we will be using ...
      var goodColor = "#66cc66";
      var badColor = "#ff6666";
      //Compare the values in the password field 
      //and the confirmation field
      if(password1.value == password2.value){
        //The passwords match. 
        //Set the color to the good color and inform
        //the user that they have entered the correct password 
        password2.style.backgroundColor = goodColor;
        message.style.color = goodColor;
        message.innerHTML = "Passwords Match!"
      }else{
        //The passwords do not match.
        //Set the color to the bad color and
        //notify the user.
        password2.style.backgroundColor = badColor;
        message.style.color = badColor;
        message.innerHTML = "Passwords Do Not Match!"
      }
    }  
  </script>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
#footer {
	margin-top: 20px;
	width: 1030px;
}
#wrapper {
	background-color: #FFFFFF;
	height: auto;
	width: 1030px;
	margin-right: auto;
	margin-left: auto;
}
#wrapper #TopLogoSearch {
	height: 71px;
	width: 1030px;
}
#wrapper #mainContent {
	height: 800px;
	width: 1029px;
	background-image: url(/RealEstateOnline/images/MainPlaceHolder7.jpg);
}
#wrapper #mainContent #header1 {
	padding-left: 10px;
	padding-top: 10px;
}
#wrapper #mainContent #leftContent {
	padding-top: 20px;
	padding-left: 30px;
	width: 190px;
	height: auto;
}
#wrapper #mainContent #centerContent {
	width: 620px;
	float: right;
	padding-right: 20px;
	padding-top: 10px;
}
#wrapper #mainContent #rightContent {
	float: right;
	height: auto;
	width: 187px;
	padding-top: 10px;
}
#wrapper #mainMenus {
	height: 31px;
	width: 1030px;
	background-image: url(/RealEstateOnline/images/navigationMenuBg.jpg);
}
#wrapper #footerNotes {
	height: 100px;
	width: 1031px;
	background-color: #ededed;
}
#wrapper #footerNotes table tr {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-align: center;
}
#wrapper #mainMenus ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#wrapper #mainMenus ul li {
	display: inline;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	float: left;
	font-style: normal;
	font-weight: normal;
	color: #000;
	padding-top: 8px;
	padding-right: 40pt;
	padding-left: 42pt;
	padding-bottom: 5px;
	margin: 0px;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style2 {
	float: right;
}
#wrapper #separatorNew {
	color: #FFF;
	padding-top: 9px;
}
#wrapper #separatorNew1 {
	padding-top: 9px;
}
#footer ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#footer ul li {
	display: inline;
}
#footer ul li a {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
	text-decoration: none;
}
#footer ul li a:hover {
	color: #333333;
}
.style2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
.style8 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.style13 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
}
#content {	height: 400px;
	width: 598px;
}
.style26 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #2B409C;
}
#wrapper #mainMenus ul li a {
	color: #000;
	text-decoration: none;
}
#wrapper #mainMenus ul li a:hover {
	color: #666;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style2 a {
	color: #000;
	text-decoration: none;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style2 a:hover {
	color: #666;
}
#wrapper #footer table tr td ul li table tr .style2 div a:hover {
	color: #666;
}
#wrapper #footer table tr td ul li table tr .style2 div a:hover {
	color: #666;
}
#wrapper #TopLogoSearch table tr td #form1 table tr td .style8 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
.style81 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
#wrapper #TopLogoSearch table tr td #form1 table tr td div .style81 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
#wrapper #TopLogoSearch table tr td table tr td table tr td div a {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000;
	text-decoration: underline;
}
#wrapper #footerNotes table tr td a {
	color: #000;
	text-decoration: none;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style21 {	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
#wrapper #mainContent #centerContent #registrationForm .style21 a {
	color: #000;
}
#wrapper #mainContent #centerContent .style8 a {
	color: #000;
	text-decoration: underline;
}
-->
</style>
<script src="/RealEstateOnline/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="/RealEstateOnline/SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
<link href="/RealEstateOnline/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="/RealEstateOnline/SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
</head>

<body>
<!-- ******** BEGIN LIKNO WEB MODAL WINDOWS CODE FOR likno-modal-project ******** -->
<script type="text/javascript">var lwmwLinkedBy="LiknoWebModalWindows [1]",lwmwName="likno-modal-project",lwmwBN="128";lwmwAltUrl="";</script><script charset="UTF-8" src="likno-scripts/likno-modal-project.js" type="text/javascript"></script>
<!-- ******** END LIKNO WEB MODAL WINDOWS CODE FOR likno-modal-project ******** -->

<div id="wrapper">
  <div id="TopLogoSearch">
    <table width="100%" border="0">
      <tr>
        <td width="33%"><table width="100%" border="0">
          <tr>
            <td width="60%" height="61"><img src="/RealEstateOnline/images/logo.jpg" width="179" height="66" border="0" usemap="#Map" /></td>
            <td width="40%"><table width="100%" border="0">
            </table>
              <table width="100%" border="0">
                <tr>
                  <td width="100%"><div align="right" class="style81">
                    <div align="left">
                      <?php 
//header("Expires: Tue, 15 May 2001 10:00:01 GMT");
//header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
//header ("Cache-Control: no-cache, must-revalidate");
//header ("Pragma: no-cache");


$dbHost = "mysql3.namesco.net";
$dbUser = "litewayscom";
$dbPass = "8wpspd47";
$dbName = "db_realestat";
$db = mysql_connect($dbHost,$dbUser,$dbPass);
mysql_select_db($dbName,$db);

if(isset($_POST['submit'])) {
        foreach($_POST as $key=>$value)  {  
        $$key = $value;  
        }
        $query = mysql_query("SELECT * FROM registration WHERE username = '$username' && password = '".md5($password)."'") or die(mysql_error());
        $numrows = mysql_num_rows($query);
        if($numrows <= 0) {
                $errormsg = 'Invalid Username or Password. Please Try Again.';
        } elseif($numrows = 1 && $errormsg == '') {
                $_SESSION['username'] = $username;
        }
}

if(!isset($_SESSION['username'])) {
        echo "<td width='33%'>
        <form id='form1' name='form1' method='post' action='$_SERVER[PHP_SELF]'>         
                <tr> 
                <td colspan='3'>
                <span class='style2'> 
                <div align='right' class='style2'>";
                if($errormsg > '') {
                        echo $errormsg.'<p>';
                }
                echo "
				        <div align='right'><span class='style2'>Not a member yet?</span> <a href='/RealEstateOnline/registration.php'>Register Here</a></div>
                        Username: <input name='username' type='text' id='username' class='style2' value='username' size='15' maxlength='20' /> 
                        Password: <input name='password' type='password' id='password' class='style2' value='password' size='15' maxlength='20' /> 
                        <input type='submit' name='submit' class='style2' id='submit' value='Login' /> 
						
                </div>
                <span class='style2'></span>
                <span class='style2'></span>
                </td>
                </tr>
        </form>";
} else {
        echo "<td width='33%'>
	   	   <tr> 
                <td colspan='3'>
                <span class='style2'> 
                <div align='right' class='style2'>";
	            echo "
			   Welcome <strong>$_SESSION[username].</strong> <a href='logout.php'>Logout</a>
			   <br>
			   <a href='/RealEstateOnline/memberarea.php'><span class='style211'>Member Area</a></span></br>
      </div>
                <span class='style2'></span>
                <span class='style2'></span>
                </td>
                </tr>";
}
echo "</table>"; 
?>
                    </div>
                  </div></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
      </tr>
    </table>
  </div>
  <div id="separatorNew"></div>
  <div id="mainMenus">
    <ul>
      <li> <a href="/RealEstateOnline/index.php">HOME</a></li>
  <li><a href="/RealEstateOnline/buying.php">BUYING</a></li>
       <li><a href="/RealEstateOnline/selling.php">SELLING</a></li>
      <li><a href="/RealEstateOnline/resources.php">RESOURCES</a></li>
      <li></li>
    </ul>
  </div>
  <div id="separatorNew1"> </div>
  <!-- InstanceBeginEditable name="MainContentEdit" -->
  <div id="mainContent">
    <div id="header1"><img src="images/RegistrationHeader.jpg" alt="" width="1010" height="58" /></div>
    <div id="rightContent"><br />
      <br />
      <br />
      <br />
      <br />
      <br />
    </div>
    <div id="centerContent"><span class="style8"><strong>Important Note:</strong> You can login to your account using the login section on the top of the page<br />
      Once you are logged in you can browse to your <a href="/RealEstateOnline/memberarea.php">Member Area <br />
      </a><br /> 
      If you do not have an account with <strong>Real Estate Online</strong>, please fill in the form below to create your account <br />
<br />
<strong>ALL FIELDS ARE REQUIRED</strong><br />
    </span>
      <form action="<?php echo $editFormAction; ?>" id="registrationForm" name="registrationForm" method="POST">
        <table width="100%" border="0">
          <tr>
            <td class="style8"><input type="hidden" name="id" id="id" /></td>
            <td class="style21">&nbsp;</td>
          </tr>
          <tr>
            <td width="21%" class="style8"><strong>First Name:</strong></td>
            <td class="style21"><span id="sprytextfield1">
              <label>
                <input name="fname" type="text" id="fname" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your First Name.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Last Name:</strong></td>
            <td class="style21"><span id="sprytextfield2">
              <label>
                <input name="lname" type="text" id="lname" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your Last Name.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Email:</strong></td>
            <td class="style21"><span id="sprytextfield3">
            <label>
              <input name="email" type="text" id="email" size="30" maxlength="30" />
            </label>
            <span class="textfieldRequiredMsg">Please Enter Your Email.</span><span class="textfieldInvalidFormatMsg">Please Re-Enter Your Email.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Address:</strong></td>
            <td class="style21"><span id="sprytextfield4">
              <label>
                <input name="address" type="text" id="address" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your Address.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>City:</strong></td>
            <td class="style21"><span id="sprytextfield5">
              <label>
                <input name="city" type="text" id="city" size="30" maxlength="30" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter Your City.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Telephone 1:</strong></td>
            <td class="style21"><span id="sprytextfield6">
              <label>
                <input type="text" name="telephone1" id="telephone1" />
              </label>
            <span class="textfieldRequiredMsg">Please Enter a Telephone Number.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Telephone 2:</strong></td>
            <td class="style21"><span id="sprytextfield7">
              <label>
                <input type="text" name="telephone2" id="telephone2" />
                <span id="sprytextfield8"> <span class="textfieldRequiredMsg">Please Enter a Telephone Number.</span></span></label>
            </span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Username:</strong></td>
            <td class="style21"><span id="sprytextfield9">
              <label>
                <input type="text" name="username" id="username" />
              </label>
            <span class="textfieldRequiredMsg">Please Choose a Username.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Password:</strong></td>
            <td class="style21"><span id="sprypassword1">
              <label>
                <input type="password" name="password1" id="password1" />
              </label>
            <span class="passwordRequiredMsg">Please Enter Your Password.</span><span class="passwordMinCharsMsg">Your Password Must Be at Least 6 Characters.</span><span class="passwordMaxCharsMsg">Your Password Must Be 10 Characters Long.</span></span></td>
          </tr>
          <tr>
            <td class="style8"><strong>Verify Password:</strong></td>
            <td class="style21"><label><span id="sprypassword2">
              <input type="password" name="password2" id="password2"  onkeyup="checkPass(); return false;" />
               <span id="confirmMessage" class="confirmMessage"></span>
            <span class="passwordRequiredMsg">Please Enter Your Password.</span><span class="passwordMinCharsMsg">Your Password Must Be at Least 6 Characters.</span><span class="passwordMaxCharsMsg">Your Password Must Be 10 Characters Long.</span></span>            </label></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><span class="style21">
<?php
//echo $errormsg;
?>
              <?php
//echo $successmsg;
?>
            </span></td>
          </tr>
          <tr>
            <td><label>
              <input type="submit" name="register" id="register" value="Register" />   
            </label></td>
            <td>&nbsp;</td>
          </tr>
        </table>
<span class="style21"><br />
          By registering you are accepting our Terms of Use. If you haven't reviewed them yet, please do so by <a href="/RealEstateOnline/terms.php" target="_blank">clicking here</a><br />
        </span>
<input type="hidden" name="MM_insert" value="registrationForm" />
      </form>
      <span class="style8"><br />
<br />
    </span></div>
    <div class="style8" id="leftContent"><img src="/RealEstateOnline/images/profileIcon1.jpg" alt="" width="142" height="120" /></div>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <br />
  </div>
  <script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1", {minChars:6, maxChars:10, validateOn:["blur", "change"]});
var sprypassword2 = new Spry.Widget.ValidationPassword("sprypassword2", {minChars:6, maxChars:10, validateOn:["blur", "change"]});
//-->
  </script>
  <!-- InstanceEndEditable -->
  
</div>

</body>
<!-- InstanceEnd --></html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.