Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/01/2013, 19:48
jenju302
 
Fecha de Ingreso: julio-2009
Ubicación: colombia
Mensajes: 7
Antigüedad: 14 años, 9 meses
Puntos: 0
vinculos en mi sistema de comentarios

Buenas noches estoy estoy haciendo una pagina web con editor de dreamwaver y php, realice un pequeño sistema de comentarios con consulta a base de datos para que los usuarios que lleguen puedan dejar sus comentarios, pero me encuentro con el problema que algunas personas sin oficio estan agregando codigo HTML que genera links a los comentarios que agregan, que puedo hacer para solucionar esto e utilizado varias funciones pero ninguna me ha ayudado a evitar que ingresen estos link. por favor si alguien me puede ayudar le quedaria muy agradecida.

Este es codigo que me ingresan a la base de datos mysql y que genera el link a otra pagina.

vfgmckftvtfmtbmwbeps, <a href="http://loancompaniesonline.com/">Cheap proextender</a>, BdhxqGM, [url=http://loancompaniesonline.com/]Proextender penis enlargement[/url], jDvPZTv, http://loancompaniesonline.com/ ProExtender, eepBzLh, <a href="http://discountnexuspheromones.com/">Nexus Pheromones</a>, uQHqndv, [url=http://discountnexuspheromones.com/]Nexus Pheromones[/url], PNLNacy, http://discountnexuspheromones.com/ Who sale nexus pheromone, djcMBRV, <a href="http://vprx2k.com/">VP-RX</a>, dDmIVav, [url=http://vprx2k.com/]VP-RX[/url], LDTOptE, http://vprx2k.com/ Vp-rx, whMXPbd, <a href="http://provestraonline.com/">Provestra</a>, dsTgFYg, [url=http://provestraonline.com/]Provestra[/url], RIgqnfc, http://provestraonline.com/ Vigorelle and provestra, ZOrpNVS, <a href="http://centennialbluff.com/">Pay day loans direct lenders</a>, QJEfrUs, [url=http://centennialbluff.com/]Sms pay day loans[/url], VkvzGkk, http://centennialbluff.com/ Pay Day Loans, qQdvNjN, <a href="http://healinggraphics.net/">Payday Loans</a>, NHtrFWK, [url=http://healinggraphics.net/]Pay Day Loans[/url], CejEYUI, http://healinggraphics.net/ Payday Loans, GsKkPvz.


Este es el codigo que genero dreamwaver
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$error = array();
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
// comprobar nombre
if (empty($_POST['tema'])) {
$error['tema'] = 'Por favor no dejes el campo tema vacio';
}
if (empty($_POST['autor'])) {
$error['autor'] = 'Por favor no dejes el campo autor vacio';
}
if (empty($_POST['mesajes'])) {
$error['mesajes'] = 'Por favor no dejes el campo comentario vacio';
}
/* Funcion para evitar inyeccion de Sql.*/

}
/* $comprobarEmail = '/^[^@]+@[^\s\r\n\'";,%]+$/';
if (!preg_match($comprobarEmail, trim($_POST['mesajes']))) {
$error['mesajes'] = 'Por favor escribe una dirección email válida';
}*/


$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if (!$error) {
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO mensajes(tema, autor, mesajes) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['tema'], "text"),
GetSQLValueString($_POST['autor'], "text"),
GetSQLValueString($_POST['mesajes'], "text"));


mysql_select_db($database_prueba, $prueba);
$Result1 = mysql_query($insertSQL, $prueba) or die(mysql_error());
}
$_POST = array();
}

$maxRows_Recordset1 = 3;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_prueba, $prueba);
$query_Recordset1 = "SELECT mesajes, tema, autor, fecha FROM mensajes ORDER BY id_mensaje desc";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $prueba) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

?>

muchas gracias. http://static.forosdelweb.com/fdwtheme/images/smilies/redface.png