I have a ajax.php file that contains the following sample code:
switch($_REQUEST['request_name'])
{
case 'edit':
echo "edit mode";
break;
case 'delete':
echo "delete mode";
break;
default:
die("Error: wrong request name ".$_REQUEST['request_name']);
break;
}
I have another file index.php that I want to call results from ajax.php. Hmm.. how do I do it? I normally use javascript to call results from ajax.php. But is there a way I can call results from within index.php as well? Code is wrong below but something to this effect.
$result = include("ajax.php?request_name=delete");
echo $result;