Sajax: lost parameters passed to php function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • The Godfather

    Sajax: lost parameters passed to php function

    Hi,
    i write an entire site using sajax and php and I found it very powerful
    and useful.
    But yesterday my client had formatted the ubuntu server and when server
    is come back online a strange thing happened.
    Sajax seems to work fine (i use the debug mode) while send parameters
    to the exported function but when the server function has been called
    the parameters sended by javascript are lose and the function receive
    the string "Array".

    I miss some php/apache module?
    Maybe some security module installed don't let pass the parameter?

    Any other idea are appreciated...

    Thanks

    MicKy

    This is my code:

    <?php
    require("includ e/Sajax.php");
    function checkuser($usr) {
    //The paramenter $usr receive always the string "Array"
    $query="SELECT * FROM users WHERE username = '".$usr."'";
    query($query,$r es,$rows);

    if ($rows 0) {
    // TODO: ...
    }
    }

    sajax_init();
    //$sajax_debug_mo de = 1;
    sajax_export("c heckuser");
    sajax_handle_cl ient_request();
    ?>

    <?php sajax_show_java script(); ?>

    function do_check_ris(ri s) {
    document.getEle mentById("ris") .value = ris;
    }

    function do_check() {
    // get the folder name
    var usr;
    usr = document.getEle mentById("txtNi ck").value;

    x_checkuser(usr , do_check_ris);
    }
    </script>

    // form...
    <input name="txtNick" type="text" id="txtNick" /<input type="button"
    name="check" value="check!" onclick="do_che ck(); return false;" >
    <input type="text" name="ris" id="ris" value="" >

Working...