User Cp N Profile.php With Password Change

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    User Cp N Profile.php With Password Change

    hello frndz i need usercp script n profile.php with password change does any1 hve dis scripts plz give it to me thnx

    #2
    to change passoword
    Code:
    <html>
    <head>
    <title>Change Password</title>
    </head>
    <body>
    
    <?php
    if(isset($_POST[&#39;update&#39;]))
    {
    $dbhost = &#39;&#39;;
    $dbuser = &#39;&#39;;
    $dbpass = &#39;&#39;;
    $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    if(! $conn )
    {
      die(&#39;Could not connect: &#39; . mysql_error());
    }
    
    $id = $_POST[&#39;emp_id&#39;];
    $pass = $_POST[&#39;pass&#39;];
    
    $sql = "UPDATE user ".
           "SET pass = $pass ".
           "WHERE id = id";
    
    mysql_select_db(&#39;test_db&#39;);
    $retval = mysql_query( $sql, $conn );
    if(! $retval )
    {
      die(&#39;Could not update data: &#39; . 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>
    SQL table
    Code:
    CREATE TABLE `user` (
      `id` int(100) NOT NULL auto_increment,
      `name` varchar(30) NOT NULL default &#39;&#39;,
      `pass` varchar(60) NOT NULL default &#39;&#39;,
     PRIMARY KEY  (`id`),
      UNIQUE KEY `name` (`name`)
    ) ENGINE=MyISAM  AUTO_INCREMENT=1;

    Comment


      #3
      profile.php
      Code:
      <?php
      $dbhost = &#39;&#39;;
      $dbuser = &#39;&#39;;
      $dbpass = &#39;&#39;;
      $conn = mysql_connect($dbhost, $dbuser, $dbpass);
      if(! $conn )
      {
        die(&#39;Could not connect: &#39; . mysql_error());
      }
      $sql = &#39;SELECT id, name FROM user&#39;;
      
      
      mysql_select_db(&#39;test_db&#39;);
      $retval = mysql_query( $sql, $conn );
      if(! $retval )
      {
        die(&#39;Could not get data: &#39; . mysql_error());
      }
      while($row = mysql_fetch_assoc($retval))
      {
          echo "USER ID :{$row[&#39;emp_id&#39;]}  
       ".
               "USER NAME : {$row[&#39;emp_name&#39;]} 
       ".
               "--------------------------------
      ";
      } 
      
      mysql_close($conn);
      ?>
      and for USER CP

      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


        #4
        lol i nedd chatzone edit profile scripts

        Comment


          #5
          it will work in every script,what u need just to modify,now what you can is copy and paste the related codes from chatzone script to get a modified codes

          Comment

          Working...
          X