H3X
08-25-2009, 09:20 AM
I am using this code:
<?php
$post = array();
$post["Sentence"] = "the dog jumped over the lazy sheep";
$post["Constituents"] = "checked";
$post["NullLinks"] = "checked";
$post["AllLinkages"] = "checked";
$post["LinkDisplay"] = "on";
$post["ShortLength"] = "6";
$post["PageFile"] = "/docs/submit-sentence-4.html";
$post["InputFile"] = "/scripts/input-to-parser";
$post["Maintainer"] = "sleator@cs.cmu.edu";
$post["submit"] = "Submit one sentence";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.link.cs.cmu.edu/cgi-bin/link/construct-page-4.cgi#submit");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.16) Firefox/2.0.0");
curl_setopt($ch, CURLOPT_REFERER, "http://link.cs.cmu.edu/link/submit-sentence-4.html");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$results = curl_exec($ch);
curl_close($ch);
echo $results;
?>
And trying to fetch the page that would contain the results. I instead, however, get a page that takes about 20 seconds to load that contains an error message. I have no idea what I'm doing wrong, and I have tried nearly everything. The page with the original form on it is: http://www.link.cs.cmu.edu/link/submit-sentence-4.html. When I just copy and paste the form their page to my page, then submit it manually, it works fine.
Thanks.
<?php
$post = array();
$post["Sentence"] = "the dog jumped over the lazy sheep";
$post["Constituents"] = "checked";
$post["NullLinks"] = "checked";
$post["AllLinkages"] = "checked";
$post["LinkDisplay"] = "on";
$post["ShortLength"] = "6";
$post["PageFile"] = "/docs/submit-sentence-4.html";
$post["InputFile"] = "/scripts/input-to-parser";
$post["Maintainer"] = "sleator@cs.cmu.edu";
$post["submit"] = "Submit one sentence";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.link.cs.cmu.edu/cgi-bin/link/construct-page-4.cgi#submit");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.16) Firefox/2.0.0");
curl_setopt($ch, CURLOPT_REFERER, "http://link.cs.cmu.edu/link/submit-sentence-4.html");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$results = curl_exec($ch);
curl_close($ch);
echo $results;
?>
And trying to fetch the page that would contain the results. I instead, however, get a page that takes about 20 seconds to load that contains an error message. I have no idea what I'm doing wrong, and I have tried nearly everything. The page with the original form on it is: http://www.link.cs.cmu.edu/link/submit-sentence-4.html. When I just copy and paste the form their page to my page, then submit it manually, it works fine.
Thanks.