Results 1 to 2 of 2

Thread: can u check out this ones

  1. #1
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default can u check out this ones

    hi
    can u check this coad and suggest me ones

    PHP Code:
    <?php
    include"conifig.php";
      
    $password=$_POST['password'];
     echo 
    $_GET[username];

    $pass=md5($_POST[password]);

    mysql_query("UPDATE `table` SET `Password` = $pass WHERE `meconzee1_user` Loginname='".$_GET[username]."''"); 

    echo 
    "your password successfully changed";

    mysql_close($con);

    ?>
    this query is not working can u suggest any better code for me
    Last edited by Snookerman; 02-09-2010 at 08:32 AM. Reason: please use [php] [/php] tags for php code

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Missing quotes in the $_POST variables, here you go:

    PHP Code:
    <?php
    include"conifig.php";
      
    $password=$_POST['password'];
      
    $user $_GET['username'];

    $pass=md5($_POST['password']);

    if(
    mysql_query("UPDATE `table` SET `Password` = '$pass' WHERE `Loginname` = '$user' "))
      echo 
    "Your password successfully changed";
    else
      echo 
    "Failed to change your password.";

    mysql_close($con);

    ?>
    Not quite sure about the "`meconzee1_user` Loginname" part.
    You need to find out what field you want to compare.

  3. The Following User Says Thank You to Schmoopy For This Useful Post:

    zee000 (02-10-2010)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •