Libro de Visitas Basico

Iniciado por narupiece, Julio 17, 2010, 06:50:15 PM

Tema anterior - Siguiente tema

0 Miembros y 3 Visitantes están viendo este tema.

Julio 17, 2010, 06:50:15 PM Ultima modificación: Marzo 27, 2014, 05:50:14 PM por Expermicid
hola, como hay que aportar, aqui les traigo este pequenio libro de visitas que hice xD

espero les guste.

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Código: php

<html>
<head>
<title>Libro de Visitas php</title>
</head>
<body>
<h1>Libro de Visitas</h1>

<p align="justify">Bienvenidos al Libro de Visitas<br>Este Es un libro de Visitas que no necesita Base de Datos, tan solo se guarda en un .txt, no tienes que configurar nada, solo copias el script y lo pones en tu web ;). Si hay algun bug favor de reportar, gracias</p>

<br><br><br>

<h3>Comentarios:</h3>

<?php


$nombre=$_POST['nombre'];
$web=$_POST['web'];
$texto=$_POST['texto'];

if ( file_exists ( "visitas.txt" )) {

if($_POST['action']=="enviar"){

if($nombre==""){
echo "<script>alert('Por favor Escriba un nombre')</script>";
}else{
   if($web==""){
    echo "<script>alert('Por favor introdusca su sitio Web')</script>";
    }else{
     if(!preg_match("/^http:\/\/[a-z0-9-]{1,}?\.?[a-z0-9-]*\.?[a-z0-9]{3}?.[a-z]{2,}(\/[a-z0-9-])?\/?$/i", $web)){

     echo "<script>alert('has introducido una pag no valida, este es el formato correcto: http://pagina.com')</script>";

    }else{
     if($texto==""){
       echo"<script>alert('Por Favor ponga un comentario')</script>";
     }else{
       
       
        $name=htmlentities($nombre);
        $text=htmlentities($texto);
        $web1=htmlentities($web);

        $fp = fopen("visitas.txt","a");
        fputs($fp,"<br><hr><table><tr><td>");
        fputs($fp,"Nombre: </td><td>$name</td></tr>");
        fputs($fp,"<tr><td>Web: </td><td>$web1</td></tr><br>");
        fputs($fp,"<tr><td>Comentario: </td><td>$text</td><tr>");
        fputs($fp,"</table><br>");
        fclose($fp);
     }
   }
  }
}
}

  $ar=fopen("visitas.txt","r");
    while (!feof($ar))
     {
    $visitas=fgets($ar);
    echo $visitas;
  }
  fclose($ar);



}else{

        $fp = fopen("visitas.txt","a");
        fputs($fp,"<br><hr><table><tr><td>");
        fputs($fp,"Nombre: </td><td>Narupiece</td></tr>");
        fputs($fp,"<tr><td>Web: </td><td>http://hackingteam.org</td></tr><br>");
        fputs($fp,"<tr><td>Comentario: </td><td>Bienvenidos a mi libro de Visitas!!, espero les guste!!</td><tr>");
        fputs($fp,"</table><br>");
        fclose($fp);

        $ar=fopen("visitas.txt","r");
        while (!feof($ar))
         {
          $visitas=fgets($ar);
          echo $visitas;
         }
        fclose($ar);


}






?>

<br><br>Comenta en nuestro libro de visitas:<br><br>

<form action="" method="post">
<table>
<tr><td>Nombre: </td><td><input type="text" name="nombre"></td></tr>
<tr><td>Web: </td><td><input type="text" name="web"></td></tr>
<tr><td>Comentario: </td><td><textarea name="texto"></textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="Enviar"></td></tr>
<input type="hidden" name="action" value="enviar">
</form>
</table>

Buen aporte colega, gracias!!!

Gracias compita, ta bueno el asunto!

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Muchas gracias, todavia me sorprendo mucho de tu edad !!
Vas a llegar lejos ;)

Saludos,, Cronos !

Muy buen aporte brot
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Muchas gracias, todavia me sorprendo mucho de tu edad !!
Vas a llegar lejos ;)

Saludos,, Cronos !

Cuantos son que tiene?

Saludos.

Creo que cumplio los 13 hace poco el bro :)

Saludos,, Cronos !