本文整理汇总了PHP中geturl函数的典型用法代码示例。如果您正苦于以下问题:PHP geturl函数的具体用法?PHP geturl怎么用?PHP geturl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了geturl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMUSites
function GetMUSites($page = '')
{
global $cookie, $domain;
if (empty($page)) {
$page = geturl($domain, 80, "/", 0, $cookie);
is_page($page);
if (preg_match('@Location: http://([^/|\\r|\\n]+)/@i', $page, $rd)) {
$domain = $rd[1];
$page = geturl($domain, 80, "/", 0, $cookie);
is_page($page);
}
$cookie = GetCookiesArr($page);
}
if (!preg_match_all("@showdetails\\('(\\w+)'\\)@i", $page, $hosts)) {
html_error('Cannot Check Supported Sites [1]');
}
$sites = array();
foreach ($hosts[1] as $host) {
$popup = cut_str($page, 'id="details_' . $host . '">', '</div></div>');
if (empty($popup) || (!preg_match('@"(?:http://[^"]+/)?logos/(\\d+)\\.[^"]+"@i', $popup, $hid) || !preg_match('@Upload files directly into my ([^\\"|\'|\\<|\\:]+) account\\:@i', $popup, $name))) {
html_error("Cannot Check Supported Sites [2 ({$host})]");
}
$name[1] = trim($name[1]);
if ($hid[1] != 14) {
$sites[] = array('hname' => $name[1], 'id' => $hid[1], 'sname' => $host);
}
unset($popup, $hid, $name);
}
return $sites;
}
示例2: SendLogin
function SendLogin($post)
{
global $_T8, $referer, $cookie, $pauth;
$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'] . '?op=login', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
is_page($page);
if (!($form = cut_str($page, '<form', '</form>'))) {
html_error('Cannot find login form.');
}
if (!($post['rand'] = cut_str($page, 'name="rand" value="', '"'))) {
html_error('Login form "rand" not found.');
}
if (substr_count($form, "<span style='position:absolute;padding-left:") > 3 && preg_match_all("@<span style='[^\\'>]*padding-left\\s*:\\s*(\\d+)[^\\'>]*'[^>]*>((?:&#\\w+;)|(?:\\d))</span>@i", $form, $txtCaptcha)) {
// Text Captcha (decodeable)
$txtCaptcha = array_combine($txtCaptcha[1], $txtCaptcha[2]);
ksort($txtCaptcha, SORT_NUMERIC);
$txtCaptcha = trim(html_entity_decode(implode($txtCaptcha), ENT_QUOTES, 'UTF-8'));
$post['code'] = $txtCaptcha;
} else {
html_error('Login captcha not found.');
}
// Don't remove this sleep or you will only see "Error Decoding Captcha. [Login]"
sleep(3);
// 2 or 3 seconds.
$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'] . '?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);
is_page($page);
is_present($page, '>Wrong captcha code<', 'Error: Error Decoding Captcha. [Login]');
return $page;
}
示例3: GetPage
public function GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0)
{
if (!$referer && !empty($GLOBALS['Referer'])) {
$referer = $GLOBALS['Referer'];
}
$cURL = $GLOBALS['options']['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$Url = parse_url(trim($link));
if (strtolower($Url['scheme']) == 'https') {
$chttps = false;
if ($cURL) {
$cV = curl_version();
if (in_array('https', $cV['protocols'], true)) {
$chttps = true;
}
}
if (!extension_loaded('openssl') && !$chttps) {
html_error('You need to install/enable PHP\'s OpenSSL extension to support HTTPS connections.');
} elseif (!$chttps) {
$cURL = false;
}
}
if ($cURL) {
if ($XMLRequest) {
$referer .= "\r\nX-Requested-With: XMLHttpRequest";
}
$page = cURL($link, $cookie, $post, $referer, $auth);
} else {
global $pauth;
$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
is_page($page);
}
return $page;
}
示例4: GetPage
public function GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0)
{
global $options;
if (!$referer) {
global $Referer;
$referer = $Referer;
}
$cURL = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$Url = parse_url(trim($link));
if ($Url['scheme'] == 'https') {
$chttps = false;
if ($cURL) {
$cV = curl_version();
if (in_array('https', $cV['protocols'], true)) {
$chttps = true;
}
}
if (!extension_loaded('openssl') && !$chttps) {
html_error('This server doesn\'t support https connections.');
} elseif (!$chttps) {
$cURL = false;
}
}
if ($cURL) {
if ($XMLRequest) {
$referer .= "\r\nX-Requested-With: XMLHttpRequest";
}
$page = cURL($link, $cookie, $post, $referer, $auth);
} else {
global $pauth;
$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
is_page($page);
}
return $page;
}
示例5: rapportive
function rapportive($email)
{
$json_str = geturl('https://rapportive.com/contacts/email/' . $email);
$json = json_decode($json_str);
if ($json === false) {
return "<p>Failed to load Rapportive</p>";
}
if (!isset($json->contact)) {
return "<p>No information found</p>";
}
$out = "<div>";
if (isset($json->contact->image_url_raw) && strlen($json->contact->image_url_raw)) {
$out .= "<img style='float:left;margin-right:5px;margin-bottom:5px;;' width='75px' height='75px' src='{$json->contact->image_url_raw}'> ";
}
if (isset($json->contact->name) && strlen($json->contact->name)) {
$out .= "<strong>{$json->contact->name}</strong><br>";
}
if (isset($json->contact->email) && strlen($json->contact->email)) {
$out .= "<a href='mailto:{$email}'>{$email}</a><br>";
}
if (isset($json->contact->location) && strlen($json->contact->location)) {
$out .= "{$json->contact->location}</div>";
}
$out .= "<div style='clear:both;'></div>";
foreach ($json->contact->occupations as $o) {
$out .= "• {$o->job_title} at {$o->company}<br>";
}
foreach ($json->contact->memberships as $m) {
$out .= "<div style='float:left;margin-right:5px;'><img src='https://rapportive.com/images/icons/{$m->icon_name}.png'> ";
$out .= "<a href='{$m->profile_url}'>{$m->formatted}</a></div>";
}
$out .= "<div style='clear:both;'></div>";
return $out;
}
示例6: SendLogin
function SendLogin($post)
{
global $_T8, $cookie, $pauth;
$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'] . '?op=login', 'https://login.uptobox.com/', $cookie, $post, 0, $_GET['proxy'], $pauth);
is_page($page);
return $page;
}
示例7: SendLogin
function SendLogin($post)
{
global $_T8, $cookie, $pauth;
$page = geturl('login.uptobox.com', 443, '/logarithme', 'https://login.uptobox.com/', $cookie, $post, 0, 0, 0, 0, 'https');
// geturl doesn't support https proxy
is_page($page);
return $page;
}
示例8: getImagePath
/**
* 获取图片路劲
*
* @return string
*/
function getImagePath()
{
$imagePath = geturl($this->fileName);
if ($imagePath[0]) {
return $imagePath[0];
}
return '';
}
示例9: doChangeLocale
public function doChangeLocale()
{
$locale = Input::get('locale');
LaravelLocalization::setLocale($locale);
App::setLocale($locale);
Cookie::queue('locale', $locale);
return Response::json(array('status' => true, 'link' => geturl(Input::get('url'))));
}
示例10: _getGroupImage
function _getGroupImage($cnimg)
{
if (!$cnimg) {
global $imgpath;
return $imgpath . '/g/groupnopic.gif';
}
list($cnimg) = geturl("cn_img/{$cnimg}", 'lf');
return $cnimg;
}
示例11: _getImagesByTid
function _getImagesByTid($tid)
{
global $db;
$temp = array();
$query = $db->query("SELECT attachurl FROM pw_attachs WHERE tid=" . S::sqlEscape($tid, false) . " AND type='img' LIMIT 5");
while ($rt = $db->fetch_array($query)) {
$a_url = geturl($rt['attachurl'], 'show');
$temp[] = is_array($a_url) ? $a_url[0] : $a_url;
}
return $temp;
}
示例12: checkuser
function checkuser($id, $space)
{
global $_SGLOBAL;
if (empty($space)) {
showmessage('link_failure', geturl('action/login'));
}
list($dateline, $operation, $idstring) = explode("\t", $space);
if ($dateline < $_SGLOBAL['timestamp'] - 86400 * 3 || $operation != 1 || $idstring != $id) {
showmessage('getpasswd_illegal');
}
}
示例13: onGetValue
public function onGetValue($formField, array &$row, &$postfix)
{
if ($row) {
if ($formField->getFieldName() == 'id_catalog') {
if ($row['id_catalog']) {
$product = Tree::find($row['id_catalog']);
return '<a href="' . geturl($product->getUrl()) . '" target="_blank">' . $product->title_ru . '</a>';
}
}
}
}
示例14: GetPage
/**
* You can use this function to retrieve pages without parsing the link
*
* @param string $link The link of the page to retrieve
* @param string $cookie The cookie value if you need
* @param array $post name=>value of the post data
* @param string $referer The referer of the page, it might be the value you are missing if you can't get plugin to work
* @param string $auth Page authentication, unneeded in most circumstances
*/
public function GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0)
{
global $pauth;
if (!$referer) {
global $Referer;
$referer = $Referer;
}
$Url = parse_url(trim($link));
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), $referer, $cookie, $post, 0, $_GET["proxy"], $pauth, $auth);
is_page($page);
return $page;
}
示例15: _cookData
function _cookData($data)
{
global $db_bbsurl, $attachpath;
$data['url'] = $db_bbsurl . '/apps.php?q=photos&a=view&pid=' . $data['pid'];
$data['title'] = $data['pintro'];
if ($data['path'] && substr($rt['path'], 0, 7) != 'http://') {
$a_url = geturl($data['path']);
$data['imgurl'] = is_array($a_url) ? $a_url[0] : $a_url;
}
$data['image'] = $data['imgurl'];
return $data;
}