Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 27th, 2002, 08:15 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 588 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Article Discussion: A Simple Feedback Form With PHP

If you have any questions or comments on this article then please post them here.

Reply With Quote
  #2  
Old July 30th, 2002, 02:57 PM
markerdave markerdave is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Illinois, USA
Posts: 71 markerdave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Is it possible to send an html based email with the mail function in php or just text based? Thanks!

Reply With Quote
  #3  
Old July 30th, 2002, 03:22 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
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

Reply With Quote
  #4  
Old July 30th, 2002, 10:20 PM
markerdave markerdave is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Illinois, USA
Posts: 71 markerdave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Thanks Lindset! That helps a lot. I thought I gave the manual a good look-over, but not good enough it seems. Thanks again.

Reply With Quote
  #5  
Old September 10th, 2002, 04:41 AM
tieubao tieubao is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 4 tieubao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old September 10th, 2002, 05:47 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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

Reply With Quote
  #7  
Old September 11th, 2002, 03:51 AM
tieubao tieubao is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 4 tieubao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Please help me ! I get an error

Quote:
Originally posted by tieubao
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

Thank Frank for helping me solve problem

Reply With Quote
  #8  
Old February 7th, 2003, 04:27 PM
johnwalton84 johnwalton84 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 johnwalton84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #9  
Old February 9th, 2003, 10:15 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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.

Reply With Quote
  #10  
Old February 9th, 2003, 11:40 AM
johnwalton84 johnwalton84 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 johnwalton84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #11  
Old February 9th, 2003, 11:46 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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!

Reply With Quote
  #12  
Old February 9th, 2003, 03:27 PM
johnwalton84 johnwalton84 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 johnwalton84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #13  
Old February 25th, 2003, 08:41 PM
danke danke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Huntington, VT
Posts: 10 danke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question this submit form tutorial

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...

Reply With Quote
  #14  
Old February 26th, 2003, 07:37 PM
skatablaze skatablaze is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: cincinnati
Posts: 8 skatablaze User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to skatablaze
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.

Reply With Quote
  #15  
Old February 27th, 2003, 08:42 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Wink

Quote:
Originally posted by skatablaze

----------------[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.


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:
----------------[sendmail.php------------------------------
<?php mail("shorty40@fuse.net", "Feedback Form Results", "$message", "From: $email");
header("Location: http://skata.kicks-ass.net/feedback/thankyou.php[/url]");?>
------------------------------------------------


and change it to this:
PHP Code:
<?php

$mailto 
"shorty40@fuse.net";
$email "Forumfeedback@fuse.net"//This is just for example
$subject "Feedback Form Results";
$mailheaders "From: $email";
$message "This is where your message would go.";

//Now send the email using the above variables

mail($mailto$subject$message$mailheaders);
header("Location: http://skata.kicks-ass.net/feedback/thankyou.php");
?>


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.

Reply With Quote
  #16  
Old February 28th, 2003, 07:10 PM
skatablaze skatablaze is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: cincinnati
Posts: 8 skatablaze User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to skatablaze
Thanks Justin you've been a great help and now the code works but the only problem is that im not recieving my emails?

As posted previously by "Danke"

----------------------------------------------------

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...

-----------------------------------------------------

Can anyone help out?

thanks from the stoopid n00b ME

Reply With Quote
  #17  
Old March 3rd, 2003, 07:19 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
No worries guy.. Listen, do me a favor and either post your code here that you're using for sendmail.php <I browsed your site, btw you need to put an index.php or something similiar in the /feedback folder, otherwise people can view your files>


That way we can get this fixed for you.

Reply With Quote
  #18  
Old March 3rd, 2003, 07:52 AM
danke danke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Huntington, VT
Posts: 10 danke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re: Justin....

thanks for noticing that post, i think it got layered over with another topic...and i gave up on it...here's the code:
PHP Code:
<?

$to 
"wilkey@wcvt.com";             //Destination Email ID
$name $name;            //Name of the Person
$email $email;        //Email Id of the person
$feedback $feedback;        //Feedback detail

$subject "Feedback Form"." "."$email";  //Subject line of the email

/*********** Email body *******************/

$matter "Below are the details feeled by"." "."$name"."\n".   
       
"Name"." "."$name"."\n".
       
"Email"." "."$email"."\n".
       
"Feedback"." "."$feedback"."\n";

/**********************************************/       
       

mail("$to""$subject","$matter","From: $email");

?>


thanks...i am thinking that the actionscript on the submit button might have something to do with it, too...not sure. will post next

Reply With Quote
  #19  
Old March 3rd, 2003, 07:57 AM
danke danke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Huntington, VT
Posts: 10 danke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re: Justin...

actionscript on the submit button in my flash file...
on (release) {
tellTarget ("feedform") {
len = length(email);
counter = 1;
flag = 0;
dot = 0;
while (Number(counter)<=Number(len)) {
Char = substring(email, counter, 1);
if (Char ne "@") {
flag = Number(flag)+1;
} else {
dot = 1;
}
if (Number(dot) == 1) {
if (Char eq ".") {
dotflag = 1;
}
}
counter = Number(counter)+1;
}
if (Number(flag) == Number(len-1) and Number(dotflag) == 1) {
message = "";
tellTarget ("feedform") {
loadVariablesNum(_root.index.des_feedback+"?name="+name+"&email="+email+"&feedback="+suggestion, 0);
}
tellTarget ("thankyou") {
gotoAndStop(2);
}
} else {
message = "incorrect email address";
}
}
}

Reply With Quote
  #20  
Old March 3rd, 2003, 08:43 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Re: Justin...

Ok.. Since I don't know much about actionscript I'm going to go on the assumption that the field names are going to be "feedback" "name" and "email" and that when you hit submit it takes the values in the form fields and passes them to the function "feedform" right?

However I don't see the function feedform anywhere listed below.. am I missing something?

Reply With Quote
  #21  
Old March 5th, 2003, 04:38 PM
danke danke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Huntington, VT
Posts: 10 danke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
getting closer!

ok, i uploaded the swf and the php file to my ISP and the form worked perfectly...
so when it tries to do it from my home web server (os x) it comes back with an error message that says:
Quote:
connection refused by localhost
the localhost in this case, is my computer...my system's smtp.php file has been edited to send it to smtp.myISP.com
anybody that help me figure this out is a GOD!
i was wondering about permissions? i have the latest version of php4 installed. did i need to install PEAR and do it this way, too? i couldn't seem to get it installed, said, "no such command"...?

thanks a lot!
Billy

Reply With Quote
  #22  
Old March 7th, 2003, 04:46 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Re: getting closer!

Quote:
Originally posted by danke
ok, i uploaded the swf and the php file to my ISP and the form worked perfectly...
so when it tries to do it from my home web server (os x) it comes back with an error message that says: the localhost in this case, is my computer...my system's smtp.php file has been edited to send it to smtp.myISP.com
anybody that help me figure this out is a GOD!
i was wondering about permissions? i have the latest version of php4 installed. did i need to install PEAR and do it this way, too? i couldn't seem to get it installed, said, "no such command"...?

thanks a lot!
Billy



Are you going through a firewall?

Like, do you have a router? That could cause it if you're going to your url.. but if you're doing it as http://whateveryourinternalservernameis/ ie http://webputer/ then I'm not too sure..

Reply With Quote
  #23  
Old March 7th, 2003, 11:45 PM
skatablaze skatablaze is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: cincinnati
Posts: 8 skatablaze User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to skatablaze
heres the code for my sendmail.php

i can't seem to get it too send the email but it takes me too the thankyou page when you submit so i don't know whats wrong? PLease help...

------------------------[sendmail.php]-----------------------------

<?php ob_start();
$mailto = "shorty40@fuse.net";
$email = "Forumfeedback@fuse.net"; //This is just for example
$subject = "Feedback Form Results";
$mailheaders = "From: $email";
$message = "This is where your message would go.";

//Now send the email using the above variables

mail($mailto, $subject, $message, $mailheaders);
header("Location: http://skata.kicks-ass.net/feedback/thankyou.php");
ob_flush();?>

----------------------[END sendmail.php]-------------------------

thanks for your time

Reply With Quote
  #24  
Old March 8th, 2003, 05:37 AM
danke danke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Huntington, VT
Posts: 10 danke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re: skatablaze

look, it seems as if our posts got overlapped...and that possibly you are having the same problem as me...i put the mailto.php file and the .swf movie that calls it on my ISP's server and it worked perfectly...have you tried that? it might not be with your code! my computer needs to be set to sendmail...what i am trying to do, to no avail, is to have it set up so instead of my server being the smtp, it is configured for my ISP's smtp, which i just realized completely won't work...there's issues with permissions, and config files that need to be edited in order for the mailto file to physically be sent...and i am here...still digging through posts i found while searching on google.com, etc...

another thing i was looking for, seeing as the form i have is under a Virtual Host domain, is to enable PHP to run under Virtual Directory Support...as the website the form is at is in that directory, which after looking at my "test.php" file, says it is NOT enabled!

i am drowning in a sea of newbie-ism...but if i find any answers, you'll be the first to know!!

Reply With Quote
  #25  
Old April 14th, 2003, 12:22 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via AIM to dfano Send a message via Yahoo to dfano
i'm new @ php and programing in general

I have read most of the posts and used what i could. my problem is that when i get the e-mail it has no content, the subject is there and thats it. here is the code im using:

---feedback.html---

<HTML>
<HEAD>
<TITLE>HTML Form</TITLE>
</HEAD>
<BODY>
<FORM method=post action="sendmail.php">
Email: <INPUT name="email" type="text"><br>
Message:<br>
<TEXTAREA name="message">
</textarea><br>
<input type=submit>
</FORM>
</BODY>
</HTML>

---sendmail.php---

<?php ob_start();
$mailto = "info@fs3d.com";
$subject = "Feedback Form Results";
$mailheaders = "From: $email";

//Now send the email using the above variables

mail($mailto, $subject, $email, $message, $mailheaders);
header("Location: http://www.fs3d.com");
ob_flush();?>

Thanks in advance,

Dave

Reply With Quote
  #26  
Old April 14th, 2003, 04:51 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Re: i'm new @ php and programing in general

Quote:
Originally posted by dfano
I have read most of the posts and used what i could. my problem is that when i get the e-mail it has no content, the subject is there and thats it. here is the code im using:

---feedback.html---

<HTML>
<HEAD>
<TITLE>HTML Form</TITLE>
</HEAD>
<BODY>
<FORM method=post action="sendmail.php">
Email: <INPUT name="email" type="text"><br>
Message:<br>
<TEXTAREA name="message">
</textarea><br>
<input type=submit>
</FORM>
</BODY>
</HTML>

---sendmail.php---

<?php ob_start();
$mailto = "info@fs3d.com";
$subject = "Feedback Form Results";
$mailheaders = "From: $email";

//Now send the email using the above variables

mail($mailto, $subject, $email, $message, $mailheaders);
header("Location: http://www.fs3d.com");
ob_flush();?>

Thanks in advance,

Dave


change sendmail.php to read
PHP Code:
<?php ob_start();
$mailto "info@fs3d.com";
$subject "Feedback Form Results";
$mailheaders "From: $email";
$email $_POST['email'];
$message $_POST['message'];
//Now send the email using the above variables

mail($mailto$subject$email$message$mailheaders);
header("Location: [url]http://www.fs3d.com[/url]");
ob_flush();?>
and see if that works

Reply With Quote
  #27  
Old April 14th, 2003, 08:23 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via AIM to dfano Send a message via Yahoo to dfano
im getting an error

"Parse error: parse error in /home/httpd/html/sendmail.php on line 10"

i have no idea what that means. I think that is where it sends me to the thankyou page/ confirmation.

Thank you very much for the quick response.

ill keep toying with it.

Dave

2) i got rid of the header part and it sends the e-mail but is is still empty.

thanks again

Last edited by dfano : April 14th, 2003 at 08:30 PM.

Reply With Quote
  #28  
Old April 14th, 2003, 10:41 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
change
PHP Code:
 header("Location: <a href="http://www.fs3d.com" target="_blank">[url]http://www.fs3d.com[/url]</a>"); 
to
PHP Code:
 header('Location: http://www.fs3d.com'); 

you don't need the a href stuff.. it'll automatically forward it back

and also.. try this:
PHP Code:
<?php ob_start();
$mailto "info@fs3d.com";
$subject "Feedback Form Results";
$mailheaders "From: $email";
$email $_POST['email'];
$message $_POST['message'];
echo 
"Email = $email<br> Message = $message";
//Now send the email using the above variables

mail($mailto$subject$email$message$mailheaders);
//header('Location: http://www.fs3d.com');
ob_flush();?>
to debug the values of $email and $message and see if they are being passed through correctly..

Last edited by nicat23 : April 14th, 2003 at 10:45 PM.

Reply With Quote
  #29  
Old April 14th, 2003, 11:12 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via AIM to dfano Send a message via Yahoo to dfano
Unhappy Bad PHP instalation?

I think the PHP that is being run by my hosting service must not be working well. i continue to receive the e-mail but it is empty.
i did an exercise from a book and that did not work well either.

Thanks for the effort.

Dave

Reply With Quote
  #30  
Old April 16th, 2003, 10:53 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via AIM to dfano Send a message via Yahoo to dfano
It was the server

they are fixing it.

thanks for the help

Dave

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: A Simple Feedback Form With PHP


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap