// Set the database access information as constants.
DEFINE ('DB_USER', 'trsom_dbadmin');
DEFINE ('DB_PASSWORD', 'SNOWing!22');
DEFINE ('DB_HOST', '216.70.107.103');
DEFINE ('DB_NAME', 'trsom_users');
// Make the connection.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
// Select the database.
@mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
// Create a function for escaping the data.
function escape_data ($data) {
// Address Magic Quotes.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
// Check for mysql_real_escape_string() support.
if (function_exists('mysql_real_escape_string')) {
global $dbc; // Need the connection.
$data = mysql_real_escape_string (trim($data), $dbc);
} else {
$data = mysql_escape_string (trim($data));
}
// Return the escaped value.
return $data;
} // End of function.
// Check if the form has been submitted.
if (isset($_POST['submitted'])) {
//require_once ('../config/mysql_connect.php'); // Connect to the db.
$errors = array(); // Initialize error array.
// Check for username.
//if (empty($_POST['user_name'])) {
// $errors[] = 'You forgot to enter your username.';
//} else {
// $un = escape_data($_POST['user_name']);
//}
$un = "leader";
// Check for a password.
if (empty($_POST['password'])) {
$errors[] = 'You must enter the password.';
} else {
$p = escape_data($_POST['password']);
}
if (empty($errors)) { // If everything's OK.
/* Retrieve the user_name and password for
that user_name/password combination. */
$query = "SELECT user_id, url FROM users WHERE user_name='$un' AND password='$p'";
$result = @mysql_query ($query); // Run the query.
$row = mysql_fetch_array ($result, MYSQL_NUM); // Return a record, if applicable.
if ($row) { // A record was pulled from the database.
// Set the session data & redirect.
session_name ('ffof');
session_start();
$_SESSION['user_id'] = $row[0];
$_SESSION['url'] = $row[1];
$_SESSION['agent'] = md5($_SERVER['HTTP_USER_AGENT']);
// Redirect the user to the logged in page.
// Start defining the URL.
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
// Check for a trailing slash.
if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
$url = substr ($url, 0, -1); // Chop off the slash.
}
// Add the page.
$url .= '/' ;
$url .= $_SESSION['url'];
header("Location: $url");
exit(); // Quit the script.
} else { // No record matched the query.
$errors[] = 'Password was incorrect. Please try agian.';
//$errors[] = mysql_error() . '
Query: ' . $query; for Debugging message.
}
} // End of if (empty($errors)) IF.
mysql_close(); // Close the database connection.
} else { // Form has not been submitted.
$errors = NULL;
} // End of the main Submit conditional.
?>
Freedom Connect groups are small gatherings of groups of people at The Rock who meet in a casual atmosphere to talk about the campaign messages and progress, and answer any questions you may have.
If you would like to be a part of these gatherings, please let us know and we will connect you with a group on a time and place convenient to you!
If you are a leader of any Freedom Connect gathering, we thank you for taking the time to give of yourself and facilitate these connect times. You are loved and much appreciated! Please login below to access the resources provided for you.