Try to make a php file work with my email form

Hello

Going a little crazy trying to link my php with my HTML file and actually make it work.

He (php file) continues to come up with a syntax error on line 37 - code indicators may not work etc etc but there is no error in what I see - can anyone else point out the course for me? This leads me in the corners!

my code:

<? PHP

/ * Subject and Email Variables * /.

$emailSubject = "form";
$webMaster = ' [email protected] ';

/ * Collection of 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 = < < < NEM
< br > < hr > < br >
Name: $name < br >
Address: $address < br >
Phone (day): $telephone1 < br >
(Mobile) phone: $telephone2 < br >
E-mail: $email < br >
Childs name: $name2 < br >
Starting age: $age < br >
Childs Birth Date: < br > $dob
Favorite form of communication: $comms < br >
Message: $message < br >
NEM;

$headers = "from: $email\r\n";
$headers. = "content-type: text/html\r\n";
$success = email {$webMaster, $emailSubject, $body, $headers};

/ * Results made in the HTML form * /.

$theResults = < < < NEM
< html >
< head >
< title > < /title > Xxx
< meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 ">"
< style type = "text/css" >
<!--
{body
background-color: #f1f1f1;
do-family: Verdana, Arial, Helvetica, without serif.
do-size: 12px;
make-style: normal;
line-height: normal;
make-weight: normal;
Color: #666666;
text-decoration: none;
}
->
< / style >
< / head >

< div >
< div align = "left" > thanks for your message, your email will be answered very soon! < / div >
< / div >
< / body >
< / html >
NEM;
echo "$theResults";

? >

Line 37 is the following:

$success = email {$webMaster, $emailSubject, $body, $headers};

It should be this:

$success = mail ($webMaster, $emailSubject, $body, $headers);

Also the From header: is: $headers = "From: $email\r\n"; but I do not see the variable defined for $email

Also, you need to know about electronic fuel injection. Someone could inject your headers and add additional BCC: addresses to send emails to multiple recipients undisclosed through your mail script. You would use your script to turn your server in a host for spam! Sanitize your fields to prevent injection attacks! Safety must be the priority of the followed firt of functionality. If it's not safe, it should not work

Tags: Dreamweaver

Similar Questions

  • Quick help with client email form

    I just created my form and .php file to send to an email address. All the input fields work correctly, except one. I can not a drop of water to the low sending (main category) field to send me the presentation. The form works fine on the Web site, e-mail leaves a field empty. Any help in my coding would be greatly appreciated.

    form:

    < do action = "merchantsignup.php" method = "post" id = "contact_form" > "

    < Center > < table width = "637" border = "0" >

    < b >

    < td > company name:

    < br / >

    < input type = "text" name = "name" / > < table >

    < td > business telephone:

    < br / >

    < input type = "text" name = "phone" / > < table >

    < td > Business Email:

    < br / >

    < input type = "text" name = "email" / > < table >

    < /tr >

    < b >

    < td > business address:

    < br / >

    < input type = "text" name = "address" / > < table >

    < td > city & Zip:

    < br / >

    < input type = "text" name = "city code" postal / > < table >

    < td > Business Web page:

    < br / >

    < input type = "text" name = "Web page" / > < table >

    < /tr >

    < b >

    < td > main category < br / >

    < select name = "Main category" >

    < option value = "Food" > food < / option >

    < option value = "Soda" > Soda < / option >

    < option value = "Candy" > Candy < / option >

    < / select >

    < table >

    < td > sub-category:

    < br / >

    < input type = "text" name = "Category2" / > < table >

    < td > < p > < / p > < table >

    < /tr >

    < b >

    < /table >

    < td > < p > on the Business: < br / >

    < textarea cols = "88" lines = '8' name = "a connection" > < / textarea >

    < / h3 >

    < /p >

    < p > < input type = "submit" name = "submit" value = "Send" / >

    < input type = "reset" name = 'reset' value = 'Clear form' / > < / p >

    < / make >

    .php files

    <? PHP

    / * Email Variables * /.

    $emailSubject = "market entry";

    $webMaster = ' [email protected] ';

    / * Data variables * /.

    $name = $_POST ['name'];

    $phone = $_POST ['phone'];

    $email = $_POST ['email'];

    $address = $_POST ['address'];

    $city = $_POST [' city/postal code'];

    $webpage = $_POST ['page'];

    $main_category = $_POST ["main"];

    $category2 = $_POST ["Category2"];

    $about = $_POST ['about'];

    "" $copy_photo [0] = "";

    $body = < < < NEM

    < br > < hr > < br >

    Name: $name < br >

    Phone: $phone < br >

    E-mail: $email < br >

    Address: $address < br >

    City: $city < br >

    Wegpage: $webpage < br >

    Main category: $Main < br >

    Category2: $category2 < br >

    Topic: $about < br >

    NEM;

    $headers = "from: $email\r\n";

    $headers. = "content-type: text/html\r\n";

    $success = mail ($webMaster, $emailSubject, $body,

    $headers);

    / * Results made in the HTML form * /.

    $theResults = < < < NEM

    < html >

    < head >

    < title > < /title > message sent

    < meta http-equiv = "refresh" content = "3; URL =http://lf.com/index.shtml' > .

    < style type = "text/css" >

    <!--

    {body

    background-color: #000;

    do-family: Verdana, Arial, Helvetica, without serif.

    font size: 20px;

    make-style: normal;

    line-height: normal;

    make-weight: normal;

    Color: #FF0000;

    text-decoration: none;

    padding-top: 400px;

    margin left: 250px;

    Width: 800px;

    }

    ->

    < / style >

    < / head >

    < div align = "center" > thank you for your communication! You will receive an email from us shortly! < / div >

    < / div >

    < / body >

    < / html >

    NEM;

    echo "$theResults";

    ? >

    Any help would be greatly greatly appreciated!

    Your form does not match your script.  Try to be consistent in your naming conventions.  Also, PHP is case sensitive be careful at that as well.

    Change this in your form:

    And change the variable data in PHP:

    $main_category = $_POST ['main'];

    to do this:

    $main_category = $_POST ['main_category'];

    It should work now.

    Nancy O.

    ALT-Web Design & Publishing

    Web | Graphics | Print | Media specialists

    http://ALT-Web.com/

    http://Twitter.com/ALTWEB

    http://ALT-Web.blogspot.com/

  • I want to send my message by mail with the email form that I have already installed

    I want to send my message by mail with the email form that I have already installed

    original title:<>

    Hi Michael,

    I suggest you to check if you get the same message in Internet explore, if you use Firefox I suggest you contact Firefox for using the link below.
     
    Hope this information helps.
  • Satellite L40 - 14F - can't make my sound card works with XP

    I can't make my sound card works. I tried to install all versions of drivers, but not sound.
    Then I tried installing high-definition sound updated for windows XPSP2 and still nothing.

    Ultimately, when I installed the drivers for another computer, I could see a sound card in Device Manager, but I got! the driver and it says "the device cannot start. I installed a new original drivers and once more, nothing has changed.

    Is there a possible way to solve this problem?
    PS. using Toshiba L40-14 f :-) and Windows XP pro with service pack 2.

    Hello

    Satellite L40 - 14F belongs to the series of PSL4CE.
    XP drivers for this series don t exist on the Toshiba page at the moment!

    I have found that the package of XP driver for PSL48, PSL49, PSL4C and PSL4B model number!

    So, it seems that you simply try to install incompatible drivers!

    If I m not wrong not the device uses the Codec Realtek ALC660 chip and chip high definition audio Intel HDA (Azalia)!

    Check the driver from the Intel page and upgrade the XP to the last State at the beginning

  • How to make a flash file works as an epub or an online catalogue? buttons does not work...

    Hello I am doing an epub or a catalog online for my business, so people can open them on an Ipad. If someone could tell me the steps of the procedure to follow, that would be great. I already have the pages in photoshop and Illustrator CS5 and classified in InDesign CS5 and then exported to Flash to create buttons to switch pages, then converted to html file using technologies wallaby, but when I try opening upward in the html file, the buttons does not even appear. I even tried switching buttons to those I made in Illustrator and it still doesn't work. It works fine when I open the SWF on my computer but I can't send the SWF for a reason any. And my goal is to send this catalogue online by mail and by email. If someone could please help me accomplish this, I would appreciate it.

    Ah... I didn't know that you redo this post. I'll just say the jist. For publications that want to just produce something devices can read, focusing on the publication and the technology behind it, worry, this product is made for you (works with InDesign, Illustrator, etc.):

    http://www.Adobe.com/products/Digital-Publishing-Suite-family.html

    A multitude of devices and media can then see your published content.

  • I can't read the files Works with Word 2000.

    I've been using Microsoft Word 2000 so I removed my program works, now I can't open the files to work. I can't restore works.  A message says that I need a works332.cnv conversion program.  Download the converter from Microsoft?

    Have you looked at?

    http://Office.Microsoft.com/en-us/Office-2000-Resource-Kit/working-with-Word-2000-text-converters-and-graphics-filters-HA001138192.aspx

  • I have install the cut NET program and when I turn there's spoof arp say massage appear__it stopped working technology to give me an image that has shut the program___what can I do to make the net can work with system of visited

    I installed the program cut NET and when I turn there is massage appear
    IE is (spoof arp stopped working) is
    Give me an image that has me to close the program

    What can I do to make it work with the system visited the the net cun

    http://www.Microsoft.com/Windows/compatibility/Windows-Vista/default.aspx

    Windows Vista Compatibility Center

    First thing to do is to check its Vista compatibility at the link above, and if not to see what patches/solutions are available from its manufacturer...

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-compatibility-mode/

    If this is not Vista compatible, read the info on the link above.
    It works for some programs, but not all.

    This applies to software programs, NOT hardware drivers.

    If it's Vista compatible > uninstall it > Re-download/save to your desktop > right click on setup.exe O run as admin.

    See you soon.

    Mick Murphy - Microsoft partner

  • contact form does not work with certain email addresses

    My contact form was working fine until a few weeks ago, it won't work with the e-mail address I used. I tried different address some work, some don't, what gives here.

    For what I pay, I shouldn't have this problem.

    Please find a similar discussion here and try the above suggestion:

    http://forums.Adobe.com/message/6304524#6304524

    Thank you

    Sanjit

  • Problem with my email form

    Hi all

    I ran into a small issue and cannot see what is causing my email form does not work. I did a few times now and that you have copied the actionscript code that I currently work but the it still does not work. The form can be seen live here and the flash file can be downloaded from here.

    I am enclosing the code to my flash below form and if anyone requires the code to my page email.cfm (this is the page that processes and sends emails) so please let me know. I'd appreciate any help I can get with this, and I work on it for a few days now and have rewritten the code about 6 times - it starts to do my head in.

    Thank you in advance.

    FOR INFO:
    the difference between
    var _loc3 = new LoadVars();

    and
    var _loc3:LoadVars = new LoadVars();

    There nothing regarding the bytecode generated.

    But it is a best practice. It allows code and type etc. check indicators

  • How to let *.amd file work with active static selector

    Well, I try to use different background for different visualstyle pattern. but I don't know how to make it work.

    my bottom paint is:

    ImagePaintDefinition {
        id: backgroundPaint
        imageSource: "asset:///Background.amd"
        repeatPattern: RepeatPattern.XY
    }
    

    Background.AMD is:

    #RimCascadesAssetMetaData version=1.0
    source: "Background.png"
    repeatable: true
    

    If I use the structure of file like this:

    -VisualStyle.bright

    | - Background.png

    -VisualStyle.dark

    | - Background.png

    -Background.amd

    the error message is:

    Image not found: "/ apps/***/native/assets//Background.png".

    or if I use the structure of file like this:

    -VisualStyle.bright

    | - Background.png

    | - Background.amd

    -VisualStyle.dark

    | - Background.png

    | - Background.amd

    the error message is:

    "AssetMetaDataParser: file not found: /apps/***/native/assets//Background.amd".

    I'm so confused. could someone help me with this problem? Thank you very much!

    Thank you very much for your advice!

    It looks like to caused by my Dev Alpha A, which is always the version 10.0.0 rather than the new version 10.0.1. Because the second structure works well on the Q10 Simulator which has version 10.0.1.

    Now, I try to use the following structure. He has passed the test on my Dev Alpha A, and I'm about to test it on the simulator of Q10.

    | - Background.png
    | - Background.amd

    -VisualStyle.bright
    | - Background.png
    | - Background.amd
    -VisualStyle.dark
    | - Background.png
    | - Background.amd

  • . Alias files work with vi running in the development environment?

    If I have a vi that uses the NSV or front binding to NSV by using the project library names will be they resolved since a .alias file run from the OF?

    NEITHER Documentation mentions how it works for the casting of the exe.

    OK now I can answer my own question... Yes they do.  The alias file is located adjancent to the project file and inherits the name of the project.

    Everything works as expected.

  • I use 10 MSOffice and try to get speech recognition to work with MSWORD 10. How this connection or enable the job to type documents with speeches? Thank you. Ken D.

    The speech bar appears and indicates that the program is tuned, however, I can't seem to activate in MS WORD for my documents.

    The speech bar appears and indicates that the program is tuned, however, I can't seem to activate in MS WORD for my documents.

    First do the following:

    1. Click with the right button on the microphone in the WSR speech bar
    2. Click on Options
    3. Make sure there is a check mark beside "Enable dictation everywhere."

  • BlackBerry Q10 can make a unlocked Blackberry works with Verizon?

    I have a Q10, and I'm at the end of my contract. Verizon does not have a model I want. Also, they do not support the phone at the local level, but I have to stay with Verizon for the reception where I operate. I can slip my Sim Card into something like a passport and use it on Verizon?

    Hello and welcome to the community!

    You should consider the different models and submodels (for example, there are 4 variations of the Z10) to determine the characteristics of radio frequency technology / device. Then you must watch the carrier you want to operate on and determine if your specific device is compatible with their network or not. For example, if you choose a device variant which is not a CDMA radio inside, then it is impossible to use it on a CDMA support. Similarly the LTE and the support of the frequency bands. Your device must be compatible with your operator, otherwise the function is impossible.

    Here is a sample of some resources that may be useful for you:

    I am sure that, with a little digging, you will find resources that suit your specific needs.

    In addition, often with CDMA carriers that go beyond simply to accept the SIM card inside a compatible device. Often, the CDMA carriers insist on a deeper inscription to their network, they do. And so, if they say 'no' to the device that you want to use (even if it is compatible), then there is no way to get around that. Some carriers do not allow the BYOD (bring your own device).

    Basically, if I were you I talk to my carrier and see what they allow.

    Good luck!

  • Can I make Illustrator CC files compatible with previous versions?

    Hello

    I'm taking a class of new media, and I have a class on Illustrator. I'm subscribed to CC from Adobe and download Illustrator but my teacher only works in CS5 and CS6. How can ensure you that he will be able to open and view my files correctly?

    Give it a name, and then click OK. Then the second dialog box is displayed.

    Please also take a look in the manual.

  • Try to get ESX 3.5 work with EMC CX200 [joint Direct]

    Hello world

    Anyone else running a Dell / EMC CX200 configuration with VMware ESX 3.5?

    I am being charged to take two recently introduced Dell 2850 which were broadcast from Emulex LP982 in a direct CX200 attached for years without any problem and put it ESX 3.5 on them, so we can virtualize on the CX200.

    I have a host ESX 3.5 Eval living and speaking very well to the CX200.  I am very satisfied with the performance.

    Bringing the second host online, this is where to get a weird behavior seriously: host crashes, bombs of I/O, etc..  If you want newspapers, I can catch them.  I think that it is such a simple plant that I'm missing something obvious.

    Connectivity is as follows:

    HOSTA - & gt; Emulex1-


    & gt; SPA0

    HOSTA - & gt; Emulex2-


    & gt; SPB0

    HOSTB - & gt; Emulex1-


    & gt; SPA1

    HOSTB - & gt; Emulex2-


    & gt; SPB1

    I updated the firmware in all but the TORCH on the CX200 = $$$.

    I guess that the host of the 2nd is stepping on toes somewhere.  Arbitrate paths inside the LUN Configuration ESX work this out?  What failover vmotion & path?

    I'm about to cusp of something good here, just need of a sudden boost on getting 2nd host cooperating.

    Thank you

    Docz

    Post edited by: docz

    Hello

    If the CX200 does not have a storage processor then what you do will not work because each host interfere with other metadata for guests. If she has a storage processor then you really need to a fiber switch as direct attach to a SAN not is not supported.

    Best regards
    Edward L. Haletky
    VMware communities user moderator
    ====
    Author of the book ' VMWare ESX Server in the enterprise: planning and securing virtualization servers, Copyright 2008 Pearson Education.
    Blue gears and SearchVMware Pro items - top of page links of security virtualization - Security Virtualization Round Table Podcast

Maybe you are looking for