Artiom Posted November 4, 2006 Share Posted November 4, 2006 I need to recieve the resulting page of http://anidb.info/perl-bin/animedb.pl?show=search&noalias=1&sa.name=Cowboy+Bebop&sa.type=4&sa.airdate0=2001&sa.atts=0&do.search=Searchas pure HTML code. Yet, when I use standard PHP file functions, they return garbage. Where do I do wrong? Help please! Is it possible to work this around with standard PHP functions (without extentions)? Link to comment https://forums.phpfreaks.com/topic/26141-help-with-html-php/ Share on other sites More sharing options...
joshi_v Posted November 4, 2006 Share Posted November 4, 2006 If u can post your code, it will be helpful to see where is the problem! Link to comment https://forums.phpfreaks.com/topic/26141-help-with-html-php/#findComment-119541 Share on other sites More sharing options...
Artiom Posted November 4, 2006 Author Share Posted November 4, 2006 Sure :)Here it is[code]<?php$str="http://anidb.info/perl-bin/animedb.pl?show=search&noalias=1&sa.name=Cowboy+Bebop&sa.type=4&sa.airdate0=2001&sa.atts=0&do.search=Search";$f=file_get_contents($str);//$out=fgets($f);echo $f;?>[/code]I've tried using file(), fopen() with "rb" or "r" - the result slightly differs, but it is still garbage. :( Link to comment https://forums.phpfreaks.com/topic/26141-help-with-html-php/#findComment-119542 Share on other sites More sharing options...
joshi_v Posted November 4, 2006 Share Posted November 4, 2006 Have you check in your php.ini settings?because when you are using an URL as file name , fopen_wrappers have been enabled.Regards,Joshi. Link to comment https://forums.phpfreaks.com/topic/26141-help-with-html-php/#findComment-119547 Share on other sites More sharing options...
Artiom Posted November 4, 2006 Author Share Posted November 4, 2006 When these wrapers are disabled, PHP issues a wanrning (i've just checked on another host). In my case it actually returns some data, yet it is wrong. Link to comment https://forums.phpfreaks.com/topic/26141-help-with-html-php/#findComment-119553 Share on other sites More sharing options...
Artiom Posted November 5, 2006 Author Share Posted November 5, 2006 Just in case yet another noob gets caught on this. The thing is HTML stream is gziped, gz_ group of functions has to be used. A valid code would be[code]<?php$str="http://anidb.info/perl-bin/animedb.pl?show=search&noalias=1&sa.name=Cowboy+Bebop&sa.type=4&sa.airdate0=2001&sa.atts=0&do.search=Search";$f=gzopen($str, "r");while(!gzeof($f)){$out=gzgets($f);echo $out;}?>[/code] Link to comment https://forums.phpfreaks.com/topic/26141-help-with-html-php/#findComment-120018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.