473,549 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing password script not running, help me?

20 New Member
I have developed a login system but its failing to allow the user to change password.
Here is my code.
[PHP]
<?
require_once("s ystem_fns.php") ;
session_start() ;
do_html_header( "Changing password");
check_valid_use r();
$new_passwd=($H TTP_POST_VARS['new_passwd']);
$new_passwd2=($ HTTP_POST_VARS['new_passwd2']);
if (!filled_out($H TTP_POST_VARS))
{
echo "You have not filled out the form completely.
Please try again.";
display_user_me nu();
exit;
}
else
{
if ($new_passwd!=$ new_passwd2)
echo "Passwords entered were not the same. Not changed.";
else if (strlen($new_pa sswd)>16 || strlen($new_pas swd)<6)
echo "New password must be between 6 and 16 characters. Try again.";
else
{
// attempt update
if (change_passwor d($valid_user, $old_passwd, $new_passwd))
echo "Password changed.";
else
echo "Password could not be changed.";
}


}
display_user_me nu();
?>
[/PHP]

These are the error messages I'm getting.

Notice: Undefined index: new_passwd in C:\project\test \change_passwd. php on line 6
Notice: Undefined index: new_passwd2 in C:\project\test \change_passwd. php on line 7
These are lines in question.
[PHP]
$new_passwd=($H TTP_POST_VARS['new_passwd']);
$new_passwd2=($ HTTP_POST_VARS['new_passwd2']);
[/PHP]
Please help me.
Feb 15 '07 #1
4 1754
xwero
99 New Member
what is the html code of the form?
Feb 15 '07 #2
Motoma
3,237 Recognized Expert Specialist
What version of PHP are you using? Have you tried referencing them via $_POST rather than $HTTP_POST_VARS ?
Feb 16 '07 #3
muchexie
20 New Member
what is the html code of the form?
Here is the html code

[HTML]
<form method='post' action='change_ passwd.php'>
<table bgcolor=''>
<tr>
<td>Username: </td>
<td><input type='text' name='username' size=16 maxlength=16></td></tr>
<tr>
<td>Old Password:</td>
<td><input type='password' name='passwd'
size=16 maxlength=16></td></tr>
<tr>
<td>New Password <br />(between 6 and 16 chars):</td>
<td valign='top'><i nput type='password' name='new_passw d'
size=16 maxlength=16></td></tr>
<tr>
<td>Confirm password:</td>
<td><input type='password' name='new_passw d2' size=16 maxlength=16></td></tr>
<tr>
<td colspan=2 align='center'>
<input type='submit' value='Change'> </td></tr>
</table></form>
[/HTML]
Feb 16 '07 #4
muchexie
20 New Member
What version of PHP are you using? Have you tried referencing them via $_POST rather than $HTTP_POST_VARS ?
I'm using PHP 4.4.4 version.Well I'm going to replace $HTTP_POST_VARS by
$_POST.
Thanks I hope its gonna work.
Feb 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
9739
by: LRW | last post by:
Sorry to crosspost, but I have no idea if this is more a PHP question of general Linux question. I have a script that makes changes to image files, montages them into a jpg, and creates a Web page with that image. It starts with someone from our graphics dept. who I set up to copy the image files over to the Linux server with SAMBA. The...
0
1922
by: PiEmme | last post by:
On a Linux server a MySql db is installed. I was able to run mysql and mysqladmin without entering user and password, at first. Later both user and password have become required. Probably after granting root user to two different php applications accessing db's (applA, dbA, user=root, pwd=pwdA; applB, dbB, user=root, pwd=pwdB). Now all db's...
1
6212
by: patrickshroads | last post by:
I just started a new job and no one seems to know the SA password. Here's my plan to change it: 1. I've run a trace for a couple of days to verify that there are no jobs or processes that are connecting as SA and that would break if I changed the password. 2. Before the changing the password I am going to bulk copy out the sysxlogins row...
2
1666
by: Gopal | last post by:
Hi, I've a module report.py having a set of funtions to open/close/write data to a log file. I invoke these functions from another module script.py. Whenever I'm changing something in report.py, I'm running the file (however, it has not effect). After that I'm running script.py again. However, the output is not taking effect.
6
2037
by: tshad | last post by:
Is there a way during Page_Load to change or add an attribute to the Body tag? I want to be able to change the onLoad body attribute to do a focus on one of my text boxes, such as: onLoad="document.forms.txtLogon.focus();" The problem is I have my <body> in an include file and want to set the onLoad attribute during Page_Load time.
2
3178
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears out of the text box, but the meter will stay at its current position until text is entered back into the textbox. Once text is re-entered, the meter...
2
6865
by: =?Utf-8?B?c3RhZ2VybGVp?= | last post by:
We would like to change the password for the ASPNET account on our W2k3 servers running IIS 6.0 and .NET 1.1. Will we run into problems? Is there a way to determine the current password, in case we want to roll it back? thanks
1
2197
by: 3srt | last post by:
Hello. I am still relatively new to perl and have hit a few bumps along my way to finishing my program. Some background to my question: There are two files: info.html and run.cgi. A user navigates to http://www.mysite.com/info.html and enters a user ID. The user ID is given to run.cgi, which creates a temporary, random password on a remote...
1
1245
Ajm113
by: Ajm113 | last post by:
I find it odd all my scripts doesn't change the logged in person's name on any other page, but my threads page. I have no idea why! I looked over the script and saw nothing changing the session (Variable Wise) changing it. I commented out some off the parts on my large script, but it seems the problem points to here though it doesn't make...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6048
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5372
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5089
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.