Re: php side code for jQuery
| From: | ICCSI | Date: | Mon, 19 May 2014 20:40:11 +0000 |
| Subject: | Re: php side code for jQuery | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323346@lists.php.net to get a copy of this message | ||
Thanks a million for the information and help,
Regards,
Iccsi,
On Mon, May 19, 2014 at 4:30 PM, Ricardo R Bonfim <ricobonfim@gmail.com>wrote:
> You could either send information about which function you would like
> to call on the url parameter ($_GET)
>
> $.ajax('myserver.php?function=ajaxRetrieveData');
>
> or adding into data object ($_GET or $_POST) :
>
> $.ajax({
> type: "POST",
> url: "myserver.php",
> data: { function: 'ajaxRetrieveData' }
> });
>
> and then using a router to find the function
>
> myserver.php
> $function = $_POST['function'];
> $object->$function();
>
> Please, do not use this code without properly validation.
>
> 2014-05-19 17:21 GMT-03:00 ICCSI <inungh@gmail.com>:
> > I use following code for jQuery.ajax to call php.
> >
> > $.ajax('myserver.php")
> >
> > It seems that one php file only work for one jquery ajax code,
> > Is it possible to have more than one function or one return different
> > result in one php file?
> >
> > Your information and help is great appreciated,
> >
> > Regards,
> >
> >
> > Iccsi,
>
>
>
> --
> Att,
> ____________________________________________________
> Ricardo R Bonfim
>