Example #1
0
function checkLoginCookies($dblogin, $dbpass, $db)
{
  $CustomerID = $_COOKIE["id"];
  $Username   = trim(strtoupper($_COOKIE["username"]));
  $Auth       = trim(strtoupper($_COOKIE["auth"]));

  if ($CustomerID == "" || $Username == "" || $Auth == "")
  {
    header('Location:login.php?ref=account.php');
    generateGenericLayout($dblogin, $dbpass, $db, "<B>Account Settings</B>");
    beginContentBox();
    ECHO "You must be logged in.  If you are not forwarded to the login page in 5 seconds, please <a href=login.php?ref=checkout.php>click here</a>.<BR>";
    endContentBox();
    exit;
  }

  mysql_connect(localhost, $dblogin, $dbpass);
  @mysql_select_db($db) or die("Unable to select database");
  
  $query = "SELECT * FROM customers WHERE CustomerID = $CustomerID and Username = '******' and Auth = '$Auth'";
  $result = mysql_query($query) or die("Query failed:<BR>$query<BR>Error: " . mysql_error());

  if (mysql_numrows($result) == 0)
  {
    header('Location:login.php?ref=checkout.php');
    ECHO "You must be logged in.  If you are not forwarded to the login page in 5 seconds, please <a href=login.php?ref=checkout.php>click here</a>.<BR>";
    exit;
  }

  mysql_close();

  return array(mysql_result($result, 0, "CustomerID"), 
               mysql_result($result, 0, "FName"),
               mysql_result($result, 0, "LName"),
               mysql_result($result, 0, "MName"),
               mysql_result($result, 0, "Address1"),
               mysql_result($result, 0, "Address2"),
               mysql_result($result, 0, "City"),
               mysql_result($result, 0, "State"),
               mysql_result($result, 0, "Zip"),
               mysql_result($result, 0, "Phone1"),
               mysql_result($result, 0, "Phone2"),
               mysql_result($result, 0, "Email"),
               mysql_result($result, 0, "Username"),
               mysql_result($result, 0, "Password")
              );
}
Example #2
0
  <B>PHONE 2:</B> $Phone2<BR>
  <B>EMAIL:</B> $Email<BR>
  <B>USERNAME: </B> $Username<BR>
  <B>PASSWORD: </B> [Hidden, Check Email]<BR>
</ul>

Thank you!";

$subject = "Drums Of Summer Registration";
$body    = "Thank you for registering for an account on DrumsOfSummer.com.  Your registration information is: \n";
$body   .= "\n\tNAME\n\t\t$LName, $FName $MName\n";
$body   .= "\tADDRESS:\n";
$body   .= "\t\t$Address1\n";
if ($Address2 != "") { $body .= "\t\t$Addres2\n"; }
$body   .= "\t\t$City, $State $Zip\n";
$body   .= "\tPHONE:\n\t\t$Phone1\n";
if ($phone2 != "") { $body .= "\t\t$Phone2 (secondary)\n"; }
$body   .= "\tEMAIL:\n\t\t$Email\n";
$body   .= "\tUSERNAME:\n\t\t$Username\n";
$body   .= "\tPASSWORD:\n\t\t$Password\n";
$body   .= "\nIf you have any questions, please contact drumsofsummer@gmail.com or visit DrumsOfSummer.com.\n";

mail($Email, $subject, $body, "From: accounts@drumsofsummer.com\nX-Mailer: PHP 4.x");

ECHO "<P>You must now login:<BR>";

displayLoginForm($Username, "", "");

  endContentBox();

?>