Jump to content

This should be simple for php veterans.


trevor von

Recommended Posts

Well first of all congrats on such a great forum.

 

I'm quite new to php and all the interaction I've had with it as a web designer has been a simple contact form code. But I have tried to modify the code and it didnt work.

 

The Problem:

I can get the php code below to send the feedback to my email but only for $nombre and $email(its a spanish website). But when I try to add the rest of the requests it will either give me an error or it will take me to the "thank you" page but the email will never get there.

 

This is the php script and the html codes below it:

 

 

<?php

  $nombre = $_REQUEST['nombre'] ;

  $email = $_REQUEST['email'] ;

  $telefono = $_REQUEST['telefono'] ;

  $pais = $_REQUEST['pais'] ;

  $message = $_REQUEST['message'] ;

  $bienes = $_REQUEST['bienes'] ;

  $liderasgo = $_REQUEST['liderasgo'] ;

  $ventas = $_REQUEST['ventas'] ;

  $diseño = $_REQUEST['diseño'] ;

 

  mail( "llllllllllllllllllllllll@hotmail.com", "contact form VA",

    $nombre, "From: $email" );

  header( "Location: http://llllllllllllllllllllllllllll.com/thankyou.html" );

?>

 

 

HTML form

 

<form action="feedback.php" method="post" enctype="multipart/form-data" name="form1" id="form1">

                      <table width="433" border="0" align="left" cellpadding="2" cellspacing="2">

                        <tr>

                          <td width="112" class="style27">Nombre:</td>

                          <td width="301"><label>

                            <input name="nombre" type="text" id="nombre" size="30" />

                          </label></td>

                        </tr>

                        <tr>

                          <td class="style27">Email:</td>

                          <td><label>

                            <input name="email" type="text" id="email" size="30" />

                          </label></td>

                        </tr>

                        <tr>

                          <td class="style27">Telefono:</td>

                          <td><label>

                            <input name="telefono" type="text" id="telefono" size="30" />

                          </label></td>

                        </tr>

                        <tr>

                          <td height="25" class="style27">Pais:</td>

                          <td><label>

                            <input name="pais" type="text" id="pais" size="30" />

                          </label></td>

                        </tr>

                        <tr>

                          <td height="115" class="style27">Comentarios Adicionales: </td>

                          <td><label>

                            <textarea name="message" cols="30" rows="5" id="message"></textarea>

                          </label></td>

                        </tr>

                        <tr>

                          <td class="style27">Quiero Recibir informacion adicional sobre: </td>

                          <td valign="middle"><label class="style27">

                            <input name="bienes" type="checkbox" id="bienes" value="bienes" />

                            <span class="style27">Bienes raices</span> </label>

                            <label>

                            <br />

                            <input name="liderazgo" type="checkbox" id="liderazgo" value="liderazgo" />

                            <span class="style27">Liderazgo</span> <br />

                            <input name="ventas" type="checkbox" id="ventas" value="ventas" />

                            <span class="style27">Ventas</span> <br />

                            <input name="diseño" type="checkbox" id="diseño" value="diseño" />

                            <span class="style27">Diseño Web</span> </label></td>

                        </tr>

                        <tr>

                          <td height="45" class="style27"><label>

                           

                              <div align="left">

                                <input type="submit" name="Submit" value="Enviar" />

                              </div>

                          </label></td>

                          <td valign="middle"> </td>

                        </tr>

                      </table>

                            </form>

 

This is the php script that wont work:

 

<?php

  $nombre = $_REQUEST['nombre'] ;

  $email = $_REQUEST['email'] ;

  $telefono = $_REQUEST['telefono'] ;

  $pais = $_REQUEST['pais'] ;

  $message = $_REQUEST['message'] ;

  $bienes = $_REQUEST['bienes'] ;

  $liderasgo = $_REQUEST['liderasgo'] ;

  $ventas = $_REQUEST['ventas'] ;

  $diseño = $_REQUEST['diseño'] ;

 

  mail( "llllllllllllllllllllllll@hotmail.com", "contact form VA",

    $nombre, $telefono, $pais, $message, "From: $email" );

  header( "Location: http://lllllllllllll.com/thankyou.html" );

?>

 

Just to give a quick example, the red codes are the ones I try to apply in order to get every requested info to be sent to my email. But it's not working so I would really apreciate knowing how I'm supposed to add them all. It seems like I'm already close enough but I havent been able to fix it.

 

Thanks in advanced

 

Link to comment
Share on other sites

<?php
// send e-mail to ...
$to=$email;

// Your subject
$subject=$subjectP;

// From
$header="from: email@address.com>";

// Your message
$message=$messageP;

// send email
$sentmail = mail($to,$subject,$message,$header);

 

That is what I use for my email function, it is the basics and it works fine.  Also is email set up in your php.ini file

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.