Error en código de formulario de contacto

  • Autor Autor Alex Garcia
  • Fecha de inicio Fecha de inicio
A

Alex Garcia

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Hola, tengo el siguiente error en mi codigo.

PHP:
the form again."; } else{ $from="From: $name<$email>\r\nReturn-path: $email"; $subject="Message sent using your contact form"; mail("soporte.paypal@gmail.com", $subject, $message, $from); echo "Email sent!"; } } ?>

-
Previsualizacion . Al darle en enviar no envia, no hace nada.

xq2i89H.png
 
Checa tu HTML y asegúrate que todos los input son correctos y que tu formulario tenga el atributo action y method, también que tengas el input type submit :encouragement:
 
Checa tu HTML y asegúrate que todos los input son correctos y que tu formulario tenga el atributo action y method, también que tengas el input type submit :encouragement:

Este es el codigo de esa parte de la seccion, creo tener todo pero no entiendo.
HTML:
<!DOCTYPE html>
<!-- saved from url=(0041)# -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Contacto - Mandiokero S.A</title>
		
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="datos/main.css">
		<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
		<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
	</head>
	<body class="">

		<!-- Page Wrapper -->
			<div id="page-wrapper">

				<!-- Header -->
					<header id="header">
						<h1><a href="">Mandiokero S.A - Contacto</a></h1>
						<nav id="nav">
							<ul>
								<li class="special">
									<a href="#menu" class="menuToggle"><span>Menu</span></a>
									
								</li>
							</ul>
						</nav>
					</header>

				<!-- Main -->
					<article id="main">
						<header>
							<h2>CONTACTO</h2>
							<p>Pongase en contacto con nosotros mediantes nuestro sistema de tickets u redes sociales. </p>
						</header>
						<section class="wrapper style5">
							<div class="inner">

							
							
								<section>
									

							
						<form id="contact_form" action="www.paginaweb.com#" method="POST" enctype="multipart/form-data">
	<div class="row">
		<label for="name">Tu nombre:</label><br>
		<input id="name" class="input" name="name" type="text" value="" size="30"><br>
	</div>
	<div class="row">
		<label for="email">Tu email:</label><br>
		<input id="email" class="input" name="email" type="text" value="" size="30"><br>
	</div>
	<div class="row">
		<label for="message">Tu mensaje:</label><br>
		<textarea id="message" class="input" name="message" rows="7" cols="30"></textarea><br>
	</div>
	<input id="submit_button" type="submit" value="Send email">
</form>		
				
							</section></div>
						</section>
					</article>

				<!-- Footer -->
					<footer id="footer">
						<ul class="icons">
							<li><a href="##" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
							<li><a href="##" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
							<li><a href="##" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
							<li><a href="##" class="icon fa-dribbble"><span class="label">Dribbble</span></a></li>
							<li><a href="##" class="icon fa-envelope-o"><span class="label">Email</span></a></li>
						</ul>
						<ul class="copyright">
						<a href="http://www.pj.gov.py/" target="_blank"> Corte Suprema</a>
					 | <a href="http://www.multicambios.com.py/" target="_blank"> Cotizaciones</a>
                     | <a href="http://www.dnra.gov.py/" target="_blank">Registro del Automotor </a>
                     | <a href="http://www.cep.org.py/" target="_blank">Colegio de Escribanos </a>
                     | <a href="http://www.mca.gov.py/" target="_blank">Municipalidad de Asunción </a>
                     | <a href="http://www.hacienda.gov.py/web-catastro/" target="_blank"> Direccion de Catastro </a>
                     | <a href="http://www.abogacia.gov.py/web-abogacia/index.php" target="_blank"> Abogacia del Tesoro </a> <br>

							<li>© Mandiokero S.A </li><li>Design: <a href="www.paginaweb.com">Alex</a></li>
						</ul>
					</footer>

			</div>
<!--?php
    } 
else                /* send the submitted data */
    {
    $name=$_REQUEST['name'];
    $email=$_REQUEST['email'];
    $message=$_REQUEST['message'];
    if (($name=="")||($email=="")||($message==""))
        {
        echo "All fields are required, please fill <a href=\"\"-->the form again.";
        }
    else{        
        $from="From: $name&lt;$email&gt;\r\nReturn-path: $email";
        $subject="Message sent using your contact form";
        mail("soporte.paypal@gmail.com", $subject, $message, $from);
        echo "Email sent!";
        }
    }  
?&gt;

		<!-- Scripts -->
			<script src="datos/jquery.min.js.descarga"></script>
			<script src="datos/jquery.scrollex.min.js.descarga"></script>
			<script src="datos/jquery.scrolly.min.js.descarga"></script>
			<script src="datos/skel.min.js.descarga"></script>
			<script src="datos/util.js.descarga"></script>
			<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
			<script src="datos/main.js.descarga"></script>

- - - Actualizado - - -

Disculpa sii ves algun error de codigo, lo ando creando desde 0.
 
Última edición:
Este es el codigo de esa parte de la seccion, creo tener todo pero no entiendo.
HTML:
<!DOCTYPE html>
<!-- saved from url=(0041)# -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Contacto - Mandiokero S.A</title>
		
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="https://forobeta.com/datos/main.css">
		<!--[if lte IE 8]><link rel="stylesheet" href="https://forobeta.com/assets/css/ie8.css" /><![endif]-->
		<!--[if lte IE 9]><link rel="stylesheet" href="https://forobeta.com/assets/css/ie9.css" /><![endif]-->
	</head>
	<body class="">

		<!-- Page Wrapper -->
			<div id="page-wrapper">

				<!-- Header -->
					<header id="header">
						<h1><a href="">Mandiokero S.A - Contacto</a></h1>
						<nav id="nav">
							<ul>
								<li class="special">
									<a href="#menu" class="menuToggle"><span>Menu</span></a>
									
								</li>
							</ul>
						</nav>
					</header>

				<!-- Main -->
					<article id="main">
						<header>
							<h2>CONTACTO</h2>
							<p>Pongase en contacto con nosotros mediantes nuestro sistema de tickets u redes sociales. </p>
						</header>
						<section class="wrapper style5">
							<div class="inner">

							
							
								<section>
									

							
						<form id="contact_form" action="https://forobeta.com/www.paginaweb.com" method="POST" enctype="multipart/form-data">
	<div class="row">
		<label for="name">Tu nombre:</label><br>
		<input id="name" class="input" name="name" type="text" value="" size="30"><br>
	</div>
	<div class="row">
		<label for="email">Tu email:</label><br>
		<input id="email" class="input" name="email" type="text" value="" size="30"><br>
	</div>
	<div class="row">
		<label for="message">Tu mensaje:</label><br>
		<textarea id="message" class="input" name="message" rows="7" cols="30"></textarea><br>
	</div>
	<input id="submit_button" type="submit" value="Send email">
</form>		
				
							</section></div>
						</section>
					</article>

				<!-- Footer -->
					<footer id="footer">
						<ul class="icons">
							<li><a href="##" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
							<li><a href="##" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
							<li><a href="##" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
							<li><a href="##" class="icon fa-dribbble"><span class="label">Dribbble</span></a></li>
							<li><a href="##" class="icon fa-envelope-o"><span class="label">Email</span></a></li>
						</ul>
						<ul class="copyright">
						<a rel="nofollow" href="http://www.pj.gov.py/" target="_blank"> Corte Suprema</a>
					 | <a rel="nofollow" href="http://www.multicambios.com.py/" target="_blank"> Cotizaciones</a>
                     | <a rel="nofollow" href="http://www.dnra.gov.py/" target="_blank">Registro del Automotor </a>
                     | <a rel="nofollow" href="http://www.cep.org.py/" target="_blank">Colegio de Escribanos </a>
                     | <a rel="nofollow" href="http://www.mca.gov.py/" target="_blank">Municipalidad de Asunción </a>
                     | <a rel="nofollow" href="http://www.hacienda.gov.py/web-catastro/" target="_blank"> Direccion de Catastro </a>
                     | <a rel="nofollow" href="http://www.abogacia.gov.py/web-abogacia/index.php" target="_blank"> Abogacia del Tesoro </a> <br>

							<li>© Mandiokero S.A </li><li>Design: <a rel="nofollow" href="http://facebook.com/fabianlamas33">Alex</a></li>
						</ul>
					</footer>

			</div>
<!--?php
    } 
else                /* send the submitted data */
    {
    $name=$_REQUEST['name'];
    $email=$_REQUEST['email'];
    $message=$_REQUEST['message'];
    if (($name=="")||($email=="")||($message==""))
        {
        echo "All fields are required, please fill <a href=\"\"-->the form again.";
        }
    else{        
        $from="From: $name<$email>\r\nReturn-path: $email";
        $subject="Message sent using your contact form";
        mail("noelia@escribanialamas.com", $subject, $message, $from);
        echo "Email sent!";
        }
    }  
?>

		<!-- Scripts -->
			<script src="datos/jquery.min.js.descarga"></script>
			<script src="datos/jquery.scrollex.min.js.descarga"></script>
			<script src="datos/jquery.scrolly.min.js.descarga"></script>
			<script src="datos/skel.min.js.descarga"></script>
			<script src="datos/util.js.descarga"></script>
			<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
			<script src="datos/main.js.descarga"></script>

Te recomendaría crear un formulario con algún tipo de captcha como Google reCaptcha y hacer la validación por medio de SMTP, asi evitas que spammers ataquen tu sitio (vulnerabilidad en la función mail de PHP).

De todos modos no pude resistirme a colaborarte jajajaja, intenta con el siguiente código! 😀

PHP:
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Contacto - Mandiokero S.A</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="datos/main.css">
</head>
<body>
    <div id="page-wrapper">
        <header id="header">
            <h1><a href="">Mandiokero S.A - Contacto</a></h1>
            <nav id="nav">
                <ul>
                    <li class="special"><a href="#menu" class="menuToggle"><span>Menu</span></a></li>
                </ul>
            </nav>
        </header>
        <article id="main">
            <header>
                <h2>CONTACTO</h2>
                <p>Pongase en contacto con nosotros mediantes nuestro sistema de tickets u redes sociales. </p>
            </header>
            <section class="wrapper style5">
                <div class="inner">
                    <section>
                        <?php
                            if ($_POST['formulario'] && isset($_POST['nombre']) && isset($_POST['correo']) && isset($_POST['mensaje'])) {
                                $nombre = $_POST['nombre'];
                                $correo = $_POST['correo'];
                                $mensaje = $_POST['mensaje'];
                                $para = "From: $nombre&lt;$correo&gt;\r\nReturn-path: $correo";
                                $asunto = "Message sent using your contact form";
                                $resultado =  mail("noelia@escribanialamas.com", $asunto, $mensaje, $para);
                                if ($resultado) {
                                    echo "Mensaje enviado correctamente!";
                                }

                            }
                            else
                            {
                                echo "Por favor rellena todos los campos del formulario y vuelve a intentarlo.";
                            }
                        ?>
                        <form action="/" method="POST" enctype="multipart/form-data">
                            <div class="row">
                                <label for="name">Tu nombre:</label><br>
                                <input class="input" name="nombre" type="text" value="" size="30"><br>
                            </div>
                            <div class="row">
                                <label for="email">Tu email:</label><br>
                                <input class="input" name="correo" type="text" value="" size="30"><br>
                            </div>
                            <div class="row">
                                <label for="message">Tu mensaje:</label><br>
                                <textarea class="input" name="mensaje" rows="7" cols="30"></textarea><br>
                            </div>
                            <input name="formulario" type="submit" value="Send email">
                        </form>        
                    </section>
                </div>
            </section>
        </article>
        <footer id="footer">
            <ul class="icons">
                <li><a href="##" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
                <li><a href="##" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
                <li><a href="##" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
                <li><a href="##" class="icon fa-dribbble"><span class="label">Dribbble</span></a></li>
                <li><a href="##" class="icon fa-envelope-o"><span class="label">Email</span></a></li>
            </ul>
            <ul class="copyright">
                |<a href="http://www.pj.gov.py/" target="_blank"> Corte Suprema</a>
                |<a href="http://www.multicambios.com.py/" target="_blank"> Cotizaciones</a>
                |<a href="http://www.dnra.gov.py/" target="_blank">Registro del Automotor </a>
                |<a href="http://www.cep.org.py/" target="_blank">Colegio de Escribanos </a>
                |<a href="http://www.mca.gov.py/" target="_blank">Municipalidad de Asunción </a>
                |<a href="http://www.hacienda.gov.py/web-catastro/" target="_blank"> Direccion de Catastro </a>
                |<a href="http://www.abogacia.gov.py/web-abogacia/index.php" target="_blank"> Abogacia del Tesoro </a> <br>
                |<li>© Mandiokero S.A </li><li>Design: <a href="http://facebook.com/fabianlamas33">Alex</a></li>
            </ul>
        </footer>
    </div>
    <script src="datos/jquery.min.js.descarga"></script>
    <script src="datos/jquery.scrollex.min.js.descarga"></script>
    <script src="datos/jquery.scrolly.min.js.descarga"></script>
    <script src="datos/skel.min.js.descarga"></script>
    <script src="datos/util.js.descarga"></script>
    <script src="datos/main.js.descarga"></script>
</body>
</html>

- - - Actualizado - - -

Te recomendaría crear un formulario con algún tipo de captcha como Google reCaptcha y hacer la validación por medio de SMTP, asi evitas que spammers ataquen tu sitio (vulnerabilidad en la función mail de PHP).

De todos modos no pude resistirme a colaborarte jajajaja, intenta con el siguiente código! 😀

PHP:
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Contacto - Mandiokero S.A</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://forobeta.com/datos/main.css">
</head>
<body>
    <div id="page-wrapper">
        <header id="header">
            <h1><a href="">Mandiokero S.A - Contacto</a></h1>
            <nav id="nav">
                <ul>
                    <li class="special"><a href="#menu" class="menuToggle"><span>Menu</span></a></li>
                </ul>
            </nav>
        </header>
        <article id="main">
            <header>
                <h2>CONTACTO</h2>
                <p>Pongase en contacto con nosotros mediantes nuestro sistema de tickets u redes sociales. </p>
            </header>
            <section class="wrapper style5">
                <div class="inner">
                    <section>
                        <?php
                            if ($_POST['formulario'] && isset($_POST['nombre']) && isset($_POST['correo']) && isset($_POST['mensaje'])) {
                                $nombre = $_POST['nombre'];
                                $correo = $_POST['correo'];
                                $mensaje = $_POST['mensaje'];
                                $para = "From: $nombre<$correo>\r\nReturn-path: $correo";
                                $asunto = "Message sent using your contact form";
                                $resultado =  mail("noelia@escribanialamas.com", $asunto, $mensaje, $para);
                                if ($resultado) {
                                    echo "Mensaje enviado correctamente!";
                                }

                            }
                            else
                            {
                                echo "Por favor rellena todos los campos del formulario y vuelve a intentarlo.";
                            }
                        ?>
                        <form action="https://forobeta.com/https://forobeta.com/" method="POST" enctype="multipart/form-data">
                            <div class="row">
                                <label for="name">Tu nombre:</label><br>
                                <input class="input" name="nombre" type="text" value="" size="30"><br>
                            </div>
                            <div class="row">
                                <label for="email">Tu email:</label><br>
                                <input class="input" name="correo" type="text" value="" size="30"><br>
                            </div>
                            <div class="row">
                                <label for="message">Tu mensaje:</label><br>
                                <textarea class="input" name="mensaje" rows="7" cols="30"></textarea><br>
                            </div>
                            <input name="formulario" type="submit" value="Send email">
                        </form>        
                    </section>
                </div>
            </section>
        </article>
        <footer id="footer">
            <ul class="icons">
                <li><a href="##" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
                <li><a href="##" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
                <li><a href="##" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
                <li><a href="##" class="icon fa-dribbble"><span class="label">Dribbble</span></a></li>
                <li><a href="##" class="icon fa-envelope-o"><span class="label">Email</span></a></li>
            </ul>
            <ul class="copyright">
                |<a rel="nofollow" href="http://www.pj.gov.py/" target="_blank"> Corte Suprema</a>
                |<a rel="nofollow" href="http://www.multicambios.com.py/" target="_blank"> Cotizaciones</a>
                |<a rel="nofollow" href="http://www.dnra.gov.py/" target="_blank">Registro del Automotor </a>
                |<a rel="nofollow" href="http://www.cep.org.py/" target="_blank">Colegio de Escribanos </a>
                |<a rel="nofollow" href="http://www.mca.gov.py/" target="_blank">Municipalidad de Asunción </a>
                |<a rel="nofollow" href="http://www.hacienda.gov.py/web-catastro/" target="_blank"> Direccion de Catastro </a>
                |<a rel="nofollow" href="http://www.abogacia.gov.py/web-abogacia/index.php" target="_blank"> Abogacia del Tesoro </a> <br>
                |<li>© Mandiokero S.A </li><li>Design: <a rel="nofollow" href="http://facebook.com/fabianlamas33">Alex</a></li>
            </ul>
        </footer>
    </div>
    <script src="datos/jquery.min.js.descarga"></script>
    <script src="datos/jquery.scrollex.min.js.descarga"></script>
    <script src="datos/jquery.scrolly.min.js.descarga"></script>
    <script src="datos/skel.min.js.descarga"></script>
    <script src="datos/util.js.descarga"></script>
    <script src="datos/main.js.descarga"></script>
</body>
</html>

Cambia tu archivo de extensión, en vez de html cámbialo a php [MENTION=192212]Alex Garcia[/MENTION]
 
Oh, si me sirvio bastante bueno la verdad.
Te agradezco la ayuda. Muchisimas gracias [MENTION=169178]Son Lux[/MENTION]. Te dejo una. 😛8:

- - - Actualizado - - -

Pero, ¿en donde fue mi error podrias decirme? Asi aprendo.
 
Atrás
Arriba