Lavalair forgot password

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

    Lavalair forgot password

    i coded the forgot password script and want to share it. and it works perfectly for me.

    make a file called forgot.php and put the coding below inside it

    PHP Code:
    <?php
    header
    ("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    echo(
    "<?xml version=\"1.0\"?>");
    echo 
    "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <wml>
    <?php
    include("config.php");
    include(
    "core.php");

    $bcon connectdb();


    include(
    "forgot2.php");
    $a $_GET["a"];
    $em $_POST["em"];
    $username $_POST["username"];


     if(
    $a=="s"){
     echo 
    "<card id=\"log\" title=\"Forgot Password\">\n";
    echo 
    "<p align=\"center\">";
     if(
    $em==""){
     echo 
    "$error1<br/>";
     echo 
    "<a href=\"invite.php?sid=$sid\">$errorlnk</a><br/>";
     }
    //else if($nick==""){
     
     //echo "$error2<br/>";
     //echo "<a href=\"invite.php?sid=$sid\">$errorlnk</a><br/>";
     //}
     
    else{

    $pwd mysql_fetch_array(mysql_query("SELECT pwd FROM ibwf_users WHERE name='".$username."'"));


    $message "This email is a password reminder.
    Your username is: 
    $username
    Your password is: 
    $pwd[0]

    Login at: http://forum.htportal.net/login.php?loguid=
    $username&logpwd=$pwd[0]

    "
    ;
     
     
    $to "$em";

    $subject "HTPortal.net Password";

    $txt "$message";

    $headers "From: no-reply@htportal.net";

    mail($to,$subject,$txt,$headers);
    echo 
    "Password Sent!<br/>Username: $username<br/> Sent To: $em<br/>";
    echo 
    "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
     
     
     }
     echo 
    "</p>";
    echo 
    "</card>";
         }else{
         echo 
    "<card id=\"log\" title=\"HT Portal Password Sender\">\n";
    echo 
    "<p align=\"center\">";
    echo 
    "<img src=\"$image\" alt=\"*\"/><br/>";

    echo 
    "$admin<br/><br/>";


    echo 
    "Your Username:<br/>";

    echo 
    "<input type=\"username\" name=\"username\" value=\"\" maxlength=\"20\"/><br/>";

    echo 
    "Your Email:<br/>";
    echo 
    "<input type=\"em\" name=\"em\" maxlength=\"50\"/><br/>";

    echo 
    "<anchor>Send password<go href=\"forgot.php?a=s\" method=\"post\">";
    echo 
    "<postfield name=\"username\" value=\"$(username)\"/>";
    echo 
    "<postfield name=\"em\" value=\"$(em)\"/></go></anchor><br/>";     
    echo 
    "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
         echo 
    "</p>";
    echo 
    "</card>";
         }


    ?>

    </wml>

    #2
    next make a file called forgot2.php and put the code below in it
    PHP Code:
    <?php
    $sid 
    $_GET["sid"];
    $nick getnick_sid($sid);
    /*
    Coded by hypetype(SHANE)
    Site: http://htportal.net
    Contact: hypetype@gmail.com
    Note: This script is a free script.. edit, modify, update but dont own it lol
    ======Proud To Be a Jamaican!=========
    /*


    /*
    this deals with the errors the page is suppose to give off!
    */
    $error1 "Please go back and write your email!";
    $error2 "Please go back and write your name!";
    $errorlnk "Resend Invitation!";
    ////End of Errors!/////////////////////////////////////

    /*
    this deals with the page appearance :P
    */

    $invmsg "You are invited to join http://htportal.net chat by your friend, $nick.
    This chat site has great chat friends online.
    Click on this link http://htportal.net to meet alot of people world wide and also in your country."
    ;

    $admin "Forgot Your Password?<br/>Fill in the fields below to have your password sent to your email!<br/>
    <b>NOTE: <u>THE PASSWORD WILL BE SENT TO THE EMAIL ADDRESS THAT IS REGISTERED TO THE USERNAME!!!</u></b>
    "
    ;
    $image "images/logo.gif";
    $homet "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
    $title "HT Portal forgot password";

    /////The End!



    ?>

    Comment


      #3
      put this coding on the login.php page
      PHP Code:
                   mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."', pwd='".$pwd."', browserm='".$ubr."' WHERE id='".$idn."'"); 
      and in the database add a table in ibwf_users called pwd
      Type = varchar(30)
      Collation = latin1_swedish_ci
      Default leave it blank

      Comment


        #4
        thats it, have fun. let me know if u have problems and i will help u out.

        Comment


          #5
          tanx for sharing will have a look

          Comment


            #6
            Hey shane nice to see your sharing

            Keep the good work up bro :cool:
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              Originally posted by subzero View Post
              Hey shane nice to see your sharing

              Keep the good work up bro :cool:
              ok subzero:cool:

              Comment


                #8
                this code is not safe.is easy to hack ur nick.. even is not my email automatic send your password..

                Comment


                  #9
                  Originally posted by poormaster23 View Post
                  this code is not safe.is easy to hack ur nick.. even is not my email automatic send your password..
                  is did u find an error? cause i use it on my site and everythin is workin pretty well? as i said if u find an error let me know so i can have a further look into it and try fix it for youB)

                  Comment


                    #10
                    i dont like 2 think tht some1 can reset my password...

                    and its easy... if u know my email u can daily reset my pass grrrrrr

                    even if u disable email in user profil its kind of tricky...

                    and its anoying lol

                    i think would be better 2 add simple additional security question during registration etc

                    or even better "password reset and sent to ur email, u have 20 min to login otherwise it will be reset to old one"

                    :p

                    oh btw u may think about adding this function 2 ur script cuz its really bad without it
                    PHP Code:
                        function safemail ($header) {
                             
                    $header str_replace ("\n""\0"$header);
                             
                    $header str_replace ("\r""\0"$header);
                             return 
                    $header;
                        } 
                    and
                    PHP Code:

                    $headers 
                    "From: "safemail ("no-reply@htportal.net"); 
                    and
                    PHP Code:
                    $em htmlspecialchars($_POST["em"]); 
                    etc...

                    at least 4 start lol
                    Last edited by alesh; 21.05.09, 12:41.
                    sigpiceeeeerrr....

                    Comment


                      #11
                      this is not gonna reset ur password. its gonna send the password to ur email if u forget it?

                      Comment


                        #12
                        Originally posted by hypetype View Post
                        this is not gonna reset ur password. its gonna send the password to ur email if u forget it?
                        oh i wasnt bodered 2 look out the code lol

                        i assume...

                        anyway its not bulet proof lol its very unsafe
                        sigpiceeeeerrr....

                        Comment


                          #13
                          Originally posted by alesh View Post
                          oh i wasnt bodered 2 look out the code lol

                          i assume...

                          anyway its not bulet proof lol its very unsafe
                          how did you know its unsafe if you say that you didnt bothered to look out the code? :confused:

                          i think there should be a function somethin like security question? so that if someone might know your email add, they cant just resend it anytime they want.

                          Comment


                            #14
                            Originally posted by modfiles View Post
                            how did you know its unsafe if you say that you didnt bothered to look out the code? :confused:

                            i think there should be a function somethin like security question? so that if someone might know your email add, they cant just resend it anytime they want.
                            lol u can c tht from the plain LMAO
                            sigpiceeeeerrr....

                            Comment


                              #15
                              try something like this

                              PHP Code:
                                 <?php
                              include 'config.php';
                              include 
                              'core.php';


                              if(isset(
                              $_POST['submit']))
                              {    
                                
                              $email=$_POST['email'];
                                
                              $getinfo="SELECT login from users where email='$email'";
                                
                              $getinfo2=mysql_query($getinfo) or die("Could not get info");
                                
                              $getinfo3=mysql_fetch_assoc($getinfo2);
                                if(
                              $getinfo3)
                                {
                                   
                              $pass substr(preg_replace('/\W/'''md5(rand())), 08);
                                   
                              $changepassmysql_query("update `users` SET `pass`='".md5($pass)."' WHERE `email`='".$email."'");
                                   
                              mail("$email","From Chat-Zone.mobI","Your login details login $getinfo3[login] &Password $pass");   
                                   print 
                              "Instruction for changing your password have been mailed to you.";
                                }
                                else
                                {

                                  print 
                              "Retrieve Password";
                                  print 
                              "There is not a user with that e-mail address";
                                }
                                
                              }
                              else
                              {

                                print 
                              "<form method='POST' action='getpassword.php'>";
                                print 
                              "Your e-mail:</td><td><input type='text' name='email' length='45'>";
                                print 
                              "<input type='submit' name='submit' value='submit'>";
                              }
                              ?>

                              Comment

                              Working...
                              X