B
B
Banito2019-02-03 15:42:30
PHP
Banito, 2019-02-03 15:42:30

I make a grabber using curl, almost everything works. But certain links won't open?

I make a grabber using curl, almost everything works, but I don’t want to open such links,
site.ru/?id=/artist_songs?mod=1&artist_id=141272, what’s the problem?

<?
#######################
include 'inc/head.php';

#######################
function curl_get($url){ 
$curl = curl_init(); 
curl_setopt($curl, CURLOPT_URL, $url); 
curl_setopt($curl,CURLOPT_USERAGENT,''); 
curl_setopt($curl, CURLOPT_REFERER, "http://google.ru/"); 
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); 
curl_setopt($curl, CURLOPT_TIMEOUT, 30); 
$cnt = curl_exec($curl); 
curl_close($curl); 
return $cnt; 
} 
$file = curl_get("http://muzmo.ru".$_GET['id']);
#######################

include 'inc/settings.php';

echo $file; 
#######################
include 'inc/foot.php'; 
?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dkrylov, 2019-02-03
@dkrylov

curl_get("http://muzmo.ru".$_GET['id']);
If there is really an integer ID, then it will be something like this:
muzmo.ru123 - such domain zones do not exist

Z
Zanak, 2019-02-03
@Zanak

Shouldn't the parameters be collected with "&"?
I would also look at this function, to prepare the parameters before sending.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question