コード例 #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")
              );
}
コード例 #2
0
  if ($errors_found == true)
  {
    ECHO "$error_msg";
    displayNewUserForm($FName, $LName, $Address1, $Address2, $City, $State, $Zip, $Phone1, $Phone2, $Email, $Username, "");
    exit;
  }

}


// ------------------------------------------- //


include "vars.inc";
generateGenericLayout($dblogin, $dbpass, $db, "<B>New User Registration Form</B>");
beginContentBox();


$ref = $_POST['ref'];
if ($ref != 'ref')
{
  displayNewUserForm("", "", "", "", "", "", "", "", "", "", "", "");
  endContentBox();
  exit;
}

$FName    = trim($_POST['FName']);
$LName    = trim($_POST['LName']);
$MName    = trim($_POST['MName']);
$Address1 = trim($_POST['Address1']);
$Address2 = trim($_POST['Address2']);