you can decide what you will do in php by the parameters from GET/POST
method
for example "url:inbox.php?act=delete&id=123"

and from the server side, it goes like:
$act = empty($_GET['act'])?'':$_GET['act'];
if($act=='delete'){
...
}

Hope this will be any help
Charles
2009/3/6 dawnerd <dawn...@gmail.com>

>
> No, you cannot directly call php functions. That would be a very large
> security whole.
>
> Instead, you should be using query string parameters to figure out
> what action you want to perform in the php.
>
> On Mar 5, 12:10 pm, side1021 <derek.pc....@gmail.com> wrote:
> > Hi,
> >
> > Is there any way to call a php function directly with $.ajax()?  I did
> > some search and the answer I've got varies from impossible to using
> > workarounds such as passing query string to the 'data' and let php
> > direct which function to call.  I know that with asp.net it's possible
> > but i'm not familiar with PHP.  Here is the code that works for me in
> > asp.net.
> >
> >           $.ajax({
> >                type: "POST",
> >                url: "Default.asp/Book",
> >                contentType: "application/json; charset=utf-8",
> >                data: "{}",
> >                dataType: "json",
> >                success: AjaxSucceeded,
> >                error: AjaxFailed
> >            });
> >
> > Thanks!
>

Reply via email to