Jump to content

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


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="me@xxxxxxxxx.co.uk";
$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="mail@mysite.co.uk";
$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>

 

 

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.