Solved

php Change Password Function

Posted on 2012-04-03
4
375 Views
Last Modified: 2012-08-14
I am trying to figure out to make a password change form and function from some sample code so I can use it for another project.  The sample has a form with an authentication function and a link with a registration form and function.  

I figure I should be able to copy the "addUser.php" code, and modify it to update the user's password.  I think I've got it pretty close, but I can't even get the form to open.  It keeps bombing with a parse error on the line:
  <form action="<? $_SERVER['PHP_SELF'] ?>" name="myForm" method="post">

Can someone tell me what I've got wrong here??

Thanks, Lynn
changePass.php
addUser.php
index.php
CLdbUser.php
0
Comment
Question by:Lambel
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37804085
Take the offending line of code, and change it to this:
<form action="<?php echo $_SERVER['PHP_SELF'];?>" name="myForm" method="post">

or simply this:
<form action="" name="myForm" method="post">
0
 

Author Comment

by:Lambel
ID: 37804109
Thanks for the response.  I tried both, but still get the error:

Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/students/ics325s12/ics325s1210/public_html/lab22/changePass.php on line 28
0
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 500 total points
ID: 37804158
You're missing a '   in line 8 of changePass.php
It is:

             $newPswd = $_POST['newPassword];

But should be:

             $newPswd = $_POST['newPassword'];
0
 

Author Comment

by:Lambel
ID: 37804433
Thanks very much for your help!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now