473,408 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Email form no longer working - using HTML, CSS & PHP

Hello,
Let me preface this by saying that I am not a coder. I'm a graphic designer that does some web design once in awhile. I recently had a client tell me she's not been receiving her emails through her contact form on her website: http://diamondgirlsbartenders.com/contact.html

Her email is working fine and she can send and receive them without problem, so I'm thinking the problem is with the form - or the PHP used to submit the form data.

Here is my HTML code:

Expand|Select|Wrap|Line Numbers
  1.   <div id="formImage"><img src="http://bytes.com/images/contactcollage.jpg" /></div>
  2.  
  3.   <div id="stylized">
  4.  
  5.   <form id="form" name="form" method="post" 
  6. action="mail.php">
  7.  
  8.     <label for="event">Event Type:</label>
  9.     <input type="text" name="event" tabindex="1" />
  10.  
  11.     <label for="name">Your Name:</label>
  12.     <input type="text" name="name" tabindex="2" />
  13.  
  14.     <label for="email">Email Address:</label>
  15.     <input type="text" name="email" tabindex="3" />
  16.  
  17.     <label for="phone">Phone Number:</label>
  18.     <input type="text" name="phone" tabindex="4" />
  19.  
  20.     <label for="comments">Comments:</label>
  21.     <textarea name="comments" rows="10" cols="25" tabindex="5"></textarea>
  22.  
  23.     <button type="submit" value="Send" tabindex="6">Submit</button>
  24.  
  25. </form><!-- end of contact form -->   
  26.  
  27.  </div><!-- end of stylized div -->

Here is my PHP code (simple I know but it used to work!):

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $nameField = $_POST['event'];
  3. $nameField = $_POST['name'];
  4. $emailField = $_POST['email'];
  5. $phoneField = $_POST['phone'];
  6. $messageField = $_POST['comments'];
  7. $formcontent=" From: $name \n Phone: $phone \n Comments: $message";
  8. $recipient = "mary.rodriguez@diamondgirlsbartenders.com";
  9. $subject = $_POST['event'];
  10. $mailheader = "From: $email \r\n";
  11. mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
  12. echo "Thank You! We Will Contact You Soon!" . " -" . "<a href='index.html' style='text-decoration:none;color:#ff99cc;'> Return Home</a>";
  13. ?>
I'm not receiving any syntax errors, and I can't seem to find the problem. Would one of you PHP experts be able to tell me what I'm doing wrong?

I would appreciate any assistance.

Thank you,
Toni
Aug 19 '14 #1
1 1352
Dormilich
8,658 Expert Mod 8TB
you’ve used $name, $phone etc. in the text, but your form values are pushed into $nameField, $phoneField, etc.
Aug 20 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: GO | last post by:
I have a custom Perl application (programmed by myself) that is used to rename files. For some reason, within the last month, it is no longer working properly. Prior to this I've been using it for...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
4
by: newcomsas | last post by:
Hallo. I'm working on an email message sent in HTML format. As the email reach the adressee the HTML is correctly visualizaed (I made sever tests with Outlook 2003). The fact is that the code...
8
by: alice | last post by:
I found this code for making a php email form for a web site. It works fine on my ISP, but not on my friends...could it be that my ISP uses php5, I know that hers does not, so I assume it's php4....
11
by: cwhite | last post by:
i recently upgraded from fedora core 5 to cent os 4.4 with php 4.3 mysql 4.1 and apache 2.0.52, and all of the php scripts i had which called specific entries from mysql are no longer working if...
3
by: missred | last post by:
Hi All, I'm hoping someone can help me with this problem. the form works ok in firefox and IE6, but when send is pressed, a blank email form or a blank IE7 page comes up, instead of the message...
3
by: jennifer6601 | last post by:
Hello. I am new to this forum as well as to ASP and need some help with a simple email form for a website I've developed. I have a simple html email form that is processed with an ASP script...
3
by: copleyuk | last post by:
I have created a form and am emailing it via php. If I use plain text I can get all the entered information to email correctly. However, I wanted to have the information from the form laid out in...
2
by: Kenny78401 | last post by:
I am new to PHP and setting an email form. I have this form working now with the exceptions. First I want a copy of the message email back to the sender. What is the PHP code for this? Second with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.