Can anyone help me out? It does everything its supposed to do, but when i get to the process.php that happens.
Warning: Missing argument 4 for updateuserfield() in /home/content/n/o/i/noirphantom/html/lounge/include/database.php on line 160
Warning: Missing argument 4 for updateuserfield() in /home/content/n/o/i/noirphantom/html/lounge/include/database.php on line 160
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/o/i/noirphantom/html/lounge/include/database.php:160) in /home/content/n/o/i/noirphantom/html/lounge/process.php on line 186
process.php
/**
* procEditAccount - Attempts to edit the user's account
* information, including the password, which must be verified
* before a change is made.
*/
function procEditAccount(){
global $session, $form;
/* Account edit attempt */
$retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email'], $_POST['bio']);
/* Account edit successful */
if($retval){
$_SESSION['useredit'] = true;
line 186-> header("Location: ".$session->referrer);
}
/* Error found with form */
else{
$_SESSION['value_array'] = $_POST;
$_SESSION['error_array'] = $form->getErrorArray();
header("Location: ".$session->referrer);
}
}
Database.php
/**
* updateUserField - Updates a field, specified by the field
* parameter, in the user's row of the database.
*/
line 160 -> function updateUserField($username, $field, $value, $bio){
$q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'";
return mysql_query($q, $this->connection);
}
/**
* getUserInfo - Returns the result array from a mysql
* query asking for all information stored regarding
* the given username. If query fails, NULL is returned.
*/
function getUserInfo($username){
$q = "SELECT * FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);
/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}
/**
* getNumMembers - Returns the number of signed-up users
* of the website, banned members not included. The first
* time the function is called on page load, the database
* is queried, on subsequent calls, the stored result
* is returned. This is to improve efficiency, effectively
* not querying the database when no call is made.
*/
function getNumMembers(){
if($this->num_members < 0){
$q = "SELECT * FROM ".TBL_USERS;
$result = mysql_query($q, $this->connection);
$this->num_members = mysql_numrows($result);
}
return $this->num_members;
}