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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.