javascript - $.getJSON to a php with include_once fails but it did the work -
i've php webservice , when call $.getjson goes .fail callback.
the problem appears when include_once @ php. if copy/paste included file main php works fine.
the responsetext expected (a json data asked) , status 200, inside .fail callback.
it's strange. knows if there's problems using include_once?
then piece of php code is:
$bcarregat = include_once("sql/". $sconsulta .".php");
and if replace with:
$ssqlbase = "select usuari, nom, moduls"; $ssqlbase .= " www_usuari"; $ssqlbase .= " 1=1"; if (isset($arestr['usuari']) , $arestr['usuari'] != "") { $ssqlbase .= " , usuari = '". str_replace("'", "''", $arestr['usuari']) ."'"; }
it works.
i solved problem saving secondary php file (the included) in utf-8 without bom.
i didn't know existence of different utf-8 formats, little beginning char @ response text (\ufeff) made me suspect.
i apreciate frustrated attempts me ;-p have not been vain.
Comments
Post a Comment