Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/01/2010, 02:33
Avatar de acesino1
acesino1
 
Fecha de Ingreso: octubre-2009
Mensajes: 31
Antigüedad: 14 años, 6 meses
Puntos: 0
unas preguntas dificiles

Hola un usuario muy amable (murderer) me paso este codigo que sirve para que usuarios registrados en cierta web publiquen cosas:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Pruebas</title>
</head>
<body>
<form id="form1" method="post" action="index.php?enviar=1">

<p>Titulo:<input type="text" name="titulo" id="titulo" /></p>
<p>Texto:<input type="text" name="texto" id="texto" /></p>
<p><input type="submit" name="enviar" id="enviar" value="Crear" /></p>


</form>
<?php

if ($_GET['enviar'] == '1'){
$titulo = $_POST['titulo'] ;
$texto = '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Pruebas&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;'.$_POST['texto'].'&lt;/body&gt; &lt;/html&gt;' ;
$texto = html_entity_decode($texto);
$texto = stripslashes($texto);
$fd = fopen("$titulo.php", 'w');
$escribir = fwrite($fd, $texto);

if ($escribir){
echo 'Todo salio OK';
}
}
?>
</body>
</html>

¿Ahora como hago para que se publique por ejemplo en la pagina principal como un post nuevo osea que alguien creo algo nuevo?

Otra pregunta:

Ahora cuando las personas publican algo con ese codigo aparece el fondo en blanco ¿como hago para que tenga la plantilla de la web?

Otra mas:

¿Como hago para que lo que publiquen se divida en categorias? osea Juegos, descargas, peliculas, imagenes, etc.

La ultima:

¿Como hago para que publique videos, imagenes y smiles?

Smiles: :co ol::-p

Última edición por acesino1; 23/01/2010 a las 01:44