tags:

views:

73

answers:

5

I want to write a bot that fetches my mail on Yahoo! but my first problem is I can't fetch the web page where login and password have to be filled in. I do it so:

<?php
$the_url = "http://www.yahoo.com/r/l6";

$ua_s = "Opera/9.62 (Windows NT 5.1; U; En) Presto/2.1.1";

$c = curl_init($the_url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_USERAGENT, $ua_s);
$the_page = curl_exec($c);
curl_close($c); 

echo $the_page;
?>

But when I do that I get a blank page.

A: 

You probably want to set the CURLOPT_FOLLOWLOCATION option to true as the url that you supplied does a redirect.

Rob Booth
I have added this curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); but I still can't fetch the page.
good
What do you fetch? This really isn't the best forum for debugging a problem. But if you can tell us what is happening I'm sure someone will be able to help. Edit your question to add what you are getting back and why it isn't correct.
Rob Booth
Ok. I've added.
good
+1  A: 

You could use pop access.

Toby Allen
How to use that?
good
Look up the yahoo help. All webmail vendors (Yahoo, GMAIL, hotmail) have pop access that you can configure outlook etc to use to download your mail. Look at the help for yahoo.
Toby Allen
A: 

Пиздец. Вопрос закрыт

good
+1  A: 

Use the PEAR::HTTP_REQUEST it's more clean!

Or better PEAR::Mail_IMAP this won't violating the terms of ...

powtac
a fat lot I care about violating the terms of ...
good
A: 
Alan Storm