|
C
|
cgphp 11/4/2011 |
|
Use post instead of get for posting data. Filter the q value using a conditional statement like this: if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' && isset($_POST['q']) && !empty($_POST['q'])) |
|
|
M
|
mickna author 11/4/2011 |
|
Hi Christian, $output = '<select name="colTarget" size="1" onChange="slectedCol(this.value)">';
echo '<script type="text/javascript">
|
|
|
C
|
cgphp 11/4/2011 |
echo "<script type='text/javascript'> |
|
|
M
|
mickna author 11/4/2011 |
|
I am sorry Christian. |
|
|
C
|
cgphp 11/4/2011 |
|
In the "After Application initialized" event enter this code: if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest')
echo "<script type='text/javascript'> |
|
|
M
|
mickna author 11/4/2011 |
|
Again thank you. |
|
|
M
|
mickna author 11/4/2011 |
|
Ok! |
|
|
|
Sergey Kornilov admin 11/4/2011 |
|
Sending data via POST is more robust but doesn't provide any additional security. |
|
|
M
|
mickna author 11/4/2011 |
|
Thank you Sergey,
|
|
|
|
Sergey Kornilov admin 11/4/2011 |
|
You doing it wrong way. Here is the example of URL that will destroy data in your database. |
|
|
C
|
cgphp 11/4/2011 |
|
Thank you Sergey, my solution was so fare to use preg_replace to filter and after this I cut the string, as the field in my Database is only set to 20 Characters and so there is no need for a longer string / code
$import_pages = array('page_name_import_1.php','page_name_import_2.php','page_name_import_3.php','','',.......); |
|
|
M
|
mickna author 11/4/2011 |
|
Nice! Thank you. |
|
|
M
|
mickna author 11/4/2011 |
|
ShitShitShit! $new = mysql_real_escape_string($_GET["q"]); //clean the input to prevent XXSYou doing it wrong way. Here is the example of URL that will destroy data in your database. ...list.php?q=a';delete from users;' |
|
|
|
Sergey Kornilov admin 11/4/2011 |
|
Yes, that would do it. Just in case truncate it first and then apply mysql_real_escape_string(). |
|
|
M
|
mickna author 11/6/2011 |
|
Yes, that would do it. Just in case truncate it first and then apply mysql_real_escape_string().
|
|