Porfavor ayudenme soy novato en php
Publicado por mauro (17 intervenciones) el 06/08/2020 04:22:12
Normalmente usando curl muestro el codigo fuente de una (url ) poniendo sus encabezados pero en este caso no me muesta el codigo fuente me sale este error porfavor alguien que pueda guiarme soy novato con muchas ganas de seguir aprendiendo!.
este es el codigo que estoy usando
ESTE ES EL ERROR QUE ME MUESTRA EN LUGAR DE MOSTRARME EL CODIGO
este es el codigo que estoy usando
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"");
curl_setopt($ch, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"POST");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"GET");
curl_setopt($ch, CURLOPT_PORT,"443");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 1000);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt ($ch, CURLOPT_COOKIEFILE, "cookie.txt");
$headers = array(); $headers[] = "Host:firefaucet.win"; $headers[] = "upgrade-insecure-requests:1"; $headers[] = "save-data:on"; $headers[] = "user-agent:Mozilla/5.0 (Linux; Android 9; SM-A105M
) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Mobile Saf
ari/537.36";
$headers[] = "x-requested-with:XMLHttpRequest"; $headers[] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"; $headers[] = "sec-fetch-site:same-origin"; $headers[] = "sec-fetch-mode:navigate"; $headers[] = "sec-fetch-user:?1"; $headers[] = "sec-fetch-dest:document";
$headers[] = "referer:https://firefaucet.win/ptc/";
$headers[] = "Cookie: __cfduid=d6e6d5621f36c1c5f2331fa5cd84982301596080941;session=ed38a231-739f-4e7f-bedc-297fbd9d0703.FqTApde6bG8GaiH_iG8I
xdqF1iY;_ga=GA1.2.255418458.1596081010;_gid=GA1.2.26230630.1596610276;p
nc_fcap=3;_gat_gtag_UA_113361696_1=1";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo "$result\n";
ESTE ES EL ERROR QUE ME MUESTRA EN LUGAR DE MOSTRARME EL CODIGO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script><!--<![endif]-->
</head>
<body>
<div id="cf-wrapper">
<div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-header cf-error-overview">
<h1 data-translate="block_headline">Sorry, you have been blocked</h1>
<h2 class="cf-subheadline"><span data-translate="unable_to_access">You are unable to access</span> firefaucet.win</h2>
</div><!-- /.header -->
<div class="cf-section cf-highlight">
<div class="cf-wrapper">
<div class="cf-screenshot-container cf-screenshot-full">
<span class="cf-no-screenshot error"></span>
</div>
</div>
</div><!-- /.captcha-container -->
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>
Valora esta pregunta


0