Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/03/2012, 19:51
Bladsmickey
 
Fecha de Ingreso: enero-2011
Mensajes: 33
Antigüedad: 14 años, 3 meses
Puntos: 0
Solo me muestra el codigo fuente!

Saludos cree un simple archivo de registro, un html para pedir los datos y el mismo es redirigido a un php para "Almacenarlos"...
El problema es que al pulsar el boton enviar, solo me muestra el codigo fuente, mas nada, les adjunto el codigo Saludos!


Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.   <meta content="text/html; charset=ISO-8859-1"
  3. http-equiv="content-type">
  4.   <title>Registrar</title>
  5. </head>
  6. style="width: 1434px; height: 32px; text-align: left; margin-left: auto; margin-right: auto;"
  7. border="1" cellpadding="2" cellspacing="2">
  8.   <tbody>
  9.     <tr>
  10.       <td
  11. style="background-color: rgb(149, 243, 192); text-align: center;">Registro
  12. De usuarios</td>
  13.     </tr>
  14.   </tbody>
  15. <br>
  16. <form method="post" action="registro.php"
  17. name="registrar">Usuario: <input name="usuario"><br>
  18. Contraseña:<input name="contrasena" type="password"><br>
  19. Confirmar Contraseña:<input name="contrasena2" type="password"><br>
  20. Correo Electronico:<input name="correoe"><br>
  21.   <br>
  22.   <div style="text-align: center;"><input value="Enviar"
  23. type="submit"><input name="borrar"
  24. value="Borrar datos" type="reset"><br>
  25. <?php if ( !empty($_GET['registro']) ) {
  26. printf("El registro ha sido exitoso.");
  27. } ?>
  28.   </div>
  29. </form>
  30. </body>
  31. </html>

El codigo php

Código PHP:
Ver original
  1. <?php
  2.  
  3. if ( !empty($_POST['usuario']) ) {      $usuario     = $_POST['usuario'];}
  4. if ( !empty($_POST['contrasena']) ) {   $password     = $_POST['contrasena'];}
  5. if ( !empty($_POST['contrasena2']) ) {  $rePassword = $_POST['contrasena2'];}
  6. if ( !empty($_POST['correoe']) )   {    $email        = $_POST['correoe'];}
  7.  
  8.  
  9. if(password==rePassword){
  10.         printf("El usuario y pass an sido registrados en el navegador exictosamente , seras redirecionado a otra web");
  11.     }
  12.     else{
  13.         printf("<hr><center>Error las contraseñas no coinciden...$usuario!</center><hr>");
  14.         printf("$usuario");
  15.         }
  16.  
  17.  
  18.  
  19. ?>