我想用以下CLASS 去登陆 和讯博客, 并提交数据的程序, 但总是不成功,没有没高手知道?謝謝!!!<?phpclass hexunPost
{ public $cookie_file;
public $send_url;
public $formhash;
public $discuz_url;
public $user;
public function __construct($discuz_url, $user, $password)
{
$this->discuz_url = $discuz_url;
$this->user= $user; $post_fields = array(); $post_fields['TextBoxUserName'] = $user;
$post_fields['TextBoxPassword'] = $password; $post_fields['LoginStateName'] = '1';
$post_fields['LoginStateAuto'] = '1';
$post_fields['submitsign'] = '1';
// $post_fields['hiddenReferrer'] = "http%3a%2f%2fbull3.blog.hexun.com%2f";
$post_fields['hiddenReferrer'] = "http://bull3.blog.hexun.com";
$post_fields['TextGpic'] = "";
$post_fields['gourl'] = "http://bull3.blog.hexun.com";
$post_fields['callback'] = "";

//POST?据,?取COOKIE,cookie文件放在网站的temp目?下
$this->cookie_file = tempnam('tmp','cookie'); $ch = curl_init($discuz_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookie_file);
$contents = curl_exec($ch);
curl_close($ch);

echo "<textarea>".$contents."</textarea>";
}

} $sample = new hexunPost("http://reg.hexun.com/login.aspx", "USER", "PASSWORD");  ?>