Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/01/2005, 02:15
4sc1r
 
Fecha de Ingreso: abril-2003
Mensajes: 201
Antigüedad: 21 años
Puntos: 0
Pregunta funciones,mysql,dreamweaver... soy inepto

no entiendo de php y mysql ( por + q kiera )

Digamos q tengo una base de datos y kisiera hacer una consulta , la cual tiene resultado en html , lo ke yo kiero es formatear el texto , lo kual se hace mediante una funcion (http://mx2.php.net/manual/en/function.strip-tags.php) .

Ahora mi problema es que siempre eh ocupado Dreamweaver para "comunicarme" entre php y mysql , lo cual ah sido de gran ayuda , pero al tratar de poner esa funcion no la entiendo :(

este es mi codigo bd

Código PHP:
<?php
mysql_select_db
($database_cx$cx);
$query_Recordset1 "SELECT * FROM noticias";
$Recordset1 mysql_query($query_Recordset1$cx) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
y el echo es

Código PHP:
<html> ....
<?php echo $row_Recordset1['texto_largo']; ?>
....</html>
como podria "acoplar " esta funcion ? :
Código PHP:
<?
function removeEvilAttributes($tagSource)
{
       
$stripAttrib "' (style|class)=\"(.*?)\"'i";
       
$tagSource stripslashes($tagSource);
       
$tagSource preg_replace($stripAttrib''$tagSource);
       return 
$tagSource;
}

function 
removeEvilTags($source)
{
   
$allowedTags='<a><br><b><h1><h2><h3><h4><i>' .
             
'<img><li><ol><p><strong><table>' .
             
'<tr><td><th><u><ul>';
   
$source strip_tags($source$allowedTags);
   return 
preg_replace('/<(.*?)>/ie'"'<'.removeEvilAttributes('\\1').'>'"$source);
}

$text '<p style="Normal">Saluton el <a href="#?"
 class="xsarial">Esperanto-lando</a><img src="my.jpg"
 alt="Saluton" width=100 height=100></p>'
;

$text removeEvilTags($text);

var_dump($text);
?>
seria de gran ayuda si me despejan esa duda , ya q asi podria utilizar varias funciones q por lo mismo no la utilizaba ...

Gracias