javascript call php function for baidu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jason123456
Forum Newbie
Posts: 1
Joined: Mon Sep 22, 2014 9:12 pm

javascript call php function for baidu

Post by jason123456 »

:offtopic:
Last edited by jason123456 on Tue Sep 23, 2014 1:22 am, edited 4 times in total.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: javascript call php function

Post 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?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: javascript call php function

Post 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.
Post Reply