<?php
//CONFIGURACION 

$mail_envio= 'club@elvispresley.cl'; //el mail al que se enviaran los datos ingresados por el contacto.	
$url= 'http://www.elvischile.cl/contacto.php'; //la URL donde esta publicado el formulario.
//FIN CONFIGURACION
?>
<?PHP
//proceso del formulario
// si existe "enviar"...
if (isset ($_POST['enviar'])) {

//recogemos las variables
$nombre=$_POST['nombre'];
$fechanacimiento=$_POST['fechanacimiento'];
$sexo=$_POST['sexo'];
$comuna=$_POST['comuna'];
$ciudad=$_POST['ciudad'];
$pais=$_POST['pais'];
$telefono=$_POST['telefono'];
$email=$_POST['email'];
$msn=$_POST['msn'];
$facebook=$_POST['facebook'];
$twitter=$_POST['twitter'];


if (isset ($nuevonombre)) {

}

//comprobamos si todos los campos fueron completados
if ($nombre!='' && $fechanacimiento!='' && $sexo!='' && $pais!='' && $ciudad!='' && $email!='') {


//armamos el html
$contenido = '<html><body>';
$contenido .= '<h2>Solicitud de inscripción a ElvisChile Fan Club</h2>';
$contenido .= '<p>Enviado el '.  date("d M Y").'</p>';
$contenido .= '<hr />';
$contenido .= '<p>Nombre: <strong>'.$nombre.'</strong>';
$contenido .= '<p>Fecha de Nacimiento: <strong>'.$fechanacimiento.'</strong>';
$contenido .= '<p>sexo: <strong>'.$sexo.'</strong>';
$contenido .= '<p>Comuna: <strong>'.$comuna.'</strong>';
$contenido .= '<p>Ciudad: <strong>'.$ciudad.'</strong>';
$contenido .= '<p>País: <strong>'.$pais.'</strong>';
$contenido .= '<p>Teléfono: <strong>'.$telefono.'</strong>';
$contenido .= '<p>Email: <strong>'.$email.'</strong>';
$contenido .= '<p>MSN: <strong>'.$msn.'</strong>';
$contenido .= '<p>Facebook: <strong>'.$facebook.'</strong>';
$contenido .= '<p>Twitter: <strong>'.$twitter.'</strong>';
$contenido .= '<hr />';
$contenido .= '</body></html>';


// si todos los campos fueron completados enviamos el mail
mail ($mail_envio, "Contacto desde el sitio web Elvis Presley Chile", $contenido, "From: $nombre\nContent-Type: text/html; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit"); 
$flag='ok';
$mensaje='<div id="ok">Gracias por registrarse<br /> Pronto recibirá una confirmación.</div>';
} else {
//si no todos los campos fueron completados se frena el envio y avisamos al usuario	
$flag='err';
$mensaje='<div id="error">Los campos marcados con * son requeridos. '.$error_archivo.'</div>';

}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>Elvis Chile</title>
		<META NAME="description" CONTENT="Inscribete en el club oficial de Elvis Presley en Chile">

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Terminal+Dosis+Light&v1' rel='stylesheet' type='text/css'>
<link href="../../css/formulario.css" rel="stylesheet" type="text/css" />
<script language=JavaScript> 
function inhabilitar(){ 
    alert ("ElvisChile 2011") 
    return false 
} 
document.oncontextmenu=inhabilitar 
</script> 
</head>
<body>
<div class="contenido_form">

  <h2>ElvisChile Fan Club Oficial<br /></h2>
    
<table width="800" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="600">
    <? echo $mensaje; /*mostramos el estado de envio del form */ ?>
		  <? if ($flag!='ok') { ?><br />
          <form action="<?php echo $PHP_SELF;?>" method="post" enctype="multipart/form-data">
            <table width="600" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>*Nombres y Apellidos</td>
                <td><input <? if (isset ($flag) && $_POST['nombre']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="nombre" value="<? echo $_POST['nombre'];?>" /></td>
              </tr>
              <tr>
                <td>*Fecha de nacimiento</td>
                <td><input <? if (isset ($flag) && $_POST['fechanacimiento']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="fechanacimiento" value="<? echo $_POST['fechanacimiento'];?>" /></td>
              </tr>
              <tr>
                <td>*Sexo</td>
                <td><input <? if (isset ($flag) && $_POST['sexo']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="sexo" value="<? echo $_POST['sexo'];?>" /></td>
              </tr>
              <tr>
                <td>Comuna</td>
                <td><input <? if (isset ($flag) && $_POST['comuna']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="comuna" value="<? echo $_POST['comuna'];?>" /></td>
              </tr>
              <tr>
                <td>*Ciudad</td>
                <td><input <? if (isset ($flag) && $_POST['ciudad']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="ciudad"  value="<? echo $_POST['ciudad'];?>" /></td>
              </tr>
              <tr>
                <td>*País</td>
                <td><input <? if (isset ($flag) && $_POST['pais']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="pais"  value="<? echo $_POST['pais'];?>" /></td>
              </tr>
              <tr>
                <td>Teléfono de contacto</td>
                <td><input <? if (isset ($flag) && $_POST['telefono']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="telefono" value="<? echo $_POST['telefono'];?>" /></td>
              </tr>
              <tr>
                <td>*Email</td>
                <td><input <? if (isset ($flag) && $_POST['email']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="email"  value="<? echo $_POST['email'];?>" /></td>
              </tr>
              <tr>
                <td>Msn</td>
                <td><input <? if (isset ($flag) && $_POST['msn']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="msn"  value="<? echo $_POST['msn'];?>" /></td>
              </tr>
              <tr>
                <td>Facebook</td>
                <td><input <? if (isset ($flag) && $_POST['facebook']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="facebook"  value="<? echo $_POST['facebook'];?>" /></td>
              </tr>
              <tr>
                <td>Twiter</td>
                <td><input <? if (isset ($flag) && $_POST['twitter']=='') { echo 'class="error"';} else {echo 'class="campo"';} ?> type="text" name="twitter"  value="<? echo $_POST['twitter'];?>" /></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input class="boton" type="submit" name="enviar" value="enviar" /></td>
              </tr>
            </table>
          </form>
          <? } ?>
    </td>
    
    <td align="right" valign="top">
    
        <table width="202" border="0" cellspacing="0" cellpadding="0" class="img_form">
          <tr>
            <td width="202" rowspan="13" class="img_elvis">&nbsp;</td>
          </tr>
        </table>
    
    </td>
    
    
  </tr>
</table>


  
  


  
</div>
</body>
</html>