# HG changeset patch # User alex.mcmahon@cs.tcd.ie # Date 1242718224 -3600 # Node ID 29ae580f12bdcb0ac8d18d6ed4b88964a7d07724 # Parent a4bc6ef5dbfe9565cc008a1f434ccfc50879f3ba updated references to h4c to n4c, user_ID to uid, proxy to localhost and database to members diff -r a4bc6ef5dbfe -r 29ae580f12bd add_search.php --- a/add_search.php Tue May 19 00:30:06 2009 +0100 +++ b/add_search.php Tue May 19 08:30:24 2009 +0100 @@ -6,7 +6,7 @@ } // get user ID from cookie - $currID = $_COOKIE['h4c_ID']; + $currID = $_COOKIE['n4c_ID']; if ($currID == "") { @@ -35,10 +35,10 @@ // retrieve cookie if it exists if ($search_term != "") { - $conn = mysql_connect('localhost','root','') or die(mysql_error()); - mysql_select_db('h4c_db'); + $conn = mysql_connect('localhost','www-data','www-data') or die(mysql_error()); + mysql_select_db('members'); - $query = mysql_query("INSERT INTO requests_tbl (req_ID, user_ID, req_val, req_response, req_created) VALUES ('', '$currID', '$search_term', 0, CURDATE())"); + $query = mysql_query("INSERT INTO requests_tbl (req_ID, uid, req_val, req_response, req_created) VALUES ('', '$currID', '$search_term', 0, CURDATE())"); $query2 = mysql_query("SELECT MAX(req_ID) as id FROM requests_tbl"); mysql_close(); @@ -50,7 +50,7 @@ // construct message string $message = "#" . $currID . "#" . $reqID . "#" . $search_term; - $host="134.226.36.154"; + $host="localhost"; $port = 8080; $timeout = 30; @@ -80,8 +80,8 @@ -H4C - deleting request information... - +N4C - deleting request information... + diff -r a4bc6ef5dbfe -r 29ae580f12bd delete.php --- a/delete.php Tue May 19 00:30:06 2009 +0100 +++ b/delete.php Tue May 19 08:30:24 2009 +0100 @@ -2,8 +2,8 @@ // get request ID to delete $req_ID = $_GET['req_id']; - $conn = mysql_connect('localhost','root','') or die(mysql_error()); - mysql_select_db('h4c_db'); + $conn = mysql_connect('localhost','www-data','www-data') or die(mysql_error()); + mysql_select_db('members'); // retrieve cookie if it exists if ($req_ID != "") @@ -18,8 +18,8 @@ -H4C - deleting request information... - +N4C - deleting request information... + diff -r a4bc6ef5dbfe -r 29ae580f12bd details.php --- a/details.php Tue May 19 00:30:06 2009 +0100 +++ b/details.php Tue May 19 08:30:24 2009 +0100 @@ -1,6 +1,6 @@ -H4C - Welcome. <?php print $search_info; ?> - +N4C - Welcome. <?php print $search_info; ?> +
" . $search_count . " "; print "Search:" . $db_field['req_val'] . " "; diff -r a4bc6ef5dbfe -r 29ae580f12bd index.php --- a/index.php Tue May 19 00:30:06 2009 +0100 +++ b/index.php Tue May 19 08:30:24 2009 +0100 @@ -1,26 +1,26 @@ -H4C - checking your user status... +N4C - checking your user status... @@ -46,12 +46,12 @@ print 'COOKIE Status = ' . $currStatus . '

'; // FOR TEST PURPOSES - READ USERS - $result2 = mysql_query('SELECT * FROM users_tbl'); + $result2 = mysql_query('SELECT * FROM creds'); print '

LIST OF USERS -----------------------------------------------------------------

'; while ($db_field = mysql_fetch_assoc($result2)) { - print 'USERID: ' . $db_field['user_ID'] . ' | EMAIL: ' . $db_field['user_email'] . ' | USERSTATUS: ' . $db_field['user_status'] . '
'; + print 'USERID: ' . $db_field['uid'] . ' | EMAIL: ' . $db_field['user_email'] . ' | USERSTATUS: ' . $db_field['user_status'] . '
'; } print '

';