4
1
Fork 0

Curl edit!

This commit is contained in:
Alpha 2017-04-29 21:30:49 +02:00
parent e59521f689
commit 4c8e433898

View file

@ -1,16 +1,16 @@
<h1>Tets!</h1>
<h1>Test!</h1>
<?php
$url=$_POST['txturl'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$output = curl_exec($ch);
echo $output;
curl_close($ch);
?>
<?php
$url = "http://www.reddit.com/";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$var= curl_exec($ch);
curl_close($ch);
$third= stripos($var,'<p class="title"><a class="title " ',0);
$fourth= stripos($var,'</span></p>',0);
//echo substr($var,$first,$second-$first);
echo substr($var,$third,$fourth-$third);
echo function_exists('curl_version')?'Yes':'No';
?>