473,398 Members | 2,368 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,398 software developers and data experts.

Form will not work

I found a form that I would like to use. But all so like to add more fields. As it is now. When I click on send. it doesn't work. Can someone help me please.

This is what I have now.

[z{link to commercial site redacted - see faq}]

Sorry, my mistake.

This is the .php file. The submit button doesn't work.


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $field_name = $_POST['cf_name'];
  3. $field_email = $_POST['cf_email'];
  4. $field_message = $_POST['cf_message'];
  5.  
  6. $mail_to = 'dedalusonline@yahoo.com';
  7. $subject = 'Message from a site visitor '.$field_name;
  8.  
  9. $body_message = 'From: '.$field_name."\n";
  10. $body_message .= 'E-mail: '.$field_email."\n";
  11. $body_message .= 'Message: '.$field_message;
  12.  
  13. $headers = 'From: '.$field_email."\r\n";
  14. $headers .= 'Reply-To: '.$field_email."\r\n";
  15.  
  16. $mail_status = mail($mail_to, $subject, $body_message, $headers);
  17.  
  18. if ($mail_status) { ?>
  19.     <script language="javascript" type="text/javascript">
  20.         alert('Thank you for the message. We will contact you shortly.');
  21.         window.location = 'contact_page.html';
  22.     </script>
  23. <?php
  24. }
  25. else { ?>
  26.     <script language="javascript" type="text/javascript">
  27.         alert('Message failed. Please, send an email to louis@charismacommunications.ca');
  28.         window.location = 'contact_page.html';
  29.     </script>
  30. <?php
  31. }
  32. ?>
here is the form HTML
Expand|Select|Wrap|Line Numbers
  1. <form action="contact.php" method="post">
  2.     Your name<br>
  3.     <input type="text" name="cf_name"><br>
  4.     Your e-mail<br>
  5.     <input type="text" name="cf_email"><br>
  6.     Message<br>
  7.     <textarea name="cf_message"></textarea><br>
  8.     <input type="submit" value="Send">
  9.     <input type="reset" value="Clear">
  10. </form>
  11.  
Dec 15 '13 #1
3 1258
Luuk
1,047 Expert 1GB
"When I click on send. it doesn't work."
BTW, what is the problem?
What does not work?
Why do you think it does something that you do not want it to do?
What does it doe that you did not expect it to do?

When clicking 'Send' the data is posted to 'contact.php', which redirect to a non-existing page [z{link to commercial site redacted - see faq}]
Dec 15 '13 #2
It doesn't send me an email.
Dec 15 '13 #3
Dormilich
8,658 Expert Mod 8TB
PHP’s mail() function only passes the mail to the OS’s mail handler executable. whether you receive the email or not is of no concern to mail().

for "proper" email sending I recommend a mailing library like SwiftMailer.
Dec 16 '13 #4

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

Similar topics

8
by: Mark12345 | last post by:
Hi folks, thanks for looking. I have a database that takes down order details. Each customer has there own priceid in the price table. the errors that I get say enter parameter value for:...
1
by: Deane | last post by:
I've run into this problem on many occasions -- I need to have the server side form tag on my Web form, of course. But I also need to have *another* form on the page that posts to a URL...
8
by: bruno_guedesav | last post by:
This has ocurred before, but if the person had find a way to solve it or not, I've got no clue. So, here I am to ask for help. I've created a form via pure PHP, basically a bunch of prints...
16
by: DavidGeorge | last post by:
I have an unbound form with three list boxes. The selections made in these list boxes 'filter' the records that appear in an unbound subform. The subform record source is a query which looks at...
6
by: Ken Gardiner | last post by:
Hi Everyone, I am working on a project that seems to need two many to many relationships. I'm having the hardest time figuring out the best way to create a form that will work well for entering...
3
by: xlr8u2 | last post by:
hi all i have been trying and trying to set up a contact page on godaddy. they require that i use a php script here is their example. <form action="/gdform.php" runat="server" method="post"> ...
4
by: dfluker | last post by:
This form will not send the email to my account and I used other forms to submit emails using examples that I googled but I can't get this form to process the request. Can someone tell me what i'm...
0
by: eneyardi | last post by:
I have a form1 and form2, in project properties i select form2 as a startup form, but when i click start debugging, the startup form is form1 instead of form2. How the startup form will take effect?...
2
by: lauralofrumento | last post by:
Hi: I am having issues with the below code. I can not figure out why the form will not direct to the appropriate email based on the state that is selected. It will only direct to "Other". Please...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...
0
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,...
0
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...
0
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...

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.