proggrockaren35
New Member
- Messages
- 2
- Reaction score
- 0
- Points
- 0
Does anyone know why i can curl my own site (which is www.letajobb.tk), but not an external site.
for instance, this works.
<?php
$ch = curl_init() or die(curl_error($ch));
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_URL,"www.letajobb.tk");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data1 = curl_exec($ch) or die(curl_error($ch));
echo htmlspecialchars($data1, ENT_QUOTES);
echo curl_error($ch);
curl_close($ch);
?>
but not
<?php
$ch = curl_init() or die(curl_error($ch));
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_URL,"www.introduction.se");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data1 = curl_exec($ch) or die(curl_error($ch));
echo htmlspecialchars($data1, ENT_QUOTES);
echo curl_error($ch);
curl_close($ch);
?>
from which i get "couldn't connect to host"?
Have tried other external sites to curl, always get the same error.
Thanx,
/ fhobbit
for instance, this works.
<?php
$ch = curl_init() or die(curl_error($ch));
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_URL,"www.letajobb.tk");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data1 = curl_exec($ch) or die(curl_error($ch));
echo htmlspecialchars($data1, ENT_QUOTES);
echo curl_error($ch);
curl_close($ch);
?>
but not
<?php
$ch = curl_init() or die(curl_error($ch));
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_URL,"www.introduction.se");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data1 = curl_exec($ch) or die(curl_error($ch));
echo htmlspecialchars($data1, ENT_QUOTES);
echo curl_error($ch);
curl_close($ch);
?>
from which i get "couldn't connect to host"?
Have tried other external sites to curl, always get the same error.
Thanx,
/ fhobbit