?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?Re: Submitted message not displayed!
Author:??(---.ym.rnc.net.cable.rogers.com)
Date:???03-08-04 14:46

try again


require_once('includes/config.inc');

$page_title = 'Change your password';
include_once ('includes/header2.htm');

if (!isset($_SESSION['firstName'])) {

header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index3.php");
ob_end_clean();
exit();

} else {

if (isset($_POST['submit'])) {

require_once ('security/connect.php');
make_change(); //call the change password function

}else{

show_form();

}//end if

function make_change()
{
if (eregi ("^[[:alnum:]]{4,20}$", stripslashes(trim($_POST['password1'])))) {

if ($_POST['password1'] == $_POST['password2']) {

$p = $_POST['password1'];

} else {

$p = FALSE;
echo '

Your password did not match the confirmed password!

';
show_form();

}//end if

} else {

$p = FALSE;
echo '

Please enter a valid password!

';
show_form();
exit();

}//end if

if ($p!=False) {

$query = "UPDATE customers SET password=PASSWORD('$p') WHERE customerID = {$_SESSION['customerID']}";
$result = mysql_query ($query) or die ("Can't complete query because ".mysql_error());
if (mysql_affected_rows($result) == 1) {

echo '

Your password has been changed

';

} else {

$message = '

Your password could not be
changed due to a system error We apologize for the inconvenience

';

}//end if


} else {

echo '

Please correct the form below:

';
show_form(); //call the show_form function

}//end if
}//end function

function show_form()
{?>

Change your Password













New
Password:



Confirm New Password:














}
include ('includes/footer2.htm');

?>

?Topics Author? Date
?Submitted message not displayed!??new
Niz 03-06-04 05:54?
?Re: Submitted message not displayed!??new
bastien 03-07-04 05:43?
?Re: Submitted message not displayed!??new
Niz 03-07-04 12:49?
?Re: Submitted message not displayed!??new
bastien 03-07-04 13:22?
?Re: Submitted message not displayed!??new
Niz 03-07-04 15:53?
?Re: Submitted message not displayed!??new
bastien 03-07-04 16:37?
?Re: Submitted message not displayed!??new
Niz 03-08-04 06:49?
?Re: Submitted message not displayed!??new
bastien 03-08-04 14:46?
?Re: Submitted message not displayed!??new
Niz 03-09-04 08:52?
?Re: Submitted message not displayed!??new
bastien 03-09-04 15:27?
?Re: Submitted message not displayed!??new
Mr_Skatoo 03-09-04 20:45?
?Re: Submitted message not displayed!??new
Niz 03-10-04 05:37?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > try again > > > require_once('includes/config.inc'); > > $page_title = 'Change your password'; > include_once ('includes/header2.htm'); > > if (!isset($_SESSION['firstName'])) { > > header ("Location: http://" . $_SERVER['HTTP_HOST'] . > dirname($_SERVER['PHP_SELF']) . "/index3.php"); > ob_end_clean(); > exit(); > > } else { > > if (isset($_POST['submit'])) { > > require_once ('security/connect.php'); > make_change(); //call the change password function > > }else{ > > show_form(); > > }//end if > > function make_change() > { > if (eregi ("^[[:alnum:]]{4,20}$", > stripslashes(trim($_POST['password1'])))) { > > if ($_POST['password1'] == $_POST['password2']) { > > $p = $_POST['password1']; > > } else { > > $p = FALSE; > echo '

Your password > did not match the confirmed password! >

'; > show_form(); > > }//end if > > } else { > > $p = FALSE; > echo '

Please enter a > valid password!

'; > show_form(); > exit(); > > }//end if > > if ($p!=False) { > > $query = "UPDATE customers SET password=PASSWORD('$p') > WHERE customerID = {$_SESSION['customerID']}"; > $result = mysql_query ($query) or die ("Can't complete > query because ".mysql_error()); > if (mysql_affected_rows($result) == 1) { > > echo '

Your password has been changed

'; > > } else { > > $message = '

Your > password could not be > changed due to a system error We apologize for > the inconvenience

'; > > }//end if > > > } else { > > echo '

Please correct the > form below:

'; > show_form(); //call the show_form function > > }//end if > }//end function > > function show_form() > {?> >

Change your Password

>
method="post"> > > > > > > > > > > >
New > Password: > maxlength="40" /> >
> Confirm New Password: > maxlength="40" /> >
> >
>

> > >

>
>
>
> > } > include ('includes/footer2.htm'); > > ?> ">??

Provided By
Phorum