Debug PHP ajax petitions?

13 views
Skip to first unread message

Giuseppe Luigi Punzi

unread,
Jan 17, 2015, 4:44:07 PM1/17/15
to fir...@googlegroups.com
Hi,

I have 2 files.
- FileA.php
- FileBAjax.php

When FileA.php it's called, it builds an HTML UI and this UI via Javascript makes ajax petitions to FileBAjax.php

Using....
require_once('../FirePHPCore/FirePHP.class.php');
ob_start();

$fpDebug = FirePHP::getInstance(true);
$fpDebug->log($somevar, "Some Text");

Opening this file on my browser works and appears on console FP message.

but when I click on some button, thath execute a JS calling my MyFileBAjax.php don't works.
JS call is something like:
function doSomethingAjax(){
         $.get("../MyFileBAjax.php",{opcion:"doSomethingB"},function (data)
        {
               code code code code code
        });

}

My FileBAjax.php basically is something like:

$opcion = $_GET['opcion'];

switch($opcion)
{
    case "optionA":
        doSomething();
        break;
    case "optionB":
        doSomethingB();
        break;
}

Some idea if it's possible to get this working? I discovered today FirePHP and looks great for me. I have all development on "cloud", and this can let me debug better server side.
Reply all
Reply to author
Forward
0 new messages