本文整理汇总了PHP中Curl::setCookieFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Curl::setCookieFile方法的具体用法?PHP Curl::setCookieFile怎么用?PHP Curl::setCookieFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curl
的用法示例。
在下文中一共展示了Curl::setCookieFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCookieFile
public function setCookieFile($file)
{
$this->curl->setCookieFile($file);
return $this;
}
示例2: Curl
<?php
require_once '../src/Curl.php';
$curl = new Curl();
$result = $curl->setCookieFile()->sendCookieData(['chave' => 'valor'])->get('http://httpbin.org/cookies');
var_dump($result);
示例3: Curl
<?php
set_time_limit(0);
require_once "../curl.class.php";
$hn_user = "";
$hn_pass = "";
$curl = new Curl();
$curl->setSsl();
$curl->setCookieFile("cookie.txt");
libxml_use_internal_errors(true);
$page = $curl->get("https://news.ycombinator.com/newslogin?whence=news");
$dom = new DOMDocument();
$dom->loadHTML($page);
$fnid = false;
$inputs = $dom->getElementsByTagName('input');
for ($i = 0; $i < $inputs->length; $i++) {
if ($inputs->item($i)->getAttribute("name") == "fnid") {
$fnid = $inputs->item($i)->getAttribute("value");
break;
}
}
if (!$fnid) {
print "can't find fnid\n";
exit;
}
$data = array("fnid" => $fnid, "u" => $hn_user, "p" => $hn_pass);
$page = $curl->post("https://news.ycombinator.com/y", $data);
print $page;
示例4: array
$id = false;
}
if (!$id) {
$return = array("status" => 99);
print json_encode($return);
exit;
}
require_once "../../vars.php";
require_once "../../includes/curl.php";
require_once "../../includes/show.class.php";
require_once "../../includes/settings.class.php";
require_once "../../includes/tvlinks.class.php";
$settings = new Settings();
$shows = new Show();
$curl = new Curl();
$curl->setCookieFile($basepath . "/cachefiles/tvlinkscookie.txt");
$tv = new TVlinks($curl);
sleep(2);
$return = array();
if (isset($id) && $id && is_numeric($id)) {
$show = $shows->getEpisodeById($id, "en");
if (count($show)) {
$sr = $settings->getSetting("tvlinks");
if ($tv->login($sr->username, $sr->password)) {
$url = $baseurl . $show['url'];
$link = $tv->submit($show['showtitle'], $show['season'], $show['episode'], $url);
if ($link) {
$shows->addSubmit($id, 7, $link);
$return['status'] = 1;
$return['link'] = $link;
} else {