Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/01/2012, 12:32
jossss
 
Fecha de Ingreso: mayo-2006
Mensajes: 475
Antigüedad: 18 años
Puntos: 58
Spam con function GetSQLValueString

ültimamente sufro ataques spam en una web, aunque en los formularios se valida las entradas a mysql con la función GetSQLValueString deDreamweaver. Esto hace que me llenen la web de enlaces. ¿cómo es posible?
para los que no lo conozcan este es el código de la function
Código PHP:
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}

y su forma de uso
Código PHP:
GetSQLValueString($_POST['descripcion'], "text"
Gracias a todos