• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

php Change Password Function

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
  • 2
  • 2
1 Solution
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">
LambelAuthor Commented:
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
You're missing a '   in line 8 of changePass.php
It is:

             $newPswd = $_POST['newPassword];

But should be:

             $newPswd = $_POST['newPassword'];
LambelAuthor Commented:
Thanks very much for your help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now