elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web (Moderador: #!drvy)
| | |-+  error al enviar formulario de suscripción
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: error al enviar formulario de suscripción  (Leído 1,087 veces)
jj1987

Desconectado Desconectado

Mensajes: 1


Ver Perfil
error al enviar formulario de suscripción
« en: 4 Marzo 2019, 21:05 pm »

hola. tengo formulario de suscripción pero me genera error al enviar

Código:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="NL-style.css" rel="stylesheet" type="text/css">

</head>
<body>

<!-- Hello! If you like this STYLE for your mail form... -->

<!-- CUT AFTER THIS LINE, and paste it inside your BODY tags -->

<link href="NL-style.css" rel="stylesheet" type="text/css">
<form name="form1" method="post" action="NLprocess.php" class="bk">
  <fieldset>
  <p align="center" class="txt">Subscribe E-mail:<br>
    <input name="email" type="text" size="12" class="txtbox">
    <input type="submit" name="Submit" value="Go" class="button">
    <br>
    our <a href="http://www.sendblaster.com/newsletter-software-no-recurring-fees/" title="newsletter software">Newsletter
    software</a></p>
  </fieldset>
</form>

<!-- END CUT BEFORE THIS LINE -->

</body>
</html>

Código:
<?php

// Hello! welcome to the settings page.
// Here's your two steps guide:

// FIRST:
// Instead of newsletter@test.com put the email address of the mailing list,
// (the same that SendBlaster uses in Manage Subscriptions Section)
// ... please pay attention to the  ' ' apostrophes, they must remain around the email address.

$emailmanager = 'newsletter@test.com';

// SECOND:
// save this file, and close it. Thank you!


error_reporting(0);

$email = trim($_POST['email']);
$Ok = ereg("^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $email);
if ($Ok) {
mail($emailmanager,'Subscribe','','From: '.$email);

if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm))
{
?>
<script language = 'javascript'>
alert('Thank you, your address was added to our Mailing List');
history.go(-1);
</script>
<?
exit();
}
}

else {
if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm))
{
?>
<script language = 'javascript'>
alert('Sorry, please provide a valid Email address.');
history.go(-1);
</script>
<?
exit();
}
}
?>




Código:
.bk {
background-color: #EEF0F7;
border: 1px dashed #47649D;
padding: 0;
width: 155px;
margin: 0px;}
.txt {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #005284;}

.txtbox {
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
padding: 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;}

.button {
background-color: #005284;
border: 1px solid #CCCCCC;
padding: 0;
color: #fff;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;}

fieldset {
border: 3px solid #fff;
margin: 0;
padding: 13;}


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Enviar formulario a correo « 1 2 »
PHP
lluk 18 8,972 Último mensaje 8 Septiembre 2010, 23:04 pm
por neopuerta360
Enviar formulario automaticamente
PHP
neopuerta360 6 8,758 Último mensaje 28 Septiembre 2010, 19:48 pm
por ~ Yoya ~
enviar formulario prototype
Desarrollo Web
kakashi20 0 2,191 Último mensaje 7 Noviembre 2011, 20:07 pm
por kakashi20
Enviar datos de un formulario a otro formulario en vivo
Dudas Generales
em645jn 0 2,666 Último mensaje 2 Marzo 2016, 21:24 pm
por em645jn
enviar formulario de una web ajena desde mi formulario de mi proyecto (cURL)
Desarrollo Web
bengy 4 4,540 Último mensaje 13 Octubre 2016, 20:51 pm
por EFEX
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines