All pastes #953233 Raw Edit

Anonymous

public php v1 · immutable
#953233 ·published 2008-03-22 22:16 UTC
rendered paste body
<?php/* The entire source code packaged here is Free Software, Copyright (C) 2008	* * by Adri&aacute;n Navarro <navarro.adrian at gmail.com>								* * Licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.	* * You can get copies of the licenses at http://www.affero.org/oagpl.html		* * AFFERO GENERAL PUBLIC LICENSE is also included in the file named "COPYING"	* * on source root 																*/$title='solicitud de invitaci&oacute;n // g&ntilde;ap!'; require 'templates/top.php';$home = 1;?>    <tr>      <td width="20%" valign="top" background="static/overlay.png"><?php require 'templates/sidebar.php' ?></td>       <td valign="top" background="static/overlay.png">      <div class="ibox"><?php// comprobar CAPTCHArequire_once('recaptchalib.php');$privatekey = "6LcHXwEAAAAAAJqLdCaIDFCBN13e_Pr4ka0-ZSL7";$resp = recaptcha_check_answer ($privatekey,                                $_SERVER["REMOTE_ADDR"],                                $_POST["recaptcha_challenge_field"],                                $_POST["recaptcha_response_field"]);  $messageSubject='Peticion de invitacion';  $confirmationBody="Gracias por solicitar una invitaci&oacute;n a la beta privada de G&ntilde;ap, te ser&aacute; enviada lo antes pronto posible. Tu mensaje se muestra a continuac&oacute;n debajo:";  $email='';  $body='';  $displayForm=true;   if (!empty($_POST['email'])  && ($resp->is_valid)) {    $email=stripslashes($_POST['email']);    $body=stripslashes($_POST['body']);    $confirmationBody .= '<br><br>'.$body;    $valid=filter_var($email, FILTER_VALIDATE_EMAIL);	if($valid){		$toadm = "Nueva solicitud:<br>Email: $email <br>Mensaje: $body<br><br>-- Mini yo";        $displayForm=false;        $cabeceras  = 'MIME-Version: 1.0' . "\r\n";		$cabeceras .= 'Content-type: text/html; charset=utf-8' . "\r\n";        mail('daniel@danisv.es', $messageSubject, $toadm, $cabeceras);        mail('navarro.adrian@gmail.com', $messageSubject, $toadm, $cabeceras);        if($body) mail($email, $messageSubject, $confirmationBody, $cabeceras);		echo '<p>Gracias por solicitar una invitaci&oacute;n. Se enviar&aacute; una copia del mensaje (si lo has enviado) a tu email.</p>';     } else { // not validated		echo '<p>El correo no es v&aacute;lido</p>';     }   } elseif($_POST && empty($_POST['email']) ) { // form not complete		echo '<p>El formulario no est&aacute; completo.</p>';   }     elseif(!$resp->is_valid && $_POST) { // form not complete		echo '<p>El CAPTCHA no se ha introducido correctamente.</p>';   }     elseif($_POST && empty($_POST['email']) && (!$resp->is_valid)) { // form not complete		echo '<p>El formulario no est&aacute; completo y el CAPTCHA no es correcto.</p>';   }  if ($displayForm){?><form action="/solicitud.php" method="post">  <table>    <tr>      <td class="label"><label for="email">Tu email</label></td>      <td>        <input type="text" name="email" id="email" value="<?php echo htmlspecialchars($email); ?>" size="30">        (la invitaci&oacute;n ser&aacute; enviada a esta direcci&oacute;n)      </td>    </tr>    <tr>      <td class="label"><label for="body">Mensaje opcional</label></td>      <td><textarea name="body" id="body" cols="70" rows="5"><?php if($body) echo htmlspecialchars($body); ?></textarea></td>    <tr>      <td>Captcha</td>      <td><?php //reCAPTCHA        require_once('recaptchalib.php');        $publickey = "6LcHXwEAAAAAAJuSIVehSFkA208H2Qx9opq9Jqlb"; // you got this from the signup page        echo recaptcha_get_html($publickey); ?></td>    </tr>    <tr><td id="submit" colspan="2"><button type="submit">Enviar</button></td></tr>  </table></form><?php  }echo '</div></td>';require 'templates/footer.php';?>