Bare with me while I try to explain my problem. First I have a client that wants to track all the searches on his site for a English to Turkish translator. However the translator is located at:
[url]http://www.trengle.com/page-en-tool-v1b.asp
Basically it loads an <iFrame> on the client’s page and displays information using AJAX. Now the javascript calls:
[url]http://www.trengle.com/MTrengle/mini_xx_trengle_dictman.asp
using the XMLHttpRequest() method to return XML to JavaScript for parsing and displaying. Now I know that you can’t use this method across domains so I can just post to this site using the method and get back any XML
What I tried instead was setting up a PHP proxy to cURL the page, get the XML and then I can do with it what I please. However, when I cURL the page, I get absolutely no results, not even an error. My code for the proxy is below:
<?php
// Open the Curl session
$session = curl_init();
// Put the POST data in the body
$postvars = “fLang=EN&fReq=ET&fType=EXACT&fText=Hello&Submit=Submit”;
curl_setopt($session, CURLOPT_URL, “
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $postvars);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Make the call
$xml = curl_exec($session);
// The web service returns XML. Set the Content-Type appropriately
header(“Content-Type: text/xml”);
echo $xml;
curl_close($session);
?>
Right now I am not even collecting the POST variables, I am just setting it to a string to get some results back, yet nothing has worked. If you go to:
[url]http://barleyct.freetzi.com/poster.html
You will see what the function is suppose to produce. Any help would be greatly appreciated as I am at a loss.