Solved

php Change Password Function

Posted on 2012-04-03
4
378 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

820 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