Jump to content

munchkinz

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

munchkinz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Unfortunately yes, you would need to add a test for each part. Of course, you can group things like: <?php if($Plumbing != '') { $Body .= "\n"; $Body .= "Plumbing: "; $Body .= $Plumbing; } ?> Yep, you can test for whatever value. The first way of grouping them is working fine, but I tried the second method to try and reduce the file size but I only receive the text not the value??
  2. thank you, just noticed some parenthesis are the wrong way round must be getting tired
  3. Thank you very much for your help, I have done as you suggested, but I am now receiving the following error: I have checked and cannot see any problem, would it be possible for somebody to take a look and see if they can spot the issue, this website is live and I don't want to lose customers by having a broken website. File attached [attachment deleted by admin]
  4. thank you for your reply. Would I need change that for each line of $body? or add it elsewhere? also would that work for <?php ... if($LRFSTV != '0') { $Body .= "\nFlat Screen TV: $LRFSTV"; } ... ?> Where the input is a dropdown list of numbers 0-4?
  5. Hi, I have a (rather long) form on my site that when submitted send the information to me in an email. Ideally I would like to have the form only send me the information that has been filled out at current it sends everything. but for now I just need to know how I can style the email so its not one long list. also the form only comes through if an email adress is filled in it says it sends but I never recieve it. heres an example of the code for sending the email $Date = Trim(stripslashes($_POST['Date'])); $Packing = Trim(stripslashes($_POST['Packing'])); $Dismantle = Trim(stripslashes($_POST['Dismantle'])); $DismantleYes = Trim(stripslashes($_POST['DismantleYes'])); $Plumbing = Trim(stripslashes($_POST['Plumbing'])); $PlumbingYes = Trim(stripslashes($_POST['PlumbingYes'])); $LRSofa = Trim(stripslashes($_POST['LRSofa'])); $LRArmChair = Trim(stripslashes($_POST['LRArmChair'])); $LROtherChair = Trim(stripslashes($_POST['LROtherChair'])); $LRSCabinet = Trim(stripslashes($_POST['LRSCabinet'])); $LRLCabinet = Trim(stripslashes($_POST['LRLCabinet'])); $LRBookcase = Trim(stripslashes($_POST['LRBookcase'])); $LROTable = Trim(stripslashes($_POST['LROTable'])); $LRCTable = Trim(stripslashes($_POST['LRCTable'])); $LRTVStand = Trim(stripslashes($_POST['LRTVStand'])); $Body .= "Date of move: "; $Body .= $Date; $Body .= "\n"; $Body .= "Packing: "; $Body .= $Packing; $Body .= "\n"; $Body .= "Dismantle: "; $Body .= $Dismantle; $Body .= "\n"; $Body .= $DismantleYes; $Body .= "\n"; $Body .= "Plumbing: "; $Body .= $Plumbing; $Body .= "\n"; $Body .= $PlumbingYes; $Body .= "\n"; $Body .= "\n"; $Body .= "Living Room: "; $Body .= "\n"; $Body .= "Sofas: "; $Body .= $LRSofa; $Body .= "\n"; $Body .= "Arm Chairs: "; $Body .= $LRArmChair; $Body .= "\n"; $Body .= "Other Chairs: "; $Body .= $LROtherChair; $Body .= "\n"; $Body .= "Small Cabinets: "; $Body .= $LRSCabinet; $Body .= "\n"; $Body .= "Large Cabinets: "; $Body .= $LRLCabinet; $Body .= "\n"; $Body .= "Bookcases: "; $Body .= $LRBookcase; $Body .= "\n"; $Body .= "Occassional Tables: "; $Body .= $LROTable; $Body .= "\n"; $Body .= "Coffee Tables: "; $Body .= $LRCTable; $Body .= "\n"; $Body .= "TV Stand: "; // send email $success = mail($EmailTo, $Subject, $Body, "From: ". $FName ." ". $LName ." <". $Email.">"); // redirect to success page if ($success){ header ('Location: thankyou.php'); } else{ header ('Location: error.php'); }
  6. ok thank you. Here is a snippet of the code <tr><td><label for="LRSofa" id="LRSofa">Sofas:</label></td><td><select name="LRSofa"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select></td> <td><label for="LRArmChair" id="LRArmChair">Arm Chairs:</label></td><td><select name="LRArmChair"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select></td> <td><label for="LROtherChair" id="LROtherChair">Other Chairs:</label></td><td><select name="LROtherChair"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select></td> <td><label for="LRSCabinet" id="LRSCabinet">Small Cabinets:</label></td><td><select name="LRSCabinet"> There are about 150 of these. and this is some snippets of the code i am trying to simplify $LRSofa = Trim(stripslashes($_POST['LRSofa'])); $LRArmChair = Trim(stripslashes($_POST['LRArmChair'])); $LROtherChair = Trim(stripslashes($_POST['LROtherChair'])); $LRSCabinet = Trim(stripslashes($_POST['LRSCabinet'])); $Body .= "Living Room: "; $Body .= "\n"; $Body .= "Sofas: "; $Body .= $LRSofa; $Body .= "\n"; $Body .= "Arm Chairs: "; $Body .= $LRArmChair; $Body .= "\n"; $Body .= "Other Chairs: "; $Body .= $LROtherChair; $Body .= "\n"; $Body .= "Small Cabinets: "; $Body .= $LRSCabinet; $Body .= "\n"; $Body .= "Large Cabinets: "; $Body .= $LRLCabinet; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: ". $FName ." ". $LName ." <". $Email.">"); please ask if you need any more info thank you
  7. I'm sure there must be a way to simplify code as it is taking forever. The code is for a form with the results emailed to me. I have attached the files as they are too big to post here [attachment deleted by admin]
  8. Hi, I had a website running a few months ago with a working contact form I am now building a new website and have copied the files changing relevant info but it is not not working it is sending me to the thank you page but the email is not coming through. Can anybody see why? <?php $EmailTo = "MYEMAIL@gmail.com"; $Subject = "Contact from Website"; $Title = Trim(stripslashes($_POST['Title'])); $FName = Trim(stripslashes($_POST['First Name'])); $LName = Trim(stripslashes($_POST['Last Name'])); $Email = Trim(stripslashes($_POST['Email'])); // prepare email body text $Body = ""; $Body .= "Title: "; $Body .= $Title; $Body .= "\n"; $Body .= "First Name: "; $Body .= $FName; $Body .= "\n"; $Body .= "Last Name: "; $Body .= $LName; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$Email>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">"; } ?> <form action="quoteform.php" method="post" enctype="multipart/form-data" name="quoteform" id="quoteform"> <label for="Title" id="Title">Title:</label><select name="Title"> <option value="Mr">Mr</option> <option value="Mrs">Mrs</option> <option value="Miss">Miss</option> <option value="Ms">Ms</option> <option value="Dr">Dr</option> <option value="Other">Other</option> </select> <label for="FName" id="FName">First Name:</label><input name="First Name" type="text" size="25"> <label for="LName" id="LName">Last Name:</label><input name="Last Name" type="text" size="25"> <label for="Email" id="Email">Email:</label><input name="Email" type="text" size="50"> <input type="submit" name="submit" value="Send" class="submit-button" title="Submit" /> <input type="button" value="Clear Message" onClick="document.forms['quoteform'].Message.value=''" /> </form>
×
×
  • 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.