Location: PHPKode > projects > Pointter PHP CMS > pointtercms_package/pointtercms_package/pointtercms/accountsubmit.php
<?php 

/***************************************************************************
 * Product Name			: Pointter PHP Content Management System
 * Version 			: V 1.2
 * Release Date			: 01/02/11
 * Copyright			: (C) 2011 PangramSoft / Murat Cevik
 * Program URL			: http://www.pointter.com
 * Company URL			: http://www.pangramsoft.com
 * Email Address                : hide@address.com
 
 ***************************************************************************/
 

/****************************************************************************

Pointter PHP Content Management System is licensed under Creative Commons Attribution Non-commercial No Derivatives 3.0 Unported (by-nc-nd) License.
To view a copy of this license, (a) visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or (b) send a letter to Creative Commons, 171 2nd Street, 
Suite 300, San Francisco, California, 94105, USA.” 

You must not remove/modify/alter the copyright informations both visible and invisible forms in the source code and you must not remove/modify/alter 
the copyright informations in the footer part of the script including the Pointter image (png format file), hard link and title tag.

Please contact the copyright holder PangramSoft / Murat Cevik for a commercial license to remove the copyright information in the footer part of the script.


*****************************************************************************/

if (isset($_COOKIE[tuser]) OR isset($_COOKIE[tpass]))
header("location:index.php");

include 'includes/settings_ini.php';
include 'includes/seo.php';

if ($member_onoff==0)
header ("location:index.php");

include 'configset/conn.php';

//Get Number Of Views
$prev=mysql_query("SELECT * FROM Views WHERE Url='accountsubmit.php'");
$prev_data=mysql_fetch_array($prev);
$current=$prev_data[Number] + 1;

//Record New Number Of Views
mysql_query("UPDATE Views SET Number='$current' WHERE Url='accountsubmit.php'");

//Get Total Number Of Views

$view_query=mysql_query("SELECT sum(Number) As TotalView FROM Views");
$tot_data=mysql_fetch_array($view_query);
$totalview=$tot_data[TotalView];


mysql_close($connect);

//Get IP Address And Log Date

$ip=$_SERVER['REMOTE_ADDR']; 
$today=date("m.d.y"); 

//Encode UTF-8 Characters Correctly 

$firstname=htmlentities($_POST[firstname],ENT_NOQUOTES,'UTF-8');
$firstname=stripslashes($firstname);

$lastname=htmlentities($_POST[lastname],ENT_NOQUOTES,'UTF-8');
$lastname=stripslashes($lastname);

$city=htmlentities($_POST[city],ENT_NOQUOTES,'UTF-8');
$city=stripslashes($city);

$emailaddress=htmlentities($_POST[emailaddress]);
$password=htmlentities($_POST[password]);
$repassword=htmlentities($_POST[repassword]);
$country=$_POST[country];

$check=$_POST[check];
$news=$_POST[news];

//Formatting And Capitalizing Caharacters

$firstname=strtolower($firstname);
$lastname=strtolower($lastname);
$city=strtolower($city);
$emailaddress=strtolower($emailaddress);
$password=strtolower($password);
$repassword=strtolower($repassword);

$firstname=ucwords($firstname);
$lastname=ucwords($lastname);
$city=ucwords($city);

$passnum=strlen($password);
$repassnum=strlen($repassword);

//Control Informations

$validpassword="^[a-z0-9]+$";
$validrepassword="^[a-z0-9]+$";

$i=0;

if (strlen($firstname)<3)
{
$error_message[$i]="Your First Name Can Not Be Shorter Than 3 Characters!";
$i++;
}

if (strlen($lastname)<3)
{
$error_message[$i]="Your Last Name Can Not Be Shorter Than 3 Characters!";
$i++;
}

if (strlen($city)<3)
{
$error_message[$i]="Your City Can Not Be Shorter Than 3 Characters!";
$i++;
}

if(!filter_var($emailaddress, FILTER_VALIDATE_EMAIL))
{
$error_message[$i]="Your Email Address Is Not Valid, Please Write In Correct Form!";
$i++;
}

if (!eregi($validpassword,$password))
{
$error_message[$i]="Your Password Is Not Valid, Please Use Only Letters And Numbers!";
$i++;
}

if (!eregi($validrepassword,$repassword))
{
$error_message[$i]="Your Re-Password Is Not Valid, Please Use Only Letters And Numbers!";
$i++;
}

if ($passnum<8)
{
$error_message[$i]="Your Password Must Be 8 Characters!";
$i++;
}

if ($repassnum<8)
{
$error_message[$i]="Your Re-Password Must Be 8 Characters!";
$i++;
}


if ($password!=$repassword)
{
$error_message[$i]="Your Password And Re-Password Do Not Match, Please Write Carefully!";
$i++;
}

//Database connection

include 'configset/conn.php';

//Mysql Injection Control

$firstname=mysql_real_escape_string($firstname);
$lastname=mysql_real_escape_string($lastname);
$city=mysql_real_escape_string($city);
$emailaddress=mysql_real_escape_string($emailaddress);
$password=mysql_real_escape_string($password);


//If Account Email Is Already Taken

$emailcontrol=mysql_query("SELECT EmailAddress From Members WHERE EmailAddress='$emailaddress'");
$row=mysql_numrows($emailcontrol);

mysql_close($connect);

if ($row==1)
{
$error_message[$i]="There Is Already An Account Created With This Email Address!";
$i++;
}


if ($check!="agree")
{
$error_message[$i]="You Have To Accept Terms Of Service And Privacy Policy!";
$i++;
}

if ($news=="agree")
$news_check=1;
else
$news_check=0;

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!--This website has been created by Pointter PHP Content Management System and copyrighted by PangramSoft / Murat Cevik. 
    Please visit http://www.pointter.com for a FREE DOWNLOAD.--> 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="javascript/clock.js"></script>
<script type="text/javascript" src="javascript/toggle.js"></script>
<link type="text/css" rel="stylesheet" href="clock.css"/>
<link type="text/css" rel="stylesheet" href="body.css"/>
<link type="text/css" rel="stylesheet" href="style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"/>
<meta name="description" content="<?php echo $desc; ?>"/>
<meta name="keywords" content="<?php echo $meta; ?>"/>
<title><?php echo $title; ?></title>
</head>

<body onload="clock(),slide()">

<!--This Is The Main Table--> 

<table class="main" width="1030" align="center" cellspacing="0" cellpadding="0">

<!--This Is The Header Part--> 

<tr><td width="1030" colspan="3" align="center">
<?php
include 'header.php';
include 'includes/search.php';
?>
</td></tr><tr>

<!--This Is The Left Column-->

<td width="215" valign="top" align="left">
<?php
include 'includes/column_left.php';
?>
</td>

<!--This Is The Middle Column-->

<td width="600" valign="top" align="center">

<table cellpadding="10" style="background-image:url(pixel_3.png);width:580px;" align="center"><tr><td style="background-image:url(pixel_1.png);" class="header" align="left"><b>Create An Account Confirmation</b></td></tr>
<tr><td align="left">


<?php

include 'configset/conn.php';

//If There Are Some Errors

if (count($error_message)>0)

{

for ($z=0;$z<$i;$z++)
{
echo '<img src="siteicons/caution.png" align="left" alt="caution icon"/>&ensp;<font size="1">'." ".$error_message[$z].'</font><br/><br/>';
}
echo '</td></tr><tr><td align="center">Please Go Back And Change Your Details!';
}

//If There Are No Errors

if (count($error_message)==0)

{
echo '<img src="siteicons/success.png" align="left" alt="success icon"/>&ensp;<font size="1">'."Your Account Is Created And An Email Is Sent To Your Email Address!";

echo '<br/><br/>'."First Name:".''." ".$firstname.'<br/><br/>';
echo "Last Name:"." ".$lastname;
echo '<br/><br/>'."Country:"." ".$country.'<br/><br/>';
echo "City:"." ".$city.'<br/><br/>';
echo "Email:"." ".$emailaddress.'<br/><br/>';
echo "Password:"." ".$password.'</font><br/><br/>';

$encryptpass=md5($password);
$id=md5($emailaddress);

mysql_query("INSERT INTO Members (FirstName, LastName, EmailAddress, Password, City, Country, IP, LogDate,News,ID)VALUES ('$firstname','$lastname','$emailaddress','$encryptpass','$city','$country','$ip','$today','$news_check','$id')");

//Send Email For Account Confirmation

$s_web="http://".$_SERVER[HTTP_HOST];
$message="Please activate your account by running this link:"."\n\n"; 
$message.=$s_web.'/confirmaccount.php?code='.$encryptpass.'&id='.$id."\n\n";


$headers = 'From:'.$s_mail."\n" .
    'Reply-To:'.$s_mail."\n" .
    'X-Mailer: PHP/' . phpversion();

mail ($emailaddress,'New Account Confirmation',$message,$headers);

}
mysql_close($connect);

?>


</td></tr></table>

</td>

<!--This Is The Right Column--> 

<td width="215" valign="top" align="right">

<?php
include 'includes/column_right.php';
?>
</td>


<!--This Is The Footer Part-->

</tr><tr><td width="1030" colspan="3" align="center">
<?php
include 'footer.php';
?>
</td></tr>

<!--End Of Table-->

</table>

<table style="color:#272727;font-family:'Helvetica';font-size:8pt;border-width:1px;border-style:solid;border-top-style:none;border-color:#023f6a;width:1030px;height:30px;" align="center" cellspacing="0" cellpadding="5"><tr><td align="right">
<?php echo "Copyright".'&ensp;'."©".'&ensp;'.date(Y).'&ensp;'."PangramSoft"; ?><a href="http://www.pointter.com" title="Pointter PHP Content Management System"><img src="siteicons/pointter_icon.png" border="0" align="right" alt="pointter icon"/></a></td></tr></table>

</body>
</html>
Return current item: Pointter PHP CMS