Page 1 of 1

javascript call php function for baidu

Posted: Mon Sep 22, 2014 9:22 pm
by jason123456
:offtopic:

Re: javascript call php function

Posted: Mon Sep 22, 2014 9:25 pm
by Celauran
First things first, have you confirmed that the PHP script is working properly? If you hit the script directly without the AJAX request, do you get the expected output?

Re: javascript call php function

Posted: Mon Sep 22, 2014 9:26 pm
by Celauran

Code: Select all

function b($o){
// no show out logic 
$text=json_decode(language_text($url));
$text = $text->trans_result;

return $text[0]->dst;

}
$url isn't defined within the scope of that function, which is going to be problematic.