PDA

View Full Version : Pulling in PHP functions using AJAX (undefined variable errors))


Rob_Che
10-09-2011, 09:51 AM
Hi all...

So - This is a wordpress install but I think the problem is general PHP.

What I want to do is pull in the content of a page using jQuery .load.

The problem is that it will pull static content in from content.php it fails when I try and pull a function in. The function works in the page but fails when pulled in.

I get Fatal error: Call to undefined function pull_page_in() . . .

That's pretty final isn't it? Something to do with global functions or something?

Any help appreciated.

Rob_Che
10-09-2011, 10:31 AM
Looks like I'm way off with this... probably best to ignore me for now :)

davidj
10-17-2011, 01:38 PM
Cant call a server side function without making a server call

Rob_Che
10-17-2011, 01:40 PM
Yep. I stupidly hadn't included my headers and therefore was calling functions that didn't exist or any connection to the database... N00b.

Hence why it worked fine with HTML but not dynamic content.