| | |
Help with password update
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 1
Reputation:
Solved Threads: 0
Hey all ive been trying to get the code bellow to work which should make an update password fourm but im not having much luck if any one can tell me why it's not working i will jump up and down around the room looking stupid lol
the error code that keeps been displayed is
Parse error: parse error in H:\server\Apache2\htdocs\koc\TMP25ae9jga7r.php on line 28
the database is called test and the table used is called login and the fields for the username and password are username_urs and password_urs
PHP Syntax (Toggle Plain Text)
<?php require_once('Connections/koc.php'); require_once('includes/functions.inc.php'); ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if (isset($_POST['submit'])) { $invalid = false; foreach ($_POST as $key => $value) { if (empty($value)) { $invalid = true; } } if ($invalid) { echo "<p>You must fill in all fields!</p>\n"; } else { if ($_POST['new_pw1_urs'] = $_POST['new_pw2_urs']) { echo "<p>New Passwords do not match!</p>\n"; } else { $query = mysql_query("SELECT * FROM login WHERE username_urs = '$_POST[username_urs]' AND password_urs = '" .($_POST['old_pw_urs']) . "'"); if (mysql_num_rows($query) = 1) { echo "<p>Invalid username/password combination!</p>\n"; } else { if (mysql_query("UPDATE login SET password_urs = '" .($_POST['new_pw1_urs']) . "' WHERE username_urs = '$_POST[username_urs]'")) { echo "<p>Password updated!</p>\n"; } else { echo "<p>Couldn't update password!</p>\n"; } } } } } ?> <form name='update_pw' action='' method='post'> Username: <input type='text' name='username_urs' /><br /> Password: <input type='password' name='old_pw_urs' /><br /> New PW: <input type='password' name='new_pw1_urs' /><br /> Confirm New PW: <input type='password' name='new_pw2_urs' /><br /> <input type='submit' name='submit' value='Change it!' /> </form> </body> </html>
the error code that keeps been displayed is
Parse error: parse error in H:\server\Apache2\htdocs\koc\TMP25ae9jga7r.php on line 28
the database is called test and the table used is called login and the fields for the username and password are username_urs and password_urs
Last edited by alcoholic1; Jul 11th, 2005 at 3:35 am. Reason: adding in more information
![]() |
Similar Threads
- Need help with HDD password (Storage)
- Not able to change/update password (PHP)
- Presario 700 wont boot into XP Home (Troubleshooting Dead Machines)
- shuting down multiple nix boxes (*nix Software)
- Using CDO messaging service (VB.NET)
Other Threads in the PHP Forum
- Previous Thread: PHP, mySQL, Apache all in one
- Next Thread: Help with Login Box
| Thread Tools | Search this Thread |
5.2.10 action apache api array beginner beneath binary broken cakephp checkbox class classes cms code cron curl database date destroy display dynamic echo echo$_get[x]changingitintovariable... email encode error fcc file files folder form forms function functions google header howtowriteathesis href htaccess html image images include insert ip javascript joomla limit link local login mail memberships menu mlm mod_rewrite multiple multipletables mysql mysqlquery neutrality oop open passwords paypal pdf php provider query radio random record remote rss script search server sessions sockets source space sql strip_tags syntax system table template thesishelp tutorial update upload url validator variable video voteup web window.onbeforeunload=closeme; youtube





