";
// Let's create the menu
print "
";
print "Welcome, $first_name! "; print "This is a filler page for the main menu. Various options will appear here. Including - The option to change account settings (e.g., email, notifications) - The option to take surveys - The option to see results from surveys already taken "; // Set the database access information as constants: DEFINE ('DB_USER', 'rcfraley'); DEFINE ('DB_PASSWORD', '*PASSWORD*'); DEFINE ('DB_HOST', 'yourpersonality.netfirmsmysql.com'); DEFINE ('DB_NAME', 'ullman'); // Make the database connection: $dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error() ); // Define a SQL query // Here we are selecting the stored password and user_id for rows where // the database email (email) and submitted email($e) match one another. // v2.0 We are also selecting the status variables for the studies associated // with this menu. $q = "SELECT study1_taken, study1_lastdate, study1_type, study2_taken, study2_lastdate, study2_type, study3_taken, study3_lastdate, study3_type FROM users WHERE user_id='$user_id' AND session='$tempID'"; $r = @mysqli_query ($dbc, $q); // Run the query. if ($r) { // If it ran OK. $num = mysqli_num_rows($r); }else{ $error[] = "Error querring the database. Please contact the site administrator."; } // Let's place query results in an array called $results // moood_survey will be [0] and study2_taken will be element [1] etc $results = mysqli_fetch_array($r, MYSQLI_BOTH); /* ----------------------------------------------------------------- To help organize the menu options better, I will present the survey choices in a table. A table within a table. This is kind of old school, but let's hope old school makes a come back one day. I've updated the CSS file to contain special styles for id = menurows This will allow us to assign every other row to the class=alt so we can alternate the background colors of the table rows for easier reading. (It is easier on the eyes--if you're old [I mean old school].) ----------------------------------------------------------------- */ print "
|