Trying to make a php file work with my email form

Hello,
Going slightly mad trying to link my php file with my html and actually getting it to work.
It (the php file) keeps coming up with a syntax error on line 37 - code hinting may not work etc etc but there is no error from what I can see - can anyone else point out the obviously to me? This is driving me around the bend!
my code:
<?php
/*Subject and Email Variables */
    $emailSubject = 'Website Form';
    $webMaster = '[email protected]';
/* Gathering Data Variables */
    $nameField = $_POST['name'];
    $addressField = $_POST['address'];
    $telephone1Field = $_POST['telephone1'];
    $telephone2Field = $_POST['telephone2'];
    $emailField = $_POST['email'];
    $name2Field = $_POST['name2'];
    $ageField = $_POST['age'];
    $dobField = $_POST['dob'];
    $commsField = $_POST['comms'];
    $messageField = $_POST['message'];
    $body = <<<EOD
<br><hr><br>
Name: $name <br>
Address: $address <br>
Telephone (daytime): $telephone1 <br>
Telephone (mobile): $telephone2 <br>
Email: $email <br>
Childs Name: $name2 <br>
Start Age: $age <br>
Childs Date of Birth: $dob <br>
Preferred form of communication: $comms <br>
Message: $message <br>
EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail{$webMaster, $emailSubject,$body, $headers};
/* Results rendered as HTML */
    $theResults = <<<EOD
<html>
<head>
<title>Xxx</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-color: #f1f1f1;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #666666;
    text-decoration: none;
-->
</style>
</head>
<div>
  <div align="left">Thank you for your message, Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>

Line 37 is this:
    $success = mail{$webMaster, $emailSubject,$body, $headers};
It should be this:
    $success = mail($webMaster, $emailSubject, $body, $headers);
Also the header for the From: is this:$headers = "From: $email\r\n"; but I don't see the variable defined for $email
Also you should know about email injection. Someone could inject your headers and add additional BCC: addresses to send emails to many undisclosed recipients through your mail script. You'd be using your script to turn your server into a host for spam! Sanitize your fields to prevent injection attacks! Security should be the firt priority followed by functionality. If it's unsecure it shouldn't function

Similar Messages

  • I am trying to make a time lapse video with Premier Element 13. When trying to publish it at about 15% of work done it stops and in a new screen it says an unknown error, what am I doing wrong?

    I am trying to make a time lapse video with Premier Element 13. When trying to publish it at about 15% of work done it stops and in a new screen it says an unknown error, what am I doing wrong?

    Click on the blue Internet Recovery in nbar's post. That is a link to what computers can run Internet Recovery.
    Do a backup,  preferable 2 separate ones on 2 drives. Boot to the Recovery Volume (command - R on a restart or hold down the option/alt key during a restart and select Recovery Volume). Run Disk Utility Verify/Repair and Repair Permissions until you get no errors.  Reformat the drive using Disk Utility/Erase Mac OS Extended (Journaled), then click the Option button and select GUID. Then re-install the OS.
    OS X Recovery
    OS X Recovery (2)
    When you reboot, use Setup Assistant to restore your data.

  • How to make "visa find resource" working with Agilent device

    I am trying to use Agilent 82357B GPIB device with LabVIEW for instrument control.
    I have checked:
    1.       NI-VISA (ver 5.1.1) is the primary visa by checking visa.dll properties under windows\system32 folder
    2.       Enable NIVISATulip.dll in NI Max Explorer
    3.       Enable the Agilent libraries to work with NI 488.2 in Agilent IO library (ver 16).
    I am able to communicate with the instrument in Max Explorer and talk to the instrument in LabVIEW with VISA write for almost all commands.
    But I can NOT make one particular visa function (Visa find resource) working with Agilent 82357B GPIB.
    With NI USB GPIB device, the same code above can find attached instruments as below, where GPIB1 is the Agilent device and GPIB0 is the NI device.
    I have no clue on how to make “visa find resource” working with Agilent device.
    Please help.
    Solved!
    Go to Solution.

    Quick question.  Did you also enable 488 support in Agilent? 
    If that does'not work try this.  and well see if you found a bug
    Jeff

  • How can I make a .gif file work in Keynote on my iPad Mini?

    How can I make a .gif file work in Keynote on my iPad Mini?
    Have saved a .gif file to my Camera Roll, and it works fine as I have checked it through mail. When I import it into Keynote however it won't animate. Even when I play slide. Any suggestions?

    The can use apps such as Apple's Pages app for Word documents and Numbers for Excel spreadsheets, and from third-parties apps such as Documents To Go ('premium' version) and QuickOffice Pro HD.

  • What is the best way to make 3g/4g simcard work with airport extreme

    I live in Mumbai, India and I am tired of the state of broadband connection over here. I have vodafone 3G Data only SIM with me which I use via a 3G dongle that plugs into my mac. It has a decent speed and I would like to use it as a primary internet connection across the 3 iPhones, 2 iPads, a Mac and 2 apple tvs at my home.
    I have a 2014 airport extreme and i want to know what hardware do i need to make the 3g sim work with it? like put the sim in the hardware/adapter and then plug it into the wan port of the airport extreme and let the AE handle my dhcp so that i can access 3g internet from all my devices?
    also, i was something 4g compatible as 4g is on the roll in India. it doesn't have to be a wireless router on its own but something that can dial the connection and provide internet access to the AE via the wan port.
    thanks.
    Neerav

    The only reason I mention it would be configure your network for a roaming instead of extended setup. The number one advantage over an extended is bandwidth performance ... aka speed.
    For example, I have a Cisco RVS4000 wired router as my main Internet router. I am fortunate that my 2-story home came pre-wired for Ethernet. I have placed an AirPort Extreme and a Time Capsule, connected by Ethernet back to the Cisco; one on each floor to provide a seamless wireless network for an assortment of wired/wireless clients. With this setup, I am able to stream HD TV content throughout the house. Mine is an example of what you can do with a roaming network.

  • Can't sign in using any 3rd party email client with my iCloud account on any Mac. Tried every settings, My iCloud only works with Mail.app

    Can't sign in using any 3rd party email client with my iCloud account on any Mac or any other Mac. My iCloud will only work with Mail.app. All the clients I tried work perfectly well as long as I sign in with somebody else's iCloud account. But mine won't work no matter the client (Postbox, Unibox, Airmail...) and no matter the computer.
    I can access my account on iCloud.com, but I can't use email clients without getting error messages prompting me to check my password or login.
    I was able to use those clients in the past but a couple of months ago I got logged out of Airmail and the issue started just like that!
    I tried every possible mail server settings including the following:
    IMAP information for the incoming mail server
    Server name: imap.mail.me.com
    SSL Required: Yes
    If you receive errors when using SSL, try using TLS instead.
    Port: 993
    Username: The name part of your iCloud email address (for example, emilyparker, not [email protected])
    Password: Your iCloud password
    SMTP information for the outgoing mail server
    Server name: smtp.mail.me.com
    SSL Required: Yes
    If you receive errors when using SSL, try using TLS instead.
    Port: 587
    SMTP Authentication Required: Yes
    Username: Your full iCloud email address (for example, [email protected], not emilyparker)
    Password: Your iCloud password

    Those are the correct settings, and they work with any email client that supports Imap.
    Try again.

  • How do I make my iPod classic work with iTunes 9.1

              How do I make my iPod classic work with iTunes 9.1?

    You are correct in some of your assertions, Limnos but, if I were to follow Apple's wishes, I would have to purchase the latest and greatest Apple product every month!  I refuse to do that.  I understand that my G4 is old but, it does what I need it to do.  To answer your question though, I purchased the iPod classic as a refurbished unit, about 5 years ago and had it replaced three times, since then so, there is no way for me to know how old it is.
    From my knowledge of how the Classics work(which is extensive.)  It is basically a hard disk.  There should be of performing a low level format, plug it back in and the G4 should recognize the ROm and automatically search for the correct software associated with that version of iPod and load it but, Apple will most likely no longer carry the software on their servers anymore!(surprise,surprise.)

  • What is the best way to record a project to an external recorded via firewire. Also, who makes a recorder that works with a mac?

    What is the best way to record a project from the timeline to an external recorder via firewire? Also, who makes a recorder that works with a mac and recordes in realtime? This is possible right?

    While theoretically possible, sometimes the camera people disable recording back to tape from the computer due to DRM (digital rights managment) issues. They will allow tape to tape transfers however.
    Test your process first is all I can advise.
    x

  • I'm unable to open my Office Word for Mac. The message say's check with developer to make sure Microsoft Word works with this version of Mac OS X.

    I'm unable to open my Office Word for Mac. The message say's check with developer to make sure Microsoft Word works with this version of Mac OS X.
    Orginally I downloaded OFFICE from the Apple Store App, so unable to reinstall as it suggest.

    Which version of Office, 2004, 2008 or 2011
    and
    MS Office is not available from the App Store, so where did you get it?

  • DEAR APPLE, PLEASE MAKE YOU USB MODEM WORK WITH LION. Thank you so much.

    DEAR APPLE, PLEASE MAKE YOUR USB MODEM WORK WITH LION.
    Thank you so much,
    Yuri

    Yuri,
    Try Apple Feedback
    Check out the Zoom 3095

  • An Idea: How to make the Magic Timeline work with Tracks

    i have thought about this for a title and i think i have found a solution. the magic timeline is pretty cool but with it we lost tracks. for broadcast (not only for that but mostly for it) you need tracks that are assignt in a special way and there is no way around it. so i came up with the following idea…
    to make the magic timeline work with tracks it will be a like an audio compound clip, that will give you full access to the magic time. but it can be outputted to proper tracks assignment.
    current audio compound clips don't show you the video if there is one. this one will. also audio can be tagged to a track so it will automatically drop into the right track. you can of course move the audio from one track to another. moving the clip to another track will auto change the tag to new track. if you copy an audio clip from one track to another, the original clip will keep its tag but the copied one gets the new tag.
    example…
    you do a voice over with all your edits and stuff. then you collapse it to a track (new name to get rid of any sort of confusion). you can tag/name the track to "voice over" or whatever you want and color label it.
    you need to edit, adjust it? no problem! double click it and it will open up and you'll see the magic timeline. edit till you done and click on arrow to return to track view.
    export your movie with proper tracks for broadcast right out of final cut pro x
    in the end your output timeline looks like a timeline from fcp7 before you output it on tape.
    could this work? i believe it could and it would help to make fcpx ready for broadcast.
    i hope this makes some sort of sense to you
    anyway, i hope apple will include this or something like this in an update for fcpx.

    You may be able to get by with just running MDT 2010 for now. *However* you *must* ensure that you are running WinPE 3.1 or greater, If you are unsure, open up a command prompt in WinPE (PRess F8), and run "ver" it should say build 7601 or greater, 7600
    and less is not compatible.
    When done, Run the Dell Advanced Format tool in the Full OS on a deployed machine to verify:  http://del.ly/afhdd  Although it is possible to install an OS on an Advanced Format Drive
    with WInPE 3.0 or earlier, and it may *appear* to work, performance may suffer. The Dell AF tool should tell you if the sectors are aligned properly.
    Additionally, it is also possible that the storage driver you have installed in your image is incompatible with AF drives. Check the Make/Model and check with the Hardware Mfg to see if they have driver that supports AF drives.
    Keith Garner - keithga.wordpress.com

  • So, I've taken my panasonic printer back to the shop and exchenged it for a Canon MF-4430. Alas... the generic drivers do not make it print. Is it possible to get drivers to make this canon printer work with my lovely Mac Book Pro Snow Leopard, 6.8?

    So, I've taken my panasonic printer back to the shop and exchenged it for a Canon MF-4430. Alas... the generic drivers do not make it print. Is it possible to get drivers to make this canon printer work with my lovely Mac Book Pro Snow Leopard, 6.8?

    I could not find a MF-4430 at the Canon site. Are you sure the model is correct? They have a MF4450. The Mac drivers are here:
    http://www.usa.canon.com/cusa/support/consumer/printers_multifunction/imageclass _series/imageclass_mf4450#DriversAndSoftware
    If you are sure you have a MF4430, look around the canon site for the drivers.

  • How to make the bt hub work with GreenBee?

    I have some old BT hub (hub 2,3,4) can I make any of them work with another ISP like greenbee I heard changing the user name and password works? But I don't know what to change them to

    There are some options on this web page.
    Wireless connection problems
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • How to make the mobile application work with firewall and anti-virus ON

    Hi,
    I keep on receiving internal processing error when i try to login sap mobile solution 1.3.0 on my ipad and i was provided a solution, that is to turn off my firewall and antivirus. I works by turn off both of it but i cant possible turn of the firewall and antivirus on the server.
    Can anyone guide me how to make the mobile application work with firewall and anti-virus ON
    Thank you

    Dear Rajesh,
    Create a policy in your fire wall to allow the port to send and receive data.
    I believe the port for the mobile should be port 8080 and 8443.
    And your license server port 30000 and 30001
    nd.Q

  • Trying to import a .mov file made with gotomeeting - no problems in past yet says No importable files -None of the selected files or folders can be imported. Change the selection and try again.  re-recorded 3 times and still not accepting HELP

    Trying to import a .mov file made with gotomeeting - no problems in past doing this. After 3 attempts recording the hour long video and trying to upload it to iMovie, it says No importable files -None of the selected files or folders can be imported. Change the selection and try again. What could the reason be?

    After much research and troubleshooting, GoToMeeting replied with the final answer: We do not support the uploading of recordings to editing software. If you are having issues uploading a recording, unfortunately, we do not have tools or steps to resolve this. It is not a supported feature. I am sorry for any inconvenience this may have caused you. 
    The no longer plan to support editing of recordings made with their software.  So, we are planning to find a new meeting provider.

Maybe you are looking for