[eluser]paulon[/eluser]
nice it fixed my problem regarding direct access to scripts
Code:
//javascript
var obj = {
get_user_online: function(){
var url="<?=base_url()?>index.php/generals/getuseronline";
$.post(url,{isAllowed:1},
function(data){
document.getElementById("divuserlist")[removed] = data;
});
}
}
that calls in
Code:
//php script
function getuseronline(){
if($_POST['isAllowed']>0){
$strReturn = 'Hello world';
}else{
$strReturn = 'No direct access allowed';
}
echo $strReturn;
}
so when ever the link type in directly into the browser "http://localhost/CI/index.php/generals/getonlineuser"
it returns a "No direct access allowed'