these are the codes;
new_password.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-transitional.dtd">
<html>
<head>
<title>
</title>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#808080" text="#FFFFFF">
<br><br><br><br><br>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"> </p>
<div align="center">
<center>
<table border="0" width="250" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#FF00FF"> </td>
</tr>
<tr>
<td width="100%" bgcolor="#00FFFF">
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"><font color="#000000" face="AvantGarde Md BT"><b>Enter
New Password</b></font></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"> </p>
<form name="form1" action="function_request.php" method="post">
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"><font color="#000000">user
name </font> <input type="text" name="new_username" size="20"></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"> </p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"><font color="#000000">new
password </font><input type="text" name="new_password" size="20"></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"><font color="#000000">confirm</font>
<input type="text" name="confirm" size="20"></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"> </p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center">
<input type="submit" name="submit" value="Enter password">
<input type="reset" value="Reset" name="B2"></p>
</form>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center">
<font color="#000000" face="Arial Narrow">
<a href="http://www.askjames01.com/photo-gallery/admin.htm">Admin</a></font></td>
</tr>
<tr>
<td width="100%" bgcolor="#FF00FF">
<p align="center"> </p>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
function_request.php
<?php
#require_once($_SERVER['DOCUMENT_ROOT'].'/mygallery/include/error_messages.php');
#echo $_REQUEST['username']." ---> $ _ request";
require_once("error_messages.php");
class admin_password_class {
//define and assign variable & function constructor.
var $new_username_len;
var $new_password_len;
var $new_username_tmp;
var $new_password_tmp;
//compute $new_username & $new_password length.
function compute_length($new_username_tmp, $new_password_tmp) {
$new_username_len = strlen($new_username_tmp);
$new_password_len = strlen($new_password_tmp);
if($new_username_tmp == ''){
#echo "You forgot to put your name!";
error_messages::program_error_messages(1);
}elseif ($new_username_len < 5){
#echo "Username length is too short!";
error_messages::program_error_messages(2);
}elseif ($new_password_tmp == ''){
#echo "Please enter password!";
error_messages::program_error_messages(3);
}elseif ($new_password_len < 5){
#echo "Password length is too short!";
error_messages::program_error_messages(4);
}
}
}
$CO_admin_class = new admin_password_class;
$CO_admin_class->compute_length($_REQUEST['new_username'], $_REQUEST['new_password']);
?>
and the last file is
error_messages.php
<html>
<head>
<title> </title>
</head>
<body>
<?php
class error_messages {
#$temp_message=0;
var $message_tmp="";
var $message_width_tmp=0;
function program_error_messages($error_num) {
switch ($error_num) {
case 1:
$message_tmp = " You forgot to put your name! ";
$message_width_tmp = strlen($message) * 7;
$this->control_message_box($message_width_tmp, $message_tmp);
break;
case 2:
$message = " Username too short! ";
$message_width = strlen($message) * 7;
$this->control_message_box($message_width_tmp, $message_tmp);
break;
case 3:
$message = " You forgot to put the password! ";
$message_width = strlen($message) * 7;
$this->control_message_box($message_width_tmp, $message_tmp);
break;
case 4:
$message = " Password too short! ";
$message_width = strlen($message) * 7;
$this->control_message_box($message_width_tmp, $message_tmp);
break;
}
}
//controlling the width of the table box.
//1. insert to html tag <width="">
function control_message_box($message_width, $message) {
?>
<br><br><br><br><br>
<div align="center">
<center>
<table border="1" height="40" width="<?php echo $message_width; ?>" bordercolor="#FF00FF" bgcolor="#00FFFF">
<tr>
<td width="100%" align="center">
<?php echo "$message"; ?>
</td>
</tr>
</table>
</center>
</div>
<?php
}
}
#$CO_error_messages = new error_messages;
#$CO_error_messages->program_error_messages(3);
?>
</body>
</html>
Just execute new_password.php and the rest will follow...
I'm hoping that somehow somebody will figure out the cause of "undefined function error"...
Thank you very much in advance...