Last active
January 19, 2016 13:59
-
-
Save VictorFursa/6e79558d7e3506e3c3d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include "Curl.php"; | |
| class Kinopoisk{ | |
| private $refer = 'http://www.kinopoisk.ru/'; | |
| private $loginUrl = "http://www.kinopoisk.ru/login/"; | |
| private $curl; | |
| function __construct($username, $password){ | |
| $curl = new Curl($this->loginUrl); | |
| $curl->setRefer($this->refer); | |
| $formData = array( | |
| "shop_user" => array( | |
| "login" => $username, | |
| "pass" => $password, | |
| "mem" => "on" | |
| ), | |
| "auth"=>"войти на сайт"); | |
| $curl->setReturnTransfer(true); | |
| $curl->sendPostForm($formData); | |
| $curl->exec(); | |
| $curl->close(); | |
| } | |
| function getPage($url){ | |
| $this->curl = curl_init($url); | |
| curl_setopt($this->curl, CURLOPT_URL,$url); | |
| curl_setopt($this->curl, CURLOPT_RETURNTRANSFER,true); | |
| curl_setopt($this->curl, CURLOPT_REFERER, $url); | |
| $out = curl_exec($this->curl); | |
| echo $out; | |
| } | |
| } | |
| $Kino = new Kinopoisk('Zir4onah', '540919zir'); | |
| $Kino ->getPage('http://www.kinopoisk.ru/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment