Hi all.
Do I need your HELP or do I need your HELP.
What I need to do is thiis.
Have a form on the page where the user can input. submit the form and retrun the data to a new page.
I am constructing a page with the following code:
<?php
$text = "Academy-life test";THIS IS THE INPUT TEXT
translate($text, "en", "de");THIS SETS THE VARIABLE translate TO HOLD THE CONTENTS OF "$text" AND MY SOURCE LANGUAGE TO ENGLISH "en" AND MY TRANSLATED LANGUAGE TO GERMAN "de" English and my translation language to German.
exit;
function translate($text, $srclang, $trglang)
{
$request = "GET /S301.1/api?wl_data=";
#must always urlencode parameter values that contain whitespace or other special characters
$request .= urlencode($text);
$request .= "&wl_errorstyle=1";
$request .= "&wl_srclang=$srclang&wl_trglang=$trglang&wl_password=mypassword1 HTTP/1.1\n";
$request .= "Accept-Charset: iso-8859-1\n";
$request .= "Host: www.worldlingo.com\n";
$request .= "Connection: Keep-Alive\n\n";
$server = "www.worldlingo.com";
$port = 80;
$socket = fsockopen($server, $port, &$errno, &$errstr);
fwrite($socket, $request);
echo "<html><body><pre>";
while (!feof($socket))
{
$str = fgets($socket, 99999);
echo $str;
}
fclose($socket);
echo "</pre></body></html>";
print("\n");
}
?>
If I run the code it work fine. What I want to be able to do is have the user input the content to the $text variable using a form and the result produced on another page but to be honest I don't know how to do it.
If someone could help, please
Regards
Dereck