Plz fix ad4ean forget password code

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

    Plz fix ad4ean forget password code

    PHP Code:
    <title>Nepali AD Network | Forgot Password</title>
    <?php 
     
    include "inc/header.php";
     include 
    "inc/def.php";
     include 
    "inc/usrchk.php";
    if(
    $guest==0) {
        
    header("location:home.php");
    }
    ?>

    <?php
    function rndgen ($minlength$maxlength$useupper$usespecial$usenumbers)
    {
    $charset "abcdefghijklmnopqrstuvwxyz";
    if (
    $useupper$charset .= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    if (
    $usenumbers$charset .= "0123456789";
    if (
    $usespecial$charset .= "~@#$%^*()_+-={}|]["// Note: using all special characters this reads: "~!@#$%^&*()_+`-={}|\\]?[\":;'><,./";
    if ($minlength $maxlength$length mt_rand ($maxlength$minlength);
    else 
    $length mt_rand ($minlength$maxlength);
    for (
    $i=0$i<$length$i++) $key .= $charset[(mt_rand(0,(strlen($charset)-1)))];
    return 
    $key;
    }
    $hammad rand(1,1000);
    $code secure('code');
    $sec secure('secode');
    if(isset(
    $_POST['mail'])) {
    $mail secure('mail');
    $get mysql_query("SELECT * FROM users WHERE mail='$mail'") or die('Oops Error....');
    $get1 mysql_fetch_array($get);
    $usr $get1['user'];
    $mail $get1['mail'];
    $id $get1['id'];
    if(
    $sec!=$code)
    {
        print 
    "<div class='prob'>Wrong security code !</div>";
        die();
    }
    if(
    mysql_num_rows($get)==0) {
        die(
    "NO such user !");
    } else {
        
    $key rndgen(10,10,false,false,true);
    $pass md5($key);    
    }
    $dox mysql_query("UPDATE users SET pass='$pass' WHERE id='$id'");
    $to "$mail";
    $subject "Password Reset - NepalAD Network";
    $message "Hello $usr
    You have Just Request New Password.
    Your New passwod : 
    $key
    Regards
    AdNepal Team"
    ;
    $from "noreply@nepalwap.com";
    $headers "From: $from";
    mail($to,$subject,$message,$headers);
    if(
    $dox) {
        print 
    "<div class='adbox'>New Password Have Been Send to Your Email. Now  Login<a href='login.php'>here</a></div>";
    }
    ?>
    <div class="line">Forgot Password ?</div>
    <form action="forgot.php" method="post">
    <div class="lgn">E-Mail Address : <br />
    <input size="30" maxlength="35" type="text" name="mail" /></div>
    <?php
    echo "<div class='lgn'>Security Code : '$hammad'<br />
    <input size='30' maxlength='3' type='hidden' value ='
    $hammad' name='secode' />
    <input size='30' maxlength='3' type='text' name='code' /></div>
    <div class='lwt'>
    <input type='submit' value='Get password' />
    </div>"
    ;
    ?>
    </form>
    <a href="login.php"><b>Login here</b></a>
    <?php include "inc/footer.php"?>
    Last edited by Nepsalone; 16.07.12, 12:09.

    #2
    please edit you post and wrap the code in a php bbcode.

    posts like this just make the threads ugly and hard to read.
    <?php
    include ('Ghost');
    if ($Post == true) {
    echo '

    sigpic
    alt='coding-talk.com!!' />';
    echo 'Sharing Is Caring!';
    } else {
    echo '

    alt='the username GHOST has been comprimised!' />';
    echo 'OMG SOMEBODY HELP ME!!';
    }
    ?>

    Comment


      #3
      Ghost plz fix it

      Comment


        #4
        Originally posted by Nepsalone View Post
        Ghost plz fix it
        try this

        PHP Code:
        <title>Nepali AD Network | Forgot Password</title> 
        <?php  
         
        include("inc/header.php"); 
         include(
        "inc/def.php"); 
         include(
        "inc/usrchk.php"); 
        if(
        $guest==0) { 
            
        header("location:home.php"); 

        ?> 

        <?php 
        function rndgen ($minlength$maxlength$useupper$usespecial$usenumbers

        $charset "abcdefghijklmnopqrstuvwxyz"
        if (
        $useupper$charset .= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        if (
        $usenumbers$charset .= "0123456789"
        if (
        $usespecial$charset .= "~@#$%^*()_+-={}|]["// Note: using all special characters this reads: "~!@#$%^&*()_+`-={}|\\]?[\":;'><,./"; 
        if ($minlength $maxlength$length mt_rand ($maxlength$minlength); 
        else 
        $length mt_rand ($minlength$maxlength); 
        for (
        $i=0$i<$length$i++) $key .= $charset[(mt_rand(0,(strlen($charset)-1)))]; 
        return 
        $key

        $hammad rand(1,1000); 
        $code secure('code'); 
        $sec secure('secode'); 
        if(isset(
        $_POST['mail'])) { 
        $mail secure('mail'); 
        $get mysql_query("SELECT * FROM users WHERE mail='$mail'") or die('Oops Error....'); 
        $get1 mysql_fetch_array($get); 
        $usr $get1['user']; 
        $mail $get1['mail']; 
        $id $get1['id']; 
        if(
        $sec!=$code

            print 
        "<div class='prob'>Wrong security code !</div>"
            die(); 

        if(
        mysql_num_rows($get)==0) { 
            die(
        "NO such user !"); 
        } else { 
            
        $key rndgen(10,10,false,false,true); 
        $pass md5($key);     

        $dox mysql_query("UPDATE users SET pass='$pass' WHERE id='$id'"); 
        $to "$mail"
        $subject "Password Reset - NepalAD Network"
        $message "Hello $usr 
        You have Just Request New Password. 
        Your New passwod : 
        $key 
        Regards 
        AdNepal Team"

        $from "noreply@nepalwap.com"
        $headers "From: $from"
        mail($to,$subject,$message,$headers); 
        if(
        $dox) { 
            print 
        "<div class='adbox'>New Password Have Been Send to Your Email. Now  Login<a href='login.php'>here</a></div>"
        }

        ?> 
        <div class="line">Forgot Password ?</div> 
        <form action="forgot.php" method="post"> 
        <div class="lgn">E-Mail Address : <br /> 
        <input size="30" maxlength="35" type="text" name="mail" /></div> 
        <?php
        echo "<div class='lgn'>Security Code : '$hammad'<br /> 
        <input size='30' maxlength='3' type='hidden' value ='
        $hammad' name='secode' /> 
        <input size='30' maxlength='3' type='text' name='code' /></div> 
        <div class='lwt'> 
        <input type='submit' value='Get password' /> 
        </div>"

        ?> 
        </form> 
        <a href="login.php"><b>Login here</b></a> 
        <?php include("inc/footer.php"); ?>
        sytax error free. it was missing a } in the code and also ( ) on includes
        Last edited by Ghost; 16.07.12, 14:08. Reason: INFO ON SYNTAX ERRORS
        <?php
        include ('Ghost');
        if ($Post == true) {
        echo '

        sigpic
        alt='coding-talk.com!!' />';
        echo 'Sharing Is Caring!';
        } else {
        echo '

        alt='the username GHOST has been comprimised!' />';
        echo 'OMG SOMEBODY HELP ME!!';
        }
        ?>

        Comment


          #5
          I also faced this problem when creating Adfresh. Only a } is missing.

          Comment


            #6
            requesting my forget password option my site redirecting to 404 page not found page. Please check it Nepali Mobile AD Network

            im facing once more problem in my host guest also can acces my user control panel page
            check it
            User Cpanel

            Comment


              #7
              Originally posted by Nepsalone View Post
              requesting my forget password option my site redirecting to 404 page not found page. Please check it Nepali Mobile AD Network

              im facing once more problem in my host guest also can acces my user control panel page
              check it
              User Cpanel
              try changing >>> <form action="forgot.php" method="post">
              to this >>> <form action="forgotpass.php" method="post">

              as your file is calling itself it needs to be the same name as the file you named it.
              <?php
              include ('Ghost');
              if ($Post == true) {
              echo '

              sigpic
              alt='coding-talk.com!!' />';
              echo 'Sharing Is Caring!';
              } else {
              echo '

              alt='the username GHOST has been comprimised!' />';
              echo 'OMG SOMEBODY HELP ME!!';
              }
              ?>

              Comment


                #8
                my 1st problem solved.
                what can i do for second option plz help me im working in this script at last 15 days bt i cant solve this problem. This script working fine in wamp server

                Comment


                  #9
                  for your cpanel error we would have to see the file in question. although that doesnt mean ill be able to fix it. but it does mean other ppl have a chance to help you also as they too can see the code.
                  <?php
                  include ('Ghost');
                  if ($Post == true) {
                  echo '

                  sigpic
                  alt='coding-talk.com!!' />';
                  echo 'Sharing Is Caring!';
                  } else {
                  echo '

                  alt='the username GHOST has been comprimised!' />';
                  echo 'OMG SOMEBODY HELP ME!!';
                  }
                  ?>

                  Comment


                    #10
                    im also getting this problem in http://nepalwap.com.nu
                    bro wait im upload here my eror log file

                    Added after 2 minutes:

                    [16-Jul-2012 13:16:55] PHP Warning: Cannot modify header information - headers already sent by (output started at /home3/nepalwap/public_html/ads/home.php:5) in /home3/nepalwap/public_html/ads/home.php on line 8
                    [16-Jul-2012 13:20:21] PHP Warning: Cannot modify header information - headers already sent by (output started at /home3/nepalwap/public_html/ads/home.php:5) in /home3/nepalwap/public_html/ads/home.php on line 8
                    [16-Jul-2012 13:34:08] PHP Warning: Cannot modify header information - headers already sent by (output started at /home3/nepalwap/public_html/ads/home.php:5) in /home3/nepalwap/public_html/ads/home.php on line 8
                    Last edited by Nepsalone; 16.07.12, 19:37.

                    Comment


                      #11
                      you could try putting something like this at top of page but not sure how it will work out 100% for you.


                      PHP Code:
                        /** Prevent direct access from url to this file */
                      if (stristr(htmlentities($_SERVER['SCRIPT_NAME']), 'home.php')) 
                      {
                      echo 
                      '<meta http-equiv="Refresh" content="0; url=../../index.php">';
                           die();
                      }
                      //
                      //
                      //
                      // 
                      or try make it more secure so only you can access it.
                      PHP Code:
                        /** Prevent direct access from url to this file */
                      if (stristr(htmlentities($_SERVER['SCRIPT_NAME']), 'home.php')) 
                      {
                      echo 
                      '<meta http-equiv="Refresh" content="0; url=../../index.php">';
                           die();
                      }
                      else if(
                      $password == 'password' && $username == 'username')
                      {
                      //show script inside here.
                      }
                      //
                      //
                      //
                      // 
                      the if($password == 'password' && $username == 'username') section would need modding to your database details

                      i dont normally go near mysql files so this is just a php throw together.

                      just a suggestion. but im pretty sure other ppl will chime in here with much better solutions to suit your needs more.

                      Added after 3 minutes:

                      Originally posted by Nepsalone View Post
                      im also getting this problem in Nepali Mobile AD Network
                      bro wait im upload here my eror log file

                      Added after 2 minutes:

                      [16-Jul-2012 13:16:55] PHP Warning: Cannot modify header information - headers already sent by (output started at /home3/nepalwap/public_html/ads/home.php:5) in /home3/nepalwap/public_html/ads/home.php on line 8
                      [16-Jul-2012 13:20:21] PHP Warning: Cannot modify header information - headers already sent by (output started at /home3/nepalwap/public_html/ads/home.php:5) in /home3/nepalwap/public_html/ads/home.php on line 8
                      [16-Jul-2012 13:34:08] PHP Warning: Cannot modify header information - headers already sent by (output started at /home3/nepalwap/public_html/ads/home.php:5) in /home3/nepalwap/public_html/ads/home.php on line 8
                      this is a commen problem with headers. when another header is also being sent from an include file.

                      try changing this
                      PHP Code:
                          header("location:home.php");  
                       

                      //
                      //
                      // 
                      to this
                      PHP Code:

                       
                      echo '<meta http-equiv="Refresh" content="0; url=home.php">';


                      //
                      // 
                      it should fix it.


                      obviously change the home.php to the correct file your header is pointing to.
                      i took this header details from the posts above (forgotpass.php) as an example
                      Last edited by Ghost; 16.07.12, 19:49.
                      <?php
                      include ('Ghost');
                      if ($Post == true) {
                      echo '

                      sigpic
                      alt='coding-talk.com!!' />';
                      echo 'Sharing Is Caring!';
                      } else {
                      echo '

                      alt='the username GHOST has been comprimised!' />';
                      echo 'OMG SOMEBODY HELP ME!!';
                      }
                      ?>

                      Comment


                        #12
                        ok bro im try to fix it
                        bro im pasting here my home.php code
                        PHP Code:
                        <html>
                        <title> User Cpanel</title>
                        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
                        <link href="style.css" rel="stylesheet" type="text/css" />
                        <?php include "inc/def.php"?>
                        <?php 
                        include "inc/usrchk.php";
                        if(
                        $guest==1) {
                            
                        header("location:index.php");
                        ?>

                        <div class="blk">
                        <b>Hello, <?php echo $user?></b>
                        </div>
                        <?php if($guest==0) { ?>
                        <?php
                        $getu 
                        mysql_query("SELECT * FROM users WHERE user='$user'");
                        $getu1 mysql_fetch_array($getu);
                        $id $getu1['id'];
                        $bal $getu1['bal'];
                        $pnt $getu1['point'];
                        $getimp mysql_query("SELECT * FROM imp WHERE uid='$id'");
                        $imp mysql_num_rows($getimp);
                        $getclk mysql_query("SELECT * FROM clicks WHERE uid='$id'");
                        $clk mysql_num_rows($getclk);
                        print 
                        "<div class='lwt'>You Have <font color=red>$pnt</font>Publisher Points</div>";
                        ?>
                        <?php 
                        } else { ?>
                        <?php 
                        ?>
                        <div class="line">Account Panel</div>
                        <div class="lwt"><a href="changepass.php">Change Password</a></div>
                        <div class="lgn"><a href="editac.php">Edit Account Details</a></div>

                        <div class="line">Publisher Panel</div>
                        <div class="lgn"><a href="pub_htmlcode.php">Get HTML Code</a></div>
                        <div class="lwt"><a href="pub_phpcode.php">Get PHP Code</a></div>
                        <div class="lgn"><a href="pub_history.php">Earning Statistics & Payout</a></div>
                        <div class="lwt"><a href="pub_today.php">Today's Statistics</a></div>

                        <div class="line">Advertiser Panel</div>
                        <div class="lwt"><a href="adv_create.php">Create Ur Advertise</a></div>
                        <div class="lgn"><a href="adv_history.php">History</a>
                        </div>
                        <div class="lwt"><a href="adv_view.php">View Campaigns</a></div>
                        <div class="line"><a href="logout.php">Logout</a></div>
                        <?php include "inc/footer.php"?>
                        </html>
                        Last edited by Nepsalone; 16.07.12, 19:59.

                        Comment


                          #13
                          PHP Code:
                          <html> 
                          <title> User Cpanel</title> 
                          <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">  
                          <link href="style.css" rel="stylesheet" type="text/css" /> 
                          <?php include("inc/def.php"); ?> 
                          <?php include("inc/usrchk.php"); 
                          if(
                          $guest==1) { 
                          echo 
                          '<meta http-equiv="Refresh" content="0; url=index.php">';
                          ?> 

                          <div class="blk"> 
                          <b>Hello, <?php echo $user?></b> 
                          </div> 
                          <?php if($guest==0) { ?> 
                          <?php 
                          $getu 
                          mysql_query("SELECT * FROM users WHERE user='$user'"); 
                          $getu1 mysql_fetch_array($getu); 
                          $id $getu1['id']; 
                          $bal $getu1['bal']; 
                          $pnt $getu1['point']; 
                          $getimp mysql_query("SELECT * FROM imp WHERE uid='$id'"); 
                          $imp mysql_num_rows($getimp); 
                          $getclk mysql_query("SELECT * FROM clicks WHERE uid='$id'"); 
                          $clk mysql_num_rows($getclk); 
                          print 
                          "<div class='lwt'>You Have <font color=red>$pnt</font>Publisher Points</div>"
                          ?> 
                          <?php } else { ?> 
                          <?php ?> 
                          <div class="line">Account Panel</div> 
                          <div class="lwt"><a href="changepass.php">Change Password</a></div> 
                          <div class="lgn"><a href="editac.php">Edit Account Details</a></div> 

                          <div class="line">Publisher Panel</div> 
                          <div class="lgn"><a href="pub_htmlcode.php">Get HTML Code</a></div> 
                          <div class="lwt"><a href="pub_phpcode.php">Get PHP Code</a></div> 
                          <div class="lgn"><a href="pub_history.php">Earning Statistics & Payout</a></div> 
                          <div class="lwt"><a href="pub_today.php">Today's Statistics</a></div> 

                          <div class="line">Advertiser Panel</div> 
                          <div class="lwt"><a href="adv_create.php">Create Ur Advertise</a></div> 
                          <div class="lgn"><a href="adv_history.php">History</a> 
                          </div> 
                          <div class="lwt"><a href="adv_view.php">View Campaigns</a></div> 
                          <div class="line"><a href="logout.php">Logout</a></div> 
                          <?php include("inc/footer.php"); ?> 
                          </html>
                          try that to start with.
                          <?php
                          include ('Ghost');
                          if ($Post == true) {
                          echo '

                          sigpic
                          alt='coding-talk.com!!' />';
                          echo 'Sharing Is Caring!';
                          } else {
                          echo '

                          alt='the username GHOST has been comprimised!' />';
                          echo 'OMG SOMEBODY HELP ME!!';
                          }
                          ?>

                          Comment


                            #14
                            after putting ds code im unable to login my site

                            Added after 4 minutes:

                            thanx bro its working fine

                            Added after 2 minutes:

                            Now my all problem solved thanx my dear Ghost
                            im so happy with U.
                            I hope U help me next time also.
                            Last edited by Nepsalone; 16.07.12, 20:36.

                            Comment


                              #15
                              Edit oh good its fixed then? your welcome. glad i was able to help somehow
                              Last edited by Ghost; 16.07.12, 20:39.
                              <?php
                              include ('Ghost');
                              if ($Post == true) {
                              echo '

                              sigpic
                              alt='coding-talk.com!!' />';
                              echo 'Sharing Is Caring!';
                              } else {
                              echo '

                              alt='the username GHOST has been comprimised!' />';
                              echo 'OMG SOMEBODY HELP ME!!';
                              }
                              ?>

                              Comment

                              Working...
                              X