Muchas gracias por la respuesta, ahora entiendo como pueden hacerlo ya que sobre el GET se hace la consulta con una comilla
Ya implemente un Captcha
Ya filtre las malas palabras, estos si que se envian, pero para imprimirlas no.
Filtre o mejor dicho puse htmlspecialchars para que no me pongan html, aparte puse un BB code simple.
Uso consultas tipo
$txt = stripslashes($_GET["type"]);
$txt = addslashes($_GET["type"]);
$buscar = " where name like '%" . $txt . "%'";
Será seguro agregar el strip y addslashes?
Por ahí encontre una funcion para no tener dolores de cabeza, estos aplicarlos en todos los post y get.
Código PHP:
function protect1($protected) { // This Will be the fuction we call to protect the variables.
$banlist = array ("'", "\"", "<", "\\", "|", "/", "=", "insert", "select", "update", "delete", "distinct", "having", "truncate", "replace", "handler", "like", "procedure", "limit", "order by", "group by", "asc", "desc");
//$banlist is the list of words you dont want to allow.
if ( eregi ( "[a-zA-Z0-9@]+", $protected ) ) { // Makes sure only legitimate Characters are used.
$protected = trim(str_replace($banlist, '', $protected)); // Takes out whitespace, and removes any banned words.
return $protected;
//echo "+";
} else {
//echo "-";
echo $protected;
die ( ' Is invalid for that spot, please try a different entry.' ); // Message if thier is any characters not in [a-zA-Z0-9].
} // ends the if ( eregi ( "[a-zA-Z0-9]+", $this->protected ) ) {
} // ends the function Protect() {
Ni modo en los comentarios todos son en español y sería raro alguien escriba Delete en un comentario, asi que lo filtro, tambien sería una solución.