473,549 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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 1357
Dormilich
8,658 Recognized Expert Moderator Expert
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
2126
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 several years without problem. It's a relatively simple program that reads the file names from the current directory and replaces strings of text...
15
4723
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 button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is...
4
1993
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 contains a <formthat should be submitted to an external ASP page. The <formtag naturally cointains a target=_blank and a proper action.
8
4478
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. Is there anyway to tell? Here's the code. It sends me email fine, but when it's on her ISP, it says it sent the mail, but nothing goes through. ...
11
1921
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 i had a link display_story.php?id=334 it would know do display the entry which matched id 334, my code to display the entry looks like this ...
3
1882
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 being relayed directly to my email. This is the code, and thanks in advance!: <div id="form"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
3
2814
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 using the POST method, that should redirect to an html thank you page upon successful submission of the form. All three pages currently reside on a server...
3
1312
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 html so that I can make it look like a completed document staff would normally see instead of just a series of lines with text. I have tried a...
2
1348
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 the Phone Number field the senders phone number is just coming back blank. This is my code: <?php if ($_POST == "contactform") { $emailTitle =...
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7718
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1936
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.