|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: A Simple Feedback Form With PHP
If you have any questions or comments on this article then please post them here.
|
|
#2
|
|||
|
|||
|
Is it possible to send an html based email with the mail function in php or just text based? Thanks!
|
|
#3
|
|||
|
|||
|
I found this in the manual.
Send these strings in the mail header. $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; Take a look in the manual for further explanation. They have an excellent example. ![]()
__________________
Best Regards, Håvard Lindset |
|
#4
|
|||
|
|||
|
Thanks Lindset! That helps a lot. I thought I gave the manual a good look-over, but not good enough it seems. Thanks again.
|
|
#5
|
|||
|
|||
|
Please help me ! I get an error
Hi !
I do the same as tutorial "A Simple feedback form with PHP" But I get theses error : Warning: Failed to Connect in d:\www\docs\feedback\sendmail.php on line 21 Warning: Cannot add header information - headers already sent by (output started at d:\www\docs\feedback\sendmail.php:21) in d:\www\docs\feedback\sendmail.php on line 22 Please help me to solve this error. Thank you |
|
#6
|
|||
|
|||
|
Can you please post the code you're having trouble with.
The problem with "Headers already sent..." is because you're outputting something before sending your header(). Make sure you have no blank lines at the top of your script.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#7
|
|||
|
|||
|
Re: Please help me ! I get an error
Quote:
Thank Frank for helping me solve problem |
|
#8
|
|||
|
|||
|
Hi, I am creating a slightly more advanced form of the feedback script, but it only allows 5 variables to included. Is there any way of increasing this, to say, 10?
|
|
#9
|
|||
|
|||
|
John,
Not sure I understand... But why are you only limited to 5 variables? Could you post the code so we can take a look at it. |
|
#10
|
|||
|
|||
|
By variables I mean form fields. I've actually rectified the problem by using a different script. But the problem was occuring with the 'mail' part of the PHP script:
<? mail( "yourname@yourdomain.com", "Feedback Form Results", $message, $fieldA, $fieldB, $fieldC, "From: $email" ); header( "Location: URL" ); ?> When that form was sumitted there was error something along the lines of "Too many variables, only 5 variables expected in line 2", which was where the mail command was. The script worked fine if the $fieldA, $fieldB and $fieldC fields were removed from the PHP and the form though. |
|
#11
|
|||
|
|||
|
Hi John,
Ahh... That actually has to do with PHP's Mail() function. You are passing too many variables... What you would need to do is embed the extra values, you want to pass, within the $message variable: $message = $message . "\n\n$var1\n$var2\n$var3\n$var4\n$var5"; That's just one way of doing it... To get a nice output, you need to play around with it... If you're still interested in modifying the original script you had, let me know, and I'll help you out! |
|
#12
|
|||
|
|||
|
Ah.. right! I knew there would be a simple answer! Thanks. I'm new to PHP, so still have a lot of learning to do
Thats okay, i've sorted it out now. Thanks again John |
|
#13
|
|||
|
|||
|
i successfully completed this tutorial, but am not receiveing any emails from it when someone posts to it, can someone try for me?
http://keyworthgraphics.com/feedback.html it seems to work ok, maybe have a look at the source, i just can't figure out what else might need to be edited... ![]() |
|
#14
|
|||
|
|||
|
Simple forum , for some reason iv been working on it for an hour and i am at the verge of beating my skull into the monitor.
--------------------------------------------------------------------------- Notice: Undefined variable: message in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 Notice: Undefined variable: name in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 Notice: Undefined variable: email in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 Warning: Cannot modify header information - headers already sent by (output started at C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php:1) in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 2 I dont get it, the php.ini is set up right and the variables are defined. im not a expert at php, i just need some help. <<---CODE:----- | -------------------[feedback.php]--------------------- <FORM action="sendmail.php" method=post> <p>Email:<INPUT type="text" name="email"> Comments:<br> <TEXTAREA name="message" cols="25" rows="7"></textarea> <br> <input type=submit value="send"> </FORM> ---------------------------------------------- ----------------[sendmail.php------------------------------ <?php mail("shorty40@fuse.net", "Feedback Form Results", "$message", "From: $email"); header("Location: http://skata.kicks-ass.net/feedback/thankyou.php");?> ------------------------------------------------ I'm very sorry for the long Post, but i need help. ![]() |
|
#15
|
||||
|
||||
|
Quote:
This is easily solved, skata.. I'll go down the list for you. 1st) Notice: Undefined variable: message in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 This means that the variable $message is not declared anywhere prior to trying to use it.. IE: It has a blank value, or has not been initiated. 2nd) Notice: Undefined variable: name in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 This means that the variable $name is not declared.. just like above.. 3rd) Notice: Undefined variable: email in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 This means that the variable $email is not declared anywhere.. just like above.. 4th) Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Documents and Settings\UserX001\My Documents\My Webs\feedback\sendmail.php on line 1 This is really easy to solve... take your code from above: Quote:
and change it to this: PHP Code:
And lastly) add ob_start(); at the beginning of the code and ob_flush(); at the end.. or just remove all of the spaces before your code ![]() Hope this helps. |
|
#16
|
|||
|