Solved

php Change Password Function

Posted on 2012-04-03
4
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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…

617 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