Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I am trying to post a comment to myspace.com, but the page displays the confirmation page please help me to complete the task.
the php code i used with login datils is listed bellowCode: Select all
<?php
include("Snoopy.class.php");
$snoopy = new Snoopy;
// need an proxy?:
//$snoopy->proxy_host = "my.proxy.host";
//$snoopy->proxy_port = "8080";
// set browser and referer:
$snoopy->agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
$snoopy->referer = "http://www.myspace.com/";
// set some cookies:
$snoopy->cookies["SessionID"] = '238472834723489';
$snoopy->cookies["favoriteColor"] = "blue";
// set an raw-header:
$snoopy->rawheaders["Pragma"] = "no-cache";
// set some internal variables:
$snoopy->maxredirs = 4;
$snoopy->offsiteok = true;
$snoopy->expandlinks = true;
// set username and password (optional)
//$snoopy->user = "ansar@ispg.in";
//$snoopy->pass = "abcdef1";
$formvars["email"] = "ansar@ispg.in";
$formvars["password"] = "abcdef1";
$formvars["ctl00$Main$SplashDisplay$login$loginbutton"] = "";
// fetch the text of the website http://www.google.com:
if($snoopy->submit("http://login.myspace.com/index.cfm?fuseaction=login.process&MyToken=c8713d78-4004-49dd-8b93-a44258fb954f",$formvars)){
// other methods: fetch, fetchform, fetchlinks, submittext and submitlinks
// response code:
print "response code: ".$snoopy->response_code."<br/>\n";
// print the headers:
// print the texts of the website:
print $snoopy->results;
}
else {
print "Snoopy: error while fetching document: ".$snoopy->error."\n";
}
$formvars["f_comments"] = "Welcome";
// fetch the text of the website http://www.google.com:
if($snoopy->submit("http://comment.myspace.com/Modules/Comments/Pages/PostComment.aspx?%3ffuseaction=user.ConfirmComment&friendID=152095199&MyToken=e6a1786e-81a0-4611-9395-5d9f120ddebd",$formvars)){
// other methods: fetch, fetchform, fetchlinks, submittext and submitlinks
// response code:
print "response code: ".$snoopy->response_code."<br/>\n";
// print the headers:
// print the texts of the website:
print $snoopy->results;
}
else {
print "Snoopy: error while fetching document: ".$snoopy->error."\n";
}
?>Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]