form to mail problem

Reply

Join Date: Mar 2009
Posts: 3
Reputation: boliu is an unknown quantity at this point 
Solved Threads: 0
boliu boliu is offline Offline
Newbie Poster

form to mail problem

 
0
  #1
Mar 25th, 2009
Hi! here is my problem . I'm a psychology student and i'm trying to do a survey on my friends from my YM list . I want to send them forms in their inbox and they will answer back .

My form looks like this :
  1. <form method="post" action="http://mysite.com/feedback.php">
  2. Question1 <input name="question1" type="text" /><br />
  3. Question2 <input name="question2" type="text" /><br />
  4. <input type="submit" />
  5. </form>

My feedback.php looks like this :
  1. <?php
  2. $Question1 = $_REQUEST['Question1'] ;
  3. $Question2 = $_REQUEST['Question2'] ;
  4.  
  5. mail( "mymail@gmail.com", "Feedback Form Results",
  6. $Question1, $Question2 );
  7. header( "Location: http://www.mysite.com/thankyou.html" );
  8. ?>

Bassically , i'm trying to write a simple code , just something to help me in my study . The purpose of the study is to send this form by email , not post it on a web page (and i want to learn some html). So far , i've managed to make it work , by testing it in a browser .But when i try to test it in an email client , the result from my .php comes back empty . I have observed that , the mail client changes my html code , and removes the " " , and the code of my form looks like this after being introduced in a mail client :

<FORM action=http://mysite.com/feedback.php method=post>Question1 <INPUT name=question1><BR>Question <INPUT name=question2><BR><INPUT type=submit value="Submit Query"> </FORM>

How can i stop the mail client from changing my code . Or how can i improve my code to make this work .
Last edited by peter_budo; Mar 29th, 2009 at 6:28 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 1
Reputation: mjoyce71 is an unknown quantity at this point 
Solved Threads: 0
mjoyce71 mjoyce71 is offline Offline
Newbie Poster

Re: form to mail problem

 
0
  #2
Mar 26th, 2009
I see what you're trying to do but sending a form in the email is going to cause you a lot of problems. I would just link to a already built web form.

For the Form to Email part - I'd suggest using http://www.formmailhosting.com. they have an option where you can have them host the form for you. The you just have to email out the link.

The results will be emailed to you and stored in a MS Excel file.

Hope this helps.

MARK
Founder:
Internet Uptime Monitor - Free WebSite Uptime Monitoring
http://www.internetuptimemonitor.com
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: form to mail problem

 
0
  #3
Mar 29th, 2009
Many email clients, and some email services, block html.

Never expect a recipient to get email in web page form.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC