Jump to content

php recover all id


Recommended Posts

  • Premium

Hi. How can i recover all ID from same email to email?

I have this, but for some reason it dont work.

 

if(isset($_POST['idrecover']) && $_POST['idrecover']=="Recuperar") {
    
    if(checkMail($_POST['idemail'])) {
      
      $email = mysql_real_escape_string($_POST['idemail']);

      
      $getUser = "SELECT login FROM account.account WHERE email='".$email."' LIMIT 100";
      $qryUser = mysql_query($getUser);
      
      if(mysql_num_rows($qryUser)>0) {
      
        $qryPass =  mysql_query($getUser);
        $login = mysql_real_escape_string($getUser);
        
        if($qryPass) {
          echo'<p class="meldung">xxxxxx';
          
          $absender = $serverSettings['titel']." Recuperação";
          $email = $serverSettings['pass_mail'];
          $empfaenger = $_POST['idemail'];
          $mail_body = "
          
          Hellou!! This is realy funny, but dont Work.
          
          
          ID: ".$login." ----------->>>> i wanna see all logins in Here!!!!
          
          
          
         
          
          $titel = "Recuperação de Password ".$serverSettings['titel'];
          
          $header .= "X-Priority: 3\n";
          $header .= "X-Mailer: mtVision Homepage Mailer\n";
          $header .= "MIME-Version: 1.0\n";
          $header .= "From: ".$absender." <".$serverSettings['pass_mail'].">\n";
          $header .= "Reply-To: ".$serverSettings['pass_mail']."\n";
          //$header .= "Content-Transfer-Encoding: 8bit\n"; 
          $header .= "Content-Type: text/plain; charset=iso-8859-1\n";
          
          if(!mail($empfaenger, $titel, $mail_body, $header)) {
            echo'<p class="meldung">xxxxxx';
          }
          
        }
        else {
          echo'<p class="meldung">xxxxxx';
        }
        
      }
      else {
        echo'<p class="meldung">xxxxxx';
      }
      
    }
    else {
      echo'<p class="meldung">xxxxxx';
    }
    
  }

Edited by EnKor
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
Share on other sites

Try this

 

<?php 
if(isset($_POST['idrecover']) && $_POST['idrecover']=="Recuperar") {
    
    if(checkMail($_POST['idemail'])) {
      
      $email = mysql_real_escape_string($_POST['idemail']);

      
      $query = "SELECT login FROM account.account WHERE email='".$email."' LIMIT 100";
      $result = mysql_query($query);
	  
		echo'<p class="meldung">xxxxxx';
		$absender = $serverSettings['titel']." Recuperação";
		$email = $serverSettings['pass_mail'];
		$empfaenger = $_POST['idemail'];
      if(mysql_num_rows($result)>0) {
      
        //$qryPass =  mysql_query($getUser);
		while($row = mysql_fetch_assoc($result)) {
			$mail_body = "
          
          Hellou!! This is realy funny, but dont Work.
          
          
          ID: ".$row['login']." ----------->>>> i wanna see all logins in Here!!!!";
		}          
          $titel = "Recuperação de Password ".$serverSettings['titel'];
          
          $header .= "X-Priority: 3\n";
          $header .= "X-Mailer: mtVision Homepage Mailer\n";
          $header .= "MIME-Version: 1.0\n";
          $header .= "From: ".$absender." <".$serverSettings['pass_mail'].">\n";
          $header .= "Reply-To: ".$serverSettings['pass_mail']."\n";
          //$header .= "Content-Transfer-Encoding: 8bit\n"; 
          $header .= "Content-Type: text/plain; charset=iso-8859-1\n";
          
          if(!mail($empfaenger, $titel, $mail_body, $header)) {
            echo'<p class="meldung">xxxxxx';
          }
        
      }
      else {
        echo'<p class="meldung">xxxxxx';
      }
      
    }
    else {
      echo'<p class="meldung">xxxxxx';
    }
    
  }

?>

 

Link to comment
Share on other sites

i wrote that for you. NOT TESTED!

<?php
if(isset($_POST['idrecover']) && $_POST['idrecover']=="Recuperar") {
    if (checkMail($_POST['idemail'])) {
        $email = mysql_real_escape_string($_POST['idemail']);
        $getUser = "SELECT login FROM account.account WHERE email='" . $email . "'";
        $qryUser = mysql_query($getUser);

        if (mysql_num_rows($qryUser) > 0) {
            // Set empty array
            $foundLogins = array();
            // get all User IDs with the given email
            while ($row = mysql_fetch_array($qryUser)) {
                $foundLogins[] = $row['login'];
            }
            // config email
            $from = "[email protected]"; // email (from)
            $to = "[email protected]"; // email (to)
            $subject = "Subject"; // Subject

            $message = "Found the following IDs with the email " . $email . ":";
            foreach ($foundLogins as $foundLogin) {
                $message .= "ID: " . $foundLogin . " ,";
            }

            // set email header
            $headers = array();
            $headers[] = "MIME-Version: 1.0";
            $headers[] = "Content-type: text/plain; charset=iso-8859-1";
            $headers[] = "From: Sender Name <$from>";
            $headers[] = "Reply-To: Recipient Name <$from>";
            $headers[] = "Subject: {$subject}";
            $headers[] = "X-Mailer: PHP/" . phpversion();

            // send mail
            if (!mail($to, $subject, $message, implode("\r\n", $headers))) {
                echo "Email could not send";
            } else {
                echo "Email send";
            }
        } else {
            echo "No entries found with this email";
        }
    } else {
        echo "email not valid";
    }
} else {
    echo "fill the formular";
}
?>

Edit: Better without foreach:

<?php
if(isset($_POST['idrecover']) && $_POST['idrecover']=="Recuperar") {
    if (checkMail($_POST['idemail'])) {
        $email = mysql_real_escape_string($_POST['idemail']);
        $getUser = "SELECT login FROM account.account WHERE email='" . $email . "'";
        $qryUser = mysql_query($getUser);

        if (mysql_num_rows($qryUser) > 0) {
            // Set empty array
            $foundLogins = array();
            // get all User IDs with the given email
            while ($row = mysql_fetch_array($qryUser)) {
                $foundLogins[] = $row['login'];
            }
            // config email
            $from = "[email protected]"; // email (from)
            $to = "[email protected]"; // email (to)
            $subject = "Subject"; // Subject

            $message = "Found the following IDs with the email " . $email . ": ";
            $comma_separated = implode(",", $foundLogins);
            $finalMessage = $message.$comma_separated;

            // set email header
            $headers = array();
            $headers[] = "MIME-Version: 1.0";
            $headers[] = "Content-type: text/plain; charset=iso-8859-1";
            $headers[] = "From: Sender Name <$from>";
            $headers[] = "Reply-To: Recipient Name <$from>";
            $headers[] = "Subject: {$subject}";
            $headers[] = "X-Mailer: PHP/" . phpversion();

            // send mail
            if (!mail($to, $subject, $finalMessage, implode("\r\n", $headers))) {
                echo "Email could not send";
            } else {
                echo "Email send";
            }
        } else {
            echo "No entries found with this email";
        }
    } else {
        echo "email not valid";
    }
} else {
    echo "fill the formular";
}
?>

 

Edited by Ayaka
  • Love 1
Link to comment
Share on other sites

Try this

 

<?php
if(isset($_POST['idrecover']) && $_POST['idrecover']=="Recuperar") {
    if (checkMail($_POST['idemail'])) {
        $email = mysql_real_escape_string($_POST['idemail']);
        $getUser = "SELECT login FROM account.account WHERE email='" . $email . "'";
        $qryUser = mysql_query($getUser);

        if (mysql_num_rows($qryUser) > 0) {
            // Set empty array
            $foundLogins = array();
            // get all User IDs with the given email
            while ($row = mysql_fetch_array($qryUser)) {
                $foundLogins[] = $row['login'];
            }
            // config email
            $from = "[email protected]"; // email (from)
            $to = "[email protected]"; // email (to)
            $subject = "Subject"; // Subject

            $message = "Found the following IDs with the email " . $email . ": ";
            $comma_separated = implode(",", $foundLogins);
            $finalMessage = $message.$comma_separated."</br>";

            // set email header
            $headers = array();
            $headers[] = "MIME-Version: 1.0";
            $headers[] = "Content-type: text/plain; charset=iso-8859-1";
            $headers[] = "From: Sender Name <$from>";
            $headers[] = "Reply-To: Recipient Name <$from>";
            $headers[] = "Subject: {$subject}";
            $headers[] = "X-Mailer: PHP/" . phpversion();

            // send mail
            if (!mail($to, $subject, $finalMessage, implode("\r\n", $headers))) {
                echo "Email could not send";
            } else {
                echo "Email send";
            }
        } else {
            echo "No entries found with this email";
        }
    } else {
        echo "email not valid";
    }
} else {
    echo "fill the formular";
}
?>

 

Link to comment
Share on other sites

nope. you have to set the linebreak right in and after the implode function. <br> isnt working because you have to set "\r\n" for linebreaks in mail function in this case.

replace

$comma_separated = implode(",", $foundLogins);

with

$comma_separated = implode("\r\n",$foundLogins)."\r\n";

 

Edited by Ayaka
  • Love 1
Link to comment
Share on other sites

  • Premium

nope. you have to set the linebreak right after the implode function. <br> isnt working because you have to set "\r\n" for linebreaks in mail function.

replace

$comma_separated = implode(",", $foundLogins);

with

$comma_separated = implode("\r\n",$foundLogins)."\r\n";

 

Now it works 100% ;)

really grateful for your help

  • Love 1
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
Share on other sites

  • Honorable Member

nope. you have to set the linebreak right in and after the implode function. <br> isnt working because you have to set "\r\n" for linebreaks in mail function in this case.

replace

$comma_separated = implode(",", $foundLogins);

with

$comma_separated = implode("\r\n",$foundLogins)."\r\n";

 

that's not 100% right. if you are able to read html emails, <br/> will work - for example in googlemail.

but \r\n is the better solution

Link to comment
Share on other sites

nope. you have to set the linebreak right in and after the implode function. <br> isnt working because you have to set "\r\n" for linebreaks in mail function in this case.

replace

$comma_separated = implode(",", $foundLogins);

with

$comma_separated = implode("\r\n",$foundLogins)."\r\n";

 

that's not 100% right. if you are able to read html emails, <br/> will work - for example in googlemail.

but \r\n is the better solution

as i wrote "in this case". We have a text mail not a html mail. Maybe some email clients can read br tags in text mails but it is wrong to do it with this content type

Content-type: text/plain
Edited by Ayaka
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.