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

How to create a feedback form in my website?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $yourname = $_REQUEST['yourname'];
  3.     $youremail = $_REQUEST['email'];
  4.     $yourorg = $_REQUEST['yourorg'];
  5.     $yourcomment = $_REQUEST['yourcomment'];
  6.     $submit = $_REQUEST['submit'];
  7.  
  8.     if(isset($submit)) 
  9.     {
  10.         if($yourname ==""){
  11.         $error = "Please fill in your name.."; }
  12.         elseif($youremail =""){
  13.         $error = "Invalid email address"; }
  14.         elseif($yourcomment == ""){
  15.         $error = "Please fill in your comment"; }
  16.     }
  17.     else
  18.     {
  19.             mail("binodranarai@yahoo.com","$yourname<$youremail>",$yourcomment);
  20.             print "<link href='feedback.php'>";
  21.     }
  22. ?>
I get the following Error. How can I overcome the following error? Please help me.

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\feedbackfrm.php on line 19
Nov 10 '10 #1
1 1807
Cmaza
16
Your PHP installation (most likely) doesn't have a default sendmail_from (originating email address) specified in its configuration and no originating email address has been specified in the headers of your call to mail (function).

Also, if the "$yourname<$youremail>" part of your call is the intended originating email address, then the syntax of your call isn't entirely accurate, as the second (2nd) variable of a mail call should be the subject.

The correct syntax for mail is ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ).

Instead of:

mail("binodranarai@yahoo.com","$yourname<$youremai l>",$yourcomment);

Try:

mail("binodranarai@yahoo.com",$subject,$yourcommen t,"From: ".$yourname." <".$youremail.">");

(Where $subject represents the intended subject header of the email to be sent).

To give you an idea, for comparative purposes, this is what the call to mail() looks like as it is in the email management component of my CMS:

mail($msgto,"[".global_sitename."] ".$msgsubject,$content,"MIME-Version: 1.0\r\nContent-type: text/plain; charset=iso-8859-1\r\nFrom: ".global_mail_blackhole);

I hope this helps. :)
Nov 10 '10 #2

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

Similar topics

5
by: Andrew | last post by:
Where can i find a free feedback form in php script to download it and put it in my website? thanks in advance andreas
2
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm...
1
by: Andrew | last post by:
Where can i find a free feedback form in javascript to download it and put it in my website? thanks in advance andreas
6
by: Zagor | last post by:
I have a feedback form in my website with three TextBoxes and a SEND button in a user control. Below is a piece of the code: //On click event for the send LinkButton private void...
0
by: vijay | last post by:
hello friends, I have done one website by using frontpage 2005 and i have done the feedback form.Now I want to send this feedback form to email id.I have used mailto: in form tag...
4
by: Jigar A. Thakor | last post by:
how to create online shopping website.. ?? any architecture ?? How to design any guidlines ? and what is verisign ?? other secure protection needed ?? i want to develop in C#,Asp.net,Sql Server...
1
by: lali | last post by:
hi everybody, i am doing a project and i have strucked in middle of my code usiong asp. the problem is, in the feedback form there are many fields which are manidatory.when an user fills the form...
3
meenesh
by: meenesh | last post by:
related to above question please help me out :-- on the basis of above interact with database i also want some animated output to appear such as "smile should increase if student secure above 90...
25
by: impin | last post by:
users fill the feedback form and send mails to us. i wnat to ue php mail() function. plz help how to use the php script? what are the things i need for that? i am new to this plz help...
1
by: Mitturu sudhi | last post by:
hi i have created a feedback form , its working on wamp server but in online its not posting data to database. here am providing code please someone help me. Feedback.php <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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.