Hi,

Active4D 4.0.2
4D2004.6 (Mac/Win)

Given the following PHP code:

<?php
$language = "";
$language = $_GET['lang'];

$url="https://www.google.com/tbproxy/spell?lang="; . $language;
$data = file_get_contents('php://input');

$data = urldecode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);

print $contents;
?>

How would I convert this to A4D?, here's what I've got so far:

<%

        $language := _query{"lang"}
        $url := "https://www.google.com/tbproxy/spell?lang="; + $language;
$data := file_get_contents('php://input'); // How do I do this bit??????????
        $data := url decode($data);
$contents := call_curl($url; $data) // call_curl is a 4D method that implements the curl commands
        write raw($contents)

%>


My specific problem is the line:

        $data = file_get_contents('php://input');

How to convert that to A4D?

For those interested, I'm trying to implement the "Spellify" spell checker from:

http://spellify.com/

It looks really cool!

Oh, and happy new year. :)

Regards

James.

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to