c5 defined fails in ajax called php file

Permalink
Hi,

I got a small problem with ajax. I use jquery and ajax to call a php file when i cahnge the value of a select box. This works fine but i want to use the loader::db in the called php file. For some reason the check if C5_EXECUTE is defined fails and my ajax request returns the die sting (Acces denied). What do i have to do to use c5 in the php file ?

Thanks in advance,
Robin

 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
First consideration, the called ajax should either be a tools file or method in a block controller, and the tool path should be prepared with the c5 url helper. Unless you do that, c5 wont necessarily build the minimal infrastructure needed.
robinh replied on at Permalink Reply
I just realised what i did wrong... i did put the php file in a folder called tools but i littererly made a folder named tools inside my block folder... i'm not sure what the url helper is but i probably can find that ni the docs.

thank for your help yet again.
robinh replied on at Permalink Reply
Sorry to bother you again but i can't find anything about url helper and ajax call. could you give me an example off using the url helper with an ajax call ?