Jump to content
php.lv forumi

fopen HTTP request failed


andre

Recommended Posts

ir skripts, kas izdod

 

 

Warning: fopen(http://www.volvoklubs.lv/e107_plugins/forum/forum_viewtopic.php?251696586 ) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in functions.php on line 50

nevar atveert failu - http://www.volvoklubs.lv/e107_plugins/forum/forum_viewtopic.php?251696586

 

citus linkus mieriigi ver, a sho negrib :(

 

function get_template3($filename)

{

if (!$handle = fopen($filename, 'rb')) {

 

}else{

 

while (!feof($handle)) {

$contents .= fread($handle, 8192);

}

fclose($handle);

}

 

return $contents;

}

Link to comment
Share on other sites

volvoklubs saka, ka lapa neeksistē...

HTTP request failed! HTTP/1.1 404 Not Found

varbūt pēdiņu vaina... vai arī foruma skripts atseko, ja nav padoti pārlūkam raksturīgie headeri...

 

kaa var tos raksturiigos headerus padot ? un kas ir raksturiigie ?

Link to comment
Share on other sites

  • 2 weeks later...

atbildeesu pats ja neviens nevareeja paliidzeet.

 

vajadzeeja lietot curl:

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_USERAGENT, "RSS Feed fetcher");

curl_setopt($ch, CURLOPT_TIMEOUT, 15);

curl_setopt($ch, CURLOPT_FAILONERROR, 1);

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

curl_setopt($ch, CURLOPT_URL, $filename);

 

$contents = curl_exec($ch);

if(curl_errno($ch)) die( curl_error($ch) );

echo $contents;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...