Hi,
I'm hoping someone could help me with the following error.
I have no idea what I'm doing wrong. I'm getting :
Parse error: parse error in /home/aingaran/public_html/clients/signup.php on line 170
Here's the code.
<?
session_start();
require ("inc/config.php");
if (!$submit)
{
include ("html/$style/signup.php");
}
else
{
if (!$_POST[fname] OR !$_POST[lname] OR !$_POST[phone] OR !$_POST[address1] OR !$_POST[city] OR !$_POST[state] OR !$_POST[zip] OR !$_POST[country] OR !$_POST[email] OR !$_POST[domain] OR !$_POST[username] OR !$_POST[password] OR !$_POST[password2] OR !$_POST[question] OR !$_POST[answer])
{
include ("html/$style/errors/missing_fields.php");
include ("html/$style/signup.php");
}
elseif ($_POST[password] != $_POST[password2])
{
include ("html/$style/errors/password_mismatch.php");
include ("html/$style/signup.php");
}
elseif (!ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$",$_POST[email]))
{
include ("html/$style/errors/invalid_email.php");
include ("html/$style/signup.php");
}
elseif ($_POST[country] == "--")
{
include ("html/$style/errors/missing_country.php");
include ("html/$style/signup.php");
}
else
{
$q0 = "SELECT * FROM accounts WHERE username='$_POST[username]'";
$r0 = mysql_query($q0) or die (mysql_error());
if(mysql_num_rows($r0) != 0)
{
include ("html/$style/errors/username_taken.php");
include ("html/$style/signup.php");
}
else
{
$q1 = "SELECT * FROM users WHERE email='$_POST[email]'";
$r1 = mysql_query($q1);
if(mysql_num_rows($r1) != 0)
{
include ("html/$style/errors/account_exist.php");
}
else
{
$date = time() + 7200;
$status = "pending";
$password = md5($_POST[password]);
$answer = md5($_POST[answer]);
$notes = nl2br($_POST[notes]);
$ip = $_SERVER[REMOTE_ADDR];
$q2 = "INSERT INTO users (company, fname, lname, address1, address2, city, state, zip, country, phone, fax, aim, icq, msn, yim, email, email2, password, question, answer, payment, date, referrer, ip, notes, status) VALUES ('$_POST[company]', '$_POST[fname]', '$_POST[lname]', '$_POST[address1]', '$_POST[address2]', '$_POST[city]', '$_POST[state]', '$_POST[zip]', '$_POST[country]', '$_POST[phone]', '$_POST[fax]', '$_POST[aim]', '$_POST[icq]', '$_POST[msn]', '$_POST[yim]', '$_POST[email]', '$_POST[email2]', '$password, '$_POST[question]', '$answer', '$_POST[payment]', '$date', '$_POST[referrer]', '$_POST[ip]', '$notes', '$status')";
$r2 = mysql_query($q2);
if (!$r2)
{
echo "Database Error";
}
else
{
$q3 = "SELECT * FROM plans WHERE plan = '$_POST[package]'";
$r3 = mysql_query($q3);
$plan = mysql_fetch_array($r3);
if ($_POST[cycle] == "Annually")
{
$price = $plan[annually];
}
elseif ($_POST[cycle] == "Semi-Annually")
{
$price = $plan[semi];
}
elseif ($_POST[cycle] == "Quarterly")
{
$price = $plan[quarterly];
}
else
{
$price = $plan[monthly];
}
if ($_POST[country] = $global[country])
{
$tax = 1 + ($global[tax]);
}
else
{
$tax = 1 + 0;
}
$amount = $price * $tax;
$setup = $setup * $tax;
$total = $amount + $setup;
$amount = sprintf("%.2f", $amount);
$total = sprintf("%.2f", $total);
$cycle = $_POST[cycle];
$paid = "no";
function makeRandomPassword()
{
$salt = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7)
{
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$pass = makeRandomPassword();
$q4 = "SELECT * FROM users WHERE email = '$_POST[email]' ORDER BY id DESC LIMIT 1";
$r4 = mysql_query($q4);
if (!$r4)
{
echo "Database Error!";
}
else
{
while ($user = mysql_fetch_assoc($r4))
` {
$q5 = "INSERT INTO accounts (userid, domain, username, password, package, cycle, date, status, amount, total) VALUES ('$user[id]', '$_POST[domain]',, '$_POST[username]', AES_ENCRYPT('$pass','$key'), '$_POST[package]', '$_POST[cycle]', '$date', '$status', '$amount', '$total')";
$r5 = mysql_query($q5);
if (!$r5)
{
echo "Database Error";
}
else
{
echo "<META HTTP-EQUIV='REFRESH' CONTENT='0;URL=mods/order/paysystems.php'>";
$date = strftime("%Y-%m-%d, %H:%M", $date);
}
}
}
}
}
}
}
}
?>