Welcome Guest, Not a member yet? Register   Sign In
A mess with jquery and codeigniter
#1

[eluser]spyridonas[/eluser]
Hello, i want to ask if there's a security parameter inside code igniter that doesn't allow calls to the parent controller ? I can't explain it otherwise so here's some example. I load a page with dynamic objects (controller for index stuff and viewer for the html stuff, note that database calls, while wrong, are happening inside the viewer). What happens is when i click on an object i use .load() and .ajax() from jquery to post and call back a function with some results.The function i call is inside the same controller that loads the index page. If i echo out my $_POST it returns nothing , if i echo out var_dump($_POST) it still doesn't return anything to the viewer. However if i log my value it does apears on the logs but that's where things get weird. If i have echo $_POST['value'] the log says ERROR value is not defined , BUT i can use codeigniter to query something from database USING the $_POST['value'] , for example $this->db->query("SELECT * FROM table1 WHERE table_id=$_POST['value']" does return results that i CANNOT echo out and see on the viewer BUT i can view the results on the logs if i log them !!! Note that typing echo 'Hello' does indeed load inside the viewer and i can perfectly interact with it
#2

[eluser]spyridonas[/eluser]
Turns out codeigniter sanitizes my post and that's why i can't echo out my $_POST, is there a way to turn off sanitizing for this specific function? i tried doing
Code:
if(isset($_POST['myval']))
{
$value=$_POST['myval'];
}
log_message('error', $value);
not working..
#3

[eluser]Stefan Hueg[/eluser]
The thing you are looking for might be:

application/config.php
Code:
$config['global_xss_filtering'] = FALSE;

...or passing the XSS_clean option via $this->input->post('field', TRUE)





Theme © iAndrew 2016 - Forum software by © MyBB