Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Setting Username dan Password
- $username = $_POST['email'];
- $password = $_POST['pwd'];
- $ch = curl_init('http://localhost/curl/login.php');
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch,CURLOPT_POST,1);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
- curl_setopt($ch,CURLOPT_POST,TRUE);
- curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
- curl_setopt($ch,CURLOPT_COOKIEFILE,"ikisme.txt");
- curl_setopt($ch,CURLOPT_COOKIEJAR, "ikisme.txt");
- curl_setopt($ch,CURLOPT_POSTFIELDS,"email='.$username.'&password='.$password.'");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- $result = curl_exec($ch);
- if ($result == "OK") {
- echo"Anda berhasil login";
- } else {
- echo"Login gagal coba lagi";
- }
- curl_close ($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement