Re: How to simulate another browser
| From: | Monte Ohrt | Date: | Mon, 17 Jul 2000 18:38:28 +0000 |
| Subject: | Re: How to simulate another browser | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6953@lists.php.net to get a copy of this message | ||
Hi Marek,
Two issues here. Firstly, simulating a browser. There are a few classes
available to help you in the open source community. Snoopy
(http://snoopy.sourceforge.net) comes to mind for me since I wrote that
one :-)
Secondly for the HTTP_ACCEPT, you will need to set your ACCEPT header
that is sent to the server before calling the page.
So with Snoopy, you could do something like the following:
include("Snoopy.class.inc");
snoopy = new Snoopy;
// put whatever WAP syntax you need in here
snoopy->accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
wap/wap, */*";
snoopy->fetch("http://www.ceskywap.cz/");
print snoopy->results;
Marek Blahus wrote:
>
> Hi there.
>
> Does anybody of you know simulate another browser when accessing pages on
> the internet by FOpen? I'm programming a WAP service that opens some address
> by this command:
>
> FOpen("http://www.ceskywap.cz/");
>
> "Ceskywap.cz" server is my server and I programmed a script
> http://www.ceskywap.cz/index.php3 which takes variable
> $HTTP_ACCEPT and test
> it for containing "wap" string. If does, then it returns content for WAP
> browsers, if doesn't, it returns content for regular HTML browsers.
>
> I have to get WAP content, so I have to add "wap" to $HTTP_ACCEPT in order
> to receive WAP content, not HTML content.
>
> Do you know how to set $HTTP_ACCEPT when using FOpen? Or have I to do it
> another way?
> Some other scripts that I am not managing also determines a type of content
> from the value returned by GetBrowser(). Is there any way to change that
> value when using FOpen?
>
> Thank you very much.
> Marek Blahus
> (blahus@seznam.cz)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/