--- 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 @@
<?php
- $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 (isset($_COOKIE['h4c_ID']))
+ if (isset($_COOKIE['n4c_ID']))
{
- $currID = $_COOKIE['h4c_ID'];
+ $currID = $_COOKIE['n4c_ID'];
}
else
{
// SQL queries
- $result = mysql_query("INSERT INTO users_tbl (user_ID) VALUES ('')");
- $user_id = mysql_query("SELECT MAX(user_ID) as id FROM users_tbl");
+ $result = mysql_query("INSERT INTO creds (uid) VALUES ('')");
+ $user_id = mysql_query("SELECT MAX(uid) as id FROM creds");
$expiry = time() + (3600 * 24 * 30 * 12);
//create cookies
while ($db_field2 = mysql_fetch_assoc($user_id)) {
- setcookie('h4c_ID', $db_field2['id'] , $expiry, '/', '', 0);
+ setcookie('n4c_ID', $db_field2['id'] , $expiry, '/', '', 0);
}
- if (!isset($_COOKIE['h4c_ID']))
+ if (!isset($_COOKIE['n4c_ID']))
{
$currID = 1;
}
@@ -34,7 +34,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>H4C - checking your user status...</title>
+<title>N4C - checking your user status...</title>
</head>
<body>
@@ -46,12 +46,12 @@
print 'COOKIE Status = ' . $currStatus . '</p>';
// FOR TEST PURPOSES - READ USERS
- $result2 = mysql_query('SELECT * FROM users_tbl');
+ $result2 = mysql_query('SELECT * FROM creds');
print '<p><strong>LIST OF USERS -----------------------------------------------------------------</strong></p><p>';
while ($db_field = mysql_fetch_assoc($result2)) {
- print 'USERID: ' . $db_field['user_ID'] . ' | EMAIL: ' . $db_field['user_email'] . ' | USERSTATUS: ' . $db_field['user_status'] . '<br />';
+ print 'USERID: ' . $db_field['uid'] . ' | EMAIL: ' . $db_field['user_email'] . ' | USERSTATUS: ' . $db_field['user_status'] . '<br />';
}
print '</p>';