require_once("conn.php");
require_once("includes.php");
if(isset($_POST[s1]))
{
$MyExp = mktime(0,0,0,date(m) + 1, date(d), date(Y));
if($aset[Sitefee]=="1")
{
$q1 = "insert into yellow_agents set
username = '$_POST[NewUsername]',
password = '$_POST[p1]',
FirstName = '$_POST[FirstName]',
LastName = '$_POST[LastName]',
address = '$_POST[address]',
city = '$_POST[city]',
state = '$_POST[state]',
zipcode='$_POST[zip]',
country = '$_POST[country]',
phone = '$_POST[phone]',
cellular = '$_POST[cellular]',
pager = '$_POST[pager]',
email = '$_POST[email]',
RegDate = '$t',
AccountStatus='active',
ExpDate = '$MyExp' ";
}
else
{
$q1 = "insert into yellow_agents set
username = '$_POST[NewUsername]',
password = '$_POST[p1]',
FirstName = '$_POST[FirstName]',
LastName = '$_POST[LastName]',
address = '$_POST[address]',
city = '$_POST[city]',
state = '$_POST[state]',
zipcode='$_POST[zip]',
country = '$_POST[country]',
phone = '$_POST[phone]',
cellular = '$_POST[cellular]',
pager = '$_POST[pager]',
email = '$_POST[email]',
RegDate = '$t',
AccountStatus='pending',
ExpDate = '$MyExp' ";
}
mysql_query($q1);
if(ereg("key 2", mysql_error()))
{
$error = "The username $_POST[NewUsername] is already in use!
Select another one, please!";
//session_register("regtype");
unset($_POST[NewUsername]);
}
elseif(ereg("key 3", mysql_error()))
{
$error = "You are already registered!
Update your account, please!";
unset($_POST);
}
else
{
$last = mysql_insert_id();
$_SESSION[NewAgent] = $last;
//send an email
$to = $_POST[email];
$subject = "Your registration at $_SERVER[HTTP_HOST]";
$message = "Hello $_POST[FirstName] $_POST[LastName],\nhere is your login information for $_SERVER[HTTP_HOST]\n\nUsername: $_POST[NewUsername]\nPassword: $_POST[p1]\n\nTo login, follow this link:\nhttp://$_SERVER[HTTP_HOST]/login.php\n\nThank you for your registration!";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_SERVER[HTTP_POST] <$aset[ContactEmail]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
mail($to, $subject, $message, $headers);
if($aset[Sitefee]=="1")
{
header("location:login.php");
exit();
}
else
{
// header("location:login.php");
header("location:prices.php");
exit();
}
}
}
//get the templates
require_once("templates/HeaderTemplate.php");
require_once("templates/RegistrationTemplate.php");
require_once("templates/FooterTemplate.php");
?>