Jump to content

Help with HTML + PHP


Artiom

Recommended Posts

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=Search
as 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

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

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.ty

pe=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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.