leet8845 Posted August 24, 2007 Share Posted August 24, 2007 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"); } ?> Link to comment https://forums.phpfreaks.com/topic/66507-solved-help-needed-adding-a-menu-to-my-current-php-code/ Share on other sites More sharing options...
MadTechie Posted August 24, 2007 Share Posted August 24, 2007 i think you mean this: $Requirements=stripslashes($_POST['Requirements']); Link to comment https://forums.phpfreaks.com/topic/66507-solved-help-needed-adding-a-menu-to-my-current-php-code/#findComment-333040 Share on other sites More sharing options...
leet8845 Posted August 24, 2007 Author Share Posted August 24, 2007 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> Link to comment https://forums.phpfreaks.com/topic/66507-solved-help-needed-adding-a-menu-to-my-current-php-code/#findComment-333122 Share on other sites More sharing options...
MadTechie Posted August 24, 2007 Share Posted August 24, 2007 use either $Requirements or $requirements, not both change $Requirements $Requirements=stripslashes($_POST['Requirements']); to $requirements=stripslashes($_POST['Requirements']); that should do it Link to comment https://forums.phpfreaks.com/topic/66507-solved-help-needed-adding-a-menu-to-my-current-php-code/#findComment-333128 Share on other sites More sharing options...
leet8845 Posted August 24, 2007 Author Share Posted August 24, 2007 Thanks MadTechie Its working now!!! Your a star!!! Thanks again!!!! :) Link to comment https://forums.phpfreaks.com/topic/66507-solved-help-needed-adding-a-menu-to-my-current-php-code/#findComment-333155 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.