hello frndz i need usercp script n profile.php with password change does any1 hve dis scripts plz give it to me thnx
User Cp N Profile.php With Password Change
Collapse
X
-
to change passowordCode:<html> <head> <title>Change Password</title> </head> <body> <?php if(isset($_POST['update'])) { $dbhost = ''; $dbuser = ''; $dbpass = ''; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $id = $_POST['emp_id']; $pass = $_POST['pass']; $sql = "UPDATE user ". "SET pass = $pass ". "WHERE id = id"; mysql_select_db('test_db'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not update data: ' . mysql_error()); } echo "Updated data successfully\n"; mysql_close($conn); } else { ?> <form method="post" action="<?php $_PHP_SELF ?>"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">User ID</td> <td><input name="emp_id" type="text" id="emp_id"></td> </tr> <tr> <td width="100">Password</td> <td><input name="emp_salary" type="text" id="emp_salary"></td> </tr> <tr> <td width="100"> </td> <td> </td> </tr> <tr> <td width="100"> </td> <td> <input name="update" type="submit" id="update" value="Update"> </td> </tr> </table> </form> <?php } ?> </body> </html>
Code:CREATE TABLE `user` ( `id` int(100) NOT NULL auto_increment, `name` varchar(30) NOT NULL default '', `pass` varchar(60) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM AUTO_INCREMENT=1;
-
profile.php
Code:<?php $dbhost = ''; $dbuser = ''; $dbpass = ''; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = 'SELECT id, name FROM user'; mysql_select_db('test_db'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } while($row = mysql_fetch_assoc($retval)) { echo "USER ID :{$row['emp_id']} ". "USER NAME : {$row['emp_name']} ". "-------------------------------- "; } mysql_close($conn); ?>
Code:echo " [b]---General Options---[/b] "; echo "<a href=\"profile.php?id=$id\">View Profile</a> "; echo "<a href=\"password.php?id=$id\">Change Password</a> ";
Comment
Comment