Jump to content

[SOLVED] HELP needed adding a menu to my current php code.


leet8845

Recommended Posts

Hi there,

 

Can anyone tell em what PHP code I would need to add to my existing script. I have added a menu with 3 values to existng HTML form .

 

The HTML Code for the menu is as follows:

 

<select name="Requirements" id="Requirements">
                              <option>Full House Move</option>
                              <option>Part House Move</option>
              <option>Select Personal Items</option>
                            </select>

 

My current PHP code:

 

<?php
// Check email is not empty
if (! empty ($_POST['Email']) )
{
// Check name is not empty
if (! empty ($_POST['Name']) )
{
// Check subject is not empty
if (! empty ($_POST['Number']) )
{

// Getformdataandcreateemail
$Email2="[email protected]";
$email=$_POST['Email'];
$name=stripslashes($_POST['Name']);
$name2=stripslashes($_POST['Name2']);
$people=stripslashes($_POST['People']);
$number=stripslashes($_POST['Number']);
$location=stripslashes($_POST['Location']);
$destination=stripslashes($_POST['Destination']);
$message=
<<<EOD
--------------------------------
Enquiry from your website Movers Exchange Theme
--------------------------------

Name: $name
Name2: $Name2
EmailAddress: $email
Number: $number
Location: $location
Destination: $destination
People: $people

--------------------------------
End of Message
--------------------------------
EOD;

//Sendemail
@mail($Email2,$subject,$message, "From:$Email2");
header("Location: http://www.xxxxxxxxx.co.uk/index.php?page=moversr");

}
else
{
    // No email was sent
    header("Location: http://www.xxxxxxxxx./index.php?page=moverserror");
}

}
else
{
    // No name was sent
    header("Location: http://www.xxxxxxxxx/index.php?page=moverserror");
}

}
else
{
    // No number was sent
    header("Location: http://www.xxxxxxxxx.uk/index.php?page=moverserror");
}

?>

 

Hi,

 

Thanks for that quick responce!.

 

I added the that but I dont get a value posted through when the form is sent.

 

$Email2="[email protected]";
$email=$_POST['Email'];
$name=stripslashes($_POST['Name']);
$name2=stripslashes($_POST['Name2']);
$date=stripslashes($_POST['Date']);
$number=stripslashes($_POST['Number']);
$location=stripslashes($_POST['Location']);
$destination=stripslashes($_POST['Destination']);
$Requirements=stripslashes($_POST['Requirements']);
$hearaboutus=stripslashes($_POST['Hearaboutus']);
$message= 
<<<EOD
--------------------------------
Enquiry from your website Movers Exchange Theme
--------------------------------

Name: $name
Name2: $Name2
EmailAddress: $email
Number: $number
Location: $location
Destination: $destination
Date: $date
Requirements: $requirements
Hearaboutus: $hearaboutus


--------------------------------
End of Message
--------------------------------
EOD;

 

 

Here is my form in full, everything else is coming through expeect requirements.

 

 

<form id="form1" action="formsend.php" method="post" name="form1">
                <p align="center"><font face="Verdana" size="2"><label></label></font></p>
                <table cellspacing="8" cellpadding="8" summary="feedback form" border="0">
                    <tbody>
                        <tr>
                            <td><strong><font face="Verdana" size="2">First Name </font></strong><font color="#000000">*</font></td>
                            <td><strong><font face="Verdana" size="2"><input id="Name" name="Name" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                            <td><strong><font face="Verdana" size="2"><label>Last Name </label></font></strong><font color="#000000">*</font> </td>
                            <td><strong><font face="Verdana" size="2"><input id="Name2" name="Name2" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                            <td><strong><font face="Verdana" size="2"><label></label></font></strong><strong><font face="Verdana" size="2"><label>Phone Number </label></font></strong><font color="#000000">*</font></td>
                            <td><strong><font face="Verdana" size="2"><input id="Number" name="Number" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                            <td><strong><font face="Verdana" size="2"><label></label></font></strong><strong><font face="Verdana" size="2"><label>Email </label></font></strong><font color="#000000">*</font></td>
                            <td><strong><font face="Verdana" size="2"><input id="Email" name="Email" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                            <td><strong><font face="Verdana" size="2">
                              <label>Current Location: </label>
                            </font></strong></td>
                            <td><strong><font face="Verdana" size="2"><input id="Location" name="Location" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                            <td><strong><font face="Verdana" size="2">
                              <label>Destination: </label>
                            </font></strong></td>
                            <td><strong><font face="Verdana" size="2"><input id="Destination" name="Destination" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                            <td><strong><font face="Verdana" size="2">
                              <label>Approx. Date of Move:</label>
                            </font></strong></td>
                            <td><strong><font face="Verdana" size="2"><input id="Date" name="Date" type="text" /> </font></strong></td>
                        </tr>
                        <tr>
                          <td><strong><font face="Verdana" size="2">Requirements:</font></strong></td>
            <td><select name="Requirements" id="Requirements">
                              <option>Full House Move</option>
                              <option>Part House Move</option>
              <option>Select Personal Items</option>
                            </select>                          </td>
                        </tr>
                        <tr>
                          <td><strong><font face="Verdana" size="2">How did you get to hear about us?</font></strong></td>
                          <td><strong><font face="Verdana" size="2">
                            <input id="Hearaboutus" name="Hearaboutus" type="text" />
                          </font></strong></td>
                        </tr>
                    </tbody>
                </table>
                <font size="1">* mandatory fields </font>
                <p align="left"><label for="Submit"></label></p>
                <p align="center"><input id="Submit" type="submit" name="Submit" value="Contact me about the Movers Exchange Scheme" /> </p>
                <p align="center"><label for="label"></label><input id="label" type="reset" name="Reset" value="Reset Form" /> </p>
                <p align="center"><span class="text"><strong><font style="BACKGROUND-COLOR: rgb(255,255,255)" color="#000080">Or, call now on +44 and ask about our ‘Movers Exchange Scheme’</font></strong></span></p>
            </form>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.