PHP Password call code

Discussion in 'PHP' started by Warez Dominator, Nov 16, 2011.

  1. #1
    Hello,

    Need some help in PHP callback i mean
    there is php file called test.php
    when it will communication with a API server such as

    http://www.myexample.com/test.php?ip=xxx-xxx-xxx-xxx&pass=[some generated password for login]&email=myemail@gmail.com

    what i want is the when a call back is done your own site
    test.php will email to your mail with the content of [some generated password for login]

    So can anyone say what code should be inside the test.php so that it can get the generated password and send to the mail ID.

    Regards
     
    Warez Dominator, Nov 16, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    
    $password = $_GET['pass'];
    
    if(mail($to, $subject, $message, $headers, $returnpath)) {
      //echo that mail was sent
    } else {
      //echo that there was a problem sending mail
    }
    
    PHP:
     
    Rukbat, Nov 16, 2011 IP
  3. Warez Dominator

    Warez Dominator Member

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #3
    Please correct me whether i am saying wrong or correct

    $password = $_GET['pass'];
    $to =  "me@gmail.com";
    $subject = "Your Password";
    $message = $password;
    if(mail($to, $subject, $message, $headers, $returnpath)) {
      //echo that mail was sent
    } else {
      //echo that there was a problem sending mail
    }
    PHP:
    Regards
     
    Warez Dominator, Nov 16, 2011 IP
  4. Jaxo

    Jaxo Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Almost! You still need your $headers variable, though.

    Try using these, for starters:

    
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "To: ".$_GET['username'] ."<me@gmail.com>"."\r\n";
    $headers .= "From: Warez Dominator"."\r\n";
    
    PHP:
    That will allow you to even send HTML in your email!
     
    Jaxo, Nov 22, 2011 IP
  5. akbarul

    akbarul Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Can anyone help to explain to me? I don't know about this. Just subscribing.
     
    akbarul, Nov 23, 2011 IP