Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 08-18-2007, 06:49 AM   #1 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
How To - Create A Contact Form The Sends To My Email Address...

Hi,

How do i create a form with a pull down menu and a text box and area that will send to my email when they click submit?

Thanks,

Jay
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 08-18-2007, 04:53 PM   #2 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

What do you mean by "pull down menu" though?
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-18-2007, 10:09 PM   #3 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

with options on the subject like this one http://www.techsupportforum.com/sendmessage.php

but for the subject i would like it as a pull down menu.
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-18-2007, 11:44 PM   #4 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

Wrote/tested it real quick - hopefully it's all okay. It emailed fine, at least.

email.php
PHP Code:
<?php
if(isset($message)){

// ALWAYS clean the POST variables of any HTML tags first.
// And here we do it in one easy step.
$_POST array_map('strip_tags'$_POST);

// get the posted variables
$name $_POST['name'];
$email $_POST['email'];
$subject $_POST['subject'];
$message $_POST['message'];

// to recipients - THIS IS YOU!
$to 'example@emailaddress.com';

// To send html mail, the Content-type header must be set
$headers 'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

// Additional headers
$headers .= 'To: Your name <' $to '>' "\r\n";
$headers .= 'From: ' $name '<' $from '>' "\r\n";
$headers .= 'Cc:' "\r\n";
$headers .= 'Bcc:' "\r\n";

// Mail it
mail($to$subject$message$headers);

// tell them that it's okay
echo "<center><b>The email has been sent successfully</b></center>";
}else{
?> 
<form id="feedbackform" name="feedbackform" method="post" action="email.php">
  <label> Your Name<br /> 
  <input name="name" type="text" id="name" maxlength="30" />
  <br />
  <br />
  Your Email <br />
  <input name="from" type="text" id="from" maxlength="30" />
  <br />
  <br />
  Subject<br />
  <select name="subject" id="subject">
    <option value="Site Feedback" selected="selected">Site Feedback</option>
    <option value="Registration Problems">Registration Problems</option>
    <option value="Advertisement Inquiry">Advertisement Inquiry</option>
    <option value="Computer Help">Computer Help</option>
    <option value="Writers Account">Writers Account</option>
    <option value="Other">Other (explain) </option>
  </select>
  </label>
  <p>Message<br />
    <label>
      <textarea name="message" cols="50" rows="5" id="message"></textarea>
    </label>
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="Submit" />
    </label>
  </p>
</form>
<? ;} ?>
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-19-2007, 02:34 AM   #5 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

What do i save it as??

HTML Page,
Web Pages,
Dynamic Website Template,
ASP Files,
ASPX Files,
Js Script,
VB Script,
CSS or
XML

??
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-19-2007, 06:19 PM   #6 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

Quote:
Originally Posted by Redcore View Post
email.php
^^^

Plus the code was wrapped in PHP tags...
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-20-2007, 12:19 AM   #7 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

I had no option to save it as php, or have i got to do it in dreamweaver?
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-20-2007, 01:40 PM   #8 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

What program are you using? If it doesn't support PHP...that's not a good thing :S Dreamweaver is nice, but there are alternatives out there. Perhaps I will compile a decent list of programs sometime and post them.

You can always copy it into Notepad and save as "email.php"
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-20-2007, 03:25 PM   #9 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

I was using MS Frontpage, but ill install dreamweaver but iv got to wait till my motherboard comes.
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-20-2007, 04:33 PM   #10 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

How is dreamweaver dependent upon the new mobo? Or do you just not want to deal with a new software until you finish your computer (understandably lol :P)
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 12:13 AM   #11 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

Oh no sorry, my computer is messed up and im waiting for my new mobo, so i can use it. ATM im using another computer.
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 02:57 AM   #12 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: How To - Create A Contact Form The Sends To My Email Address...

@ Jaymie1989: Notepad should be working... Just copy and paste the all the code into notepad and save it as a txt-file and then change the extension to .php
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 05:10 AM   #13 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

ok, and i got lost, I saved it as contact (text file) then changed the extension to.php and uploaded it so it was contact.php when i uploaded it, (The link is Http://www.dj-ultra.co.uk/contact.php) When i tested it, the page changes to Http://,www.dj-ultra.co.uk/email.php and its got the problem of website not found, HELP.


also i put my email address here

Quote:
to recipients - THIS IS YOU!
$to = 'example@emailaddress.com';
which is Admin@dj-ultra.co.uk and i havnt recived the emial

I have changed the page to email.php BTW

Last edited by Jaymie1989; 08-21-2007 at 05:16 AM.
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 01:29 PM   #14 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

I sent an email through 'email.php' and it did not say "Sent Successfully"

Did you change the code at all (BESIDES the $to variable)? As in, did you change the name of the message box? If you changed ANYTHING ... go ahead and post the entire page code here.
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 01:45 PM   #15 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

I took 3 of the subjects out and put in my email address

Quote:
<?php
if(isset($message)){

// ALWAYS clean the POST variables of any HTML tags first.
// And here we do it in one easy step.
$_POST = array_map('strip_tags', $_POST);

// get the posted variables
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];

// to recipients - THIS IS YOU!
$to = 'admin@dj-ultra.co.uk';

// To send html mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Your name <' . $to . '>' . "\r\n";
$headers .= 'From: ' . $name . '<' . $from . '>' . "\r\n";
$headers .= 'Cc:' . "\r\n";
$headers .= 'Bcc:' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);

// tell them that it's okay
echo "<center><b>The email has been sent successfully</b></center>";
}else{
?>
<form id="feedbackform" name="feedbackform" method="post" action="email.php">
<label> Your Name<br />
<input name="name" type="text" id="name" maxlength="30" />
<br />
<br />
Your Email <br />
<input name="from" type="text" id="from" maxlength="30" />
<br />
<br />
Subject<br />
<select name="subject" id="subject">
<option value="Site Feedback" selected="selected">Site Feedback</option>
<option value="Forum Registration Problems">Registration Problems</option>
<option value="Other">Other (explain) </option>
</select>
</label>
<p>Message<br />
<label>
<textarea name="message" cols="50" rows="5" id="message"></textarea>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
<? ;} ?>
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 05:59 PM   #16 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

Rather than quote, use the PHP tags.

Well it works on MY server...after testing with my email, I tested with yours...so you SHOULD be getting an email from my Gmail.

I've added a tag to give us the error...so let's see if that shows up.

email.php
PHP Code:
<?php
if(isset($message)){

// ALWAYS clean the POST variables of any HTML tags first.
// And here we do it in one easy step.
$_POST array_map('strip_tags'$_POST);

// get the posted variables
$name $_POST['name'];
$email $_POST['email'];
$subject $_POST['subject'];
$message $_POST['message'];

// to recipients - THIS IS YOU!
$to 'admin@dj-ultra.co.uk';

// To send html mail, the Content-type header must be set
$headers 'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

// Additional headers
$headers .= 'From: ' $name '<' $from '>' "\r\n";
$headers .= 'Cc:' "\r\n";
$headers .= 'Bcc:' "\r\n";

// Mail it
mail($to$subject$message$headers) or die(mysql_error());

// tell them that it's okay
echo "<center><b>The email has been sent successfully</b></center>";
}else{
?>
<form id="feedbackform" name="feedbackform" method="post" action="email.php">
<label> Your Name<br />
<input name="name" type="text" id="name" maxlength="30" />
<br />
<br />
Your Email <br />
<input name="from" type="text" id="from" maxlength="30" />
<br />
<br />
Subject<br />
<select name="subject" id="subject">
<option value="Site Feedback" selected="selected">Site Feedback</option>
<option value="Forum Registration Problems">Registration Problems</option>
<option value="Other">Other (explain) </option>
</select>
</label>
<p>Message<br />
<label>
<textarea name="message" cols="50" rows="5" id="message"></textarea>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
<? ;} ?>
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 06:08 PM   #17 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

Hey, i got your email just waiting to see if mine comes through
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2007, 06:20 PM   #18 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

So the code is fine, then.

If you don't get the email from your server...then that's the problem. Do you have SMTP on it?
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-28-2007, 10:30 AM   #19 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Re: How To - Create A Contact Form The Sends To My Email Address...

I have no idea about SMTP
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-28-2007, 02:40 PM   #20 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 713
OS: Linux Mint 7

My System

Re: How To - Create A Contact Form The Sends To My Email Address...

Who do you host with?
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 02:34 PM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85