Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: jj1987 en 4 Marzo 2019, 21:05 pm



Título: error al enviar formulario de suscripción
Publicado por: jj1987 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;}