Jump to content

arohamack

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

arohamack's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all First, thanks for any help you can offer! What I'm trying to do is have a form, when submitted, create an attachment (the attachment appends the form values if it is already created) AND send the form values to myself as well as the person filling in the form (so to the email address in the 'email' field). I have several php files that do everything except I cant get it to email to the address in the email field and I cant see where I'm going wrong. I am NOT very php literate and these files were created for me although I understand how they work mostly. Thanks! FridgeForm.html code: <form onclick="return checkFields();" method="post" action="formsubmit.php" id="skopefridge" name="skopefridge" enctype="multipart/form-data"> <p align="right" class="style1 style2"><img src="skope_logo.png" width="235" height="38" border="0">JOB SHEET</p> <table BORDER=0 RULES=NONE FRAME=BOX cellspacing="2" cellpadding="7"> <tr> <td colspan="2"><strong>Request ID</strong> <input name="requestid" type="text" class="fieldwidth" id="firstname" maxlength="50" readonly style="background-color:#CCC"> </label> <strong>Operator Name</strong> <input name="operator" type="text" id="operator" size="20" maxlength="80"></td> <td colspan="3"><strong>Date & Time: </strong> <script type="text/javascript" src="time.js"></script></td> </tr> <tr> <td colspan="5"><strong>CALLERS DETAILS</strong></td> </tr> <tr> <td>Name</td> <td><input name="name" type="text" size="50" tabindex=1></td> <td>Night Phone</td> <td colspan="2"><input name="nightph" type="text" size="50" tabindex=5></td> </tr> <tr> <td>Street</td> <td><input name="street" type="text" size="50" tabindex=2></td> <td>Day Phone </td> <td colspan="2"><input name="dayph" type="text" size="50" tabindex=6></td> </tr> <tr> <td>Suburb</td> <td><input name="suburb" type="text" size="50" tabindex=3></td> <td>Mobile</td> <td colspan="2"><input name="mobile" type="text" size="50" tabindex=7></td> </tr> <tr> <td>City</td> <td><select name="selectcity" size="1" tabindex=4> <option value="Alexandra">Alexandra</option> <option value="Ashburton">Ashburton</option> <option value="Auckland">Auckland</option> <option value="Blenheim">Blenheim</option> <option value="Canterbury">Canterbury</option> <option value="Cromwell">Cromwell</option> <option value="Dannevirke">Dannevirke</option> <option value="Dargaville">Dargaville</option> <option value="Dunedin">Dunedin</option> <option value="Fiordland">Fiordland</option> <option value="Gisborne">Gisborne</option> <option value="Gore c/o Invercargill">Gore c/o Invercargill</option> <option value="Greymouth">Greymouth</option> <option value="Hamilton">Hamilton</option> <option value="Hastings">Hastings</option> <option value="Invercargill">Invercargill</option> <option value="Kerikeri">Kerikeri</option> <option value="Masterton">Masterton</option> <option value="Napier">Napier</option> <option value="Nelson">Nelson</option> <option value="New Plymouth">New Plymouth</option> <option value="Oamaru">Oamaru</option> <option value="Palmerston North">Palmerston North</option> <option value="Queenstown">Queenstown</option> <option value="Ranfurly">Ranfurly</option> <option value="Rotorua">Rotorua</option> <option value="Taupo">Taupo</option> <option value="Tauranga/ mt maunganui">Tauranga/ mt maunganui</option> <option value="Timaru">Timaru</option> <option value="Wanaka">Wanaka</option> <option value="Wanganui">Wanganui</option> <option value="Wellington">Wellington</option> <option value="Westport">Westport</option> <option value="Whakatane">Whakatane</option> <option value="Whangerei">Whangerei</option> <option value="test">test</option> <option value="test2">test2</option> </select></td> <td>Company</td> <td colspan="2"><input name="company" type="text" size="50" id="company" tabindex=8></td> </tr> <tr> <td colspan="5"><strong>PRODUCT DETAILS</strong></td> </tr> <tr> <td>Model</td> <td><input name="model" type="text" size="50" tabindex=9></td> <td>Purchased From </td> <td colspan="2"><input name="purchfrom" type="text" size="50" tabindex=11></td> </tr> <tr> <td>Serial No</td> <td><input name="serial" type="text" size="50" tabindex=10></td> <td>Date Purchased </td> <td colspan="2"><input name="datepurch" type="text" size="50" tabindex=12></td> </tr> <tr> <td> </td> <td> </td> <td>Proof Of Purchase? </td> <td colspan="2"><input name="proofpurch" type="text" size="50" tabindex=13></td> </tr> <tr> <td>Room Heater Installed In </td> <td colspan="4"><input name="installed" type="text" size="50" tabindex=14></td> </tr> <tr> <td>Heater Problem </td> <td colspan="4"><input name="problem" type="text" size="50" tabindex=15></td> </tr> <tr> <td colspan="5" align="center"><span class="style4">FOR ANY PROBLEMS/ENQUIRIES PLEASE CONTACT SKOPE INDUSTRIES PH:0800 947 5673</span> </td> </tr> <tr> <td colspan="5" align="center"><hr> <strong>Contact Belinda at Skope Services if the complete heater needs to be replaced. &#124; Replaced parts are to be kept for 3 months. <br> <font color="#FF0000">This form is automatically emailed to the contractor associated with the city you choose above. The contractors details are below (for the chosen city) if you need to contact them)</font></strong> </td> </tr> </table> <table border="0" cellspacing="4" cellpadding="4"> <tr> <td>Contractor</td> <td style="display:none;">City</td> <td>Address</td> <td>Phone</td> <td>Fax</td> <td>Email</td> </tr> <tr> <td><input type="text" name="contractor" id="contractor" readonly style="background-color:#CCC"></td> <td style="display:none;"><input type="text" name="city" id="city" readonly style="background-color:#CCC"></td> <td><input type="text" name="address" id="address" readonly style="background-color:#CCC"></td> <td><input type="text" name="phone" id="phone" readonly style="background-color:#CCC"></td> <td><input type="text" name="fax" id="fax" readonly style="background-color:#CCC"></td> <td><input type="text" name="email" id="email" readonly style="background-color:#CCC"></td> </tr> </table> <p> <input type="submit" name="Submit" value="Submit" style="width:1000px; height:30px; "> </p> </form> formsubmit.php: <?php include ('../tools/maketable.php'); include ('../tools/processing.php'); $config = "skopeGlobal.php"; /****************************************************************/ /*FORM SUBMITTED DATA */ /****************************************************************/ // These are the fields that are posted from the form to be changed to suit the form // Make sure that there is one variable per form field or you may miss data $requestid = $_REQUEST["requestid"]; $operator = $_REQUEST["operator"]; $name = $_REQUEST["name"]; $street = $_REQUEST["street"]; $suburb = $_REQUEST["suburb"]; $selectcity = $_REQUEST["selectcity"]; $nightph = $_REQUEST["nightph"]; $dayph = $_REQUEST["dayph"]; $mobile = $_REQUEST["mobile"]; $company = $_REQUEST["company"]; $model = $_REQUEST["model"]; $serial = $_REQUEST["serial"]; $purchfrom = $_REQUEST["purchfrom"]; $datepurch = $_REQUEST["datepurch"]; $proofpurch = $_REQUEST["proofpurch"]; $installed = $_REQUEST["installed"]; $problem = $_REQUEST["problem"]; $email = $_REQUEST["email"]; $callerInfo = "Request ID=".$requestid."; Operator=".$operator."; Name=".$name."; Street=".$street."; Suburb=".$suburb."; City=".$selectcity."; Night Phone=".$nightph."; Day Phone=".$dayph."; Mobile Phone=".$mobile."; Company Name=".$company."; Model=".$model."; Serial No=".$serial."; Purchased From=".$purchfrom."; Date Purchased=".$datepurch."; Proof of Purchase=".$proofpurch."; Room Installed In=".$installed."; Product Problem=".$problem."; Emailed To=".$email; $display .= makeTable("Call Details",$callerInfo,1); processData($config,$display,$callerInfo); ?> skopeGlobal.php: <?php $title = "Skope Fridge Form"; //TODO: The title should be changed to a significant title $stylesheet = "http://www.thecallcentre.co.nz/css/submittedstyling.css"; // TODO: This Has to be changed to a stylesheet for the site // this must be a url or email will not style correctly $logo = "http://www.thecallcentre.co.nz/other/tcclogo.jpg"; $fileName="Skope-FridgeFormResults.xls"; $emailTo= $_REQUEST["email"]; $emailFrom="info@thecallcentre.co.nz"; $redirect="Thankyou.html"; ?> There are also other processing files but I'm not sure if you need to see their code or not.
  2. Thankyou. Making changes now and testing them out.
  3. right, i've found a problem with my code I had $callaction = $_REQUEST["callaction"]; missing for starters. I'm not sure if I had the input field named correctly either, although either way, I STILL cant get it going.
  4. Thanks for that but unfortunately it doesn't work. No email arrived.
  5. hmmm.... from what I can tell it's definitely NOT the external file that's causing any problems. I really just need to know where to put the 'echo$email' bit and how in this line... mailbot($title,$display,"[b]emailfieldvalue as the email address[/b]","info@tcc.co.nz","ThankYou.html"); I write the field name. Sorry for the bump without really any further information but the guy that normally helps me with this stuff is away and my boss is waiting for some results
  6. ok, i've checked out the other file and no, changing it around doesn't seem to help at all. but then again, i am a n00b at this so who knows! does anyone else have any idea?
  7. hmmm... I dont think so (?). mailbot.php code: <?php function mailbot($title,$display,$recipients,$from,$redirect){ $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'FROM:'.$from; mail($recipients,$title,$display,$headers); if ($redirect != Null){ header ("Location: ".$redirect); } } ?> Atho in saying that, i've just noticed the $recipients part of it so maybe I need to investigate that a bit more.
  8. Thanks Bradley for your quick reply. I probably should have mentioned that the email is handled from another file called mailbot.php. The email is working well with no problems, i just really need it to go to the email address that's set in the 'email' field once the region has been selected.
  9. Hi FYI I'm a n00b in this particular forum & php n00b really but I'm having a problem & cant find a solution anywhere! I need to be able to send an email from a form. Within the form is a dropdown field for different regions. When a region is selected it sets the email address for that region into an input/text field. I need to pickup that value and send the email to that address but not sure how. Have been told to use echo$email & that perhaps my variable is empty but I haven't got a clue where to put it or what that means. Help please?! my code: include ('maketable.php'); include ('mailbot.php'); include ('auditFile.php'); $office = $_REQUEST["office"]; $callername = $_REQUEST["callername"]; $callerphone = $_REQUEST["callerphone"]; $callaction = $_REQUEST["callaction"]; $callerInfo = "Callers Name=".$callername; $commentInfo = "Callers Phone No=".$callerphone; $callDetail = "Action Taken=".$callaction; $title = "DOC Call Results"; $stylesheet = "stylesheet.css"; $logo = "tcclogo.jpg"; $display = makeHeader($title,$stylesheet,$logo); $display .= makeTable("Caller Details",$callerInfo,1); $display .= makeTable("",$commentInfo,1); $display .= makeTable("",$callDetail,1); $display .= '</body></html>'; $info = $callerInfo."; ".$commentInfo."; ".$callDetail; auditFile($title, $info); echo $email; mailbot($title,$display,"email","info@tcc.co.nz","ThankYou.html");
×
×
  • 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.