Hi, I am trying to use a site translator but i am having problems as my server does not accept the function file_get_contents. I need to use curl with this really but when i tried changing file_get_contents to curl_init i get an error stating Wrong parameter count $html = file_get_contents("http://64.233.179.104/translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair=$lang&u=" . urlencode($_GET["u"]) . "&prev=/language_tools"); Code (markup): Any ideas? Cheers, Adam
Why are you doing it this way instead of direct links to the Google translator? <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://64.233.179.104/translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair=$lang&u=" . urlencode($_GET["u"]) . "&prev=/language_tools"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $html = curl_exec($ch); curl_close($ch); ?> PHP:
If file_get_contents() is not supported/enabled, then neither is file(), it is most likely due to file handling functions being disabled for security reasons. Unless it is PHP4 < 4.3...
Hi, Thank you for your replies, i am doing it this way as it will not display the google translator banner and looks like part of the site. I tried your example krt but still comes back saying: Warning: Wrong parameter count for curl_exec()