hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Design and Content : Submit Form Problem
Reply

Web Design and Content Subjects include, HTML, graphics, editors, CSS, Flash, graphics creation, placing of ads, ad serv companies, copyright, content and nearly anything else design related. Also talk about businesses that provide design services. If you link to your site, you must post in Web Site Reviews.
Forum Jump

Submit Form Problem

Reply Post New Thread In Web Design and Content Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 12-12-2006, 12:44 PM
acidfire acidfire is offline
Newbie
 
Join Date: Feb 2006
Posts: 9

Submit Form Problem


I'm trying to get a form to send me a users name and email for my newsletter. The problem I'm having is when I click the submit button it opens up my mail client instead of sending the info to my email. Can some one tell me what I'm doing wrong?
Code:
<form action="mailto:newsletter@my site.com?subject=Join Newsletter " method="post" enctype="text/plain">
<table><tr><td>
Name: <INPUT NAME="Name" TYPE="text" VALUE="Name" SIZE=20><BR>
Email: <INPUT NAME="Email" TYPE="text" VALUE="Email" SIZE=20><BR>

</td></tr>
<tr><td align=center>
<INPUT TYPE="submit" value="Submit" style="color: #ffffff; background-color: #000000">
</td></tr></table>
</FORM>
Thanks for any help you can give.

__________________
My Sites: Fireson | Jadice426

Reply With Quote


Sponsored Links
  #2  
Old 12-12-2006, 01:38 PM
Odd Fact Odd Fact is offline
Retired Moderator
 
Join Date: Jun 2002
Location: Texas
Posts: 7,954
You ar going to need to use some form of form processor script. Take a look at hotscripts.

http://hotscripts.com/PHP/Scripts_an...ors/index.html

Reply With Quote
  #3  
Old 12-12-2006, 02:33 PM
JediKnight2 JediKnight2 is offline
WHT Addict
 
Join Date: Sep 2005
Posts: 141
Yup...your form is doing exactly what you have told it to do...send it to the mailto address

Reply With Quote
Sponsored Links
  #4  
Old 12-13-2006, 05:35 PM
David David is online now
& Goliath
 
Join Date: Oct 2003
Location: San Diego
Posts: 8,805
Jason,

Another option is to use the 'formmail' system available via your control panel.
If you require any assistance with it I'll be hiding on IRC!

__________________
David McKendrick
Fused - Quality web hosting
Follow me on twitter
Blessed is the man who walks not in the counsel of the wicked.

Reply With Quote
  #5  
Old 12-16-2006, 11:37 AM
Navid1 Navid1 is offline
Aspiring Evangelist
 
Join Date: Sep 2006
Location: England, London
Posts: 417
can you use asp ??

__________________
Giving up does not always means you are weak, it Simply means you are strong to let go!

Reply With Quote
  #6  
Old 12-18-2006, 07:51 AM
L3-Carl L3-Carl is offline
Junior Guru Wannabe
 
Join Date: Jun 2006
Location: Cheshire, UK
Posts: 67
Insert this code providing you can run PHP, at the top of your PHP page in PHP tags. You will need to run your own validation, this is a very simple contact form and works well

PHP Code:

// Contact US Form PHP Code
// Carl Pickering - Line3 Internet Ltd

// Stops page from sending form when loaded
if($_POST['action']=='send') {

// define some variables first
$send_to "uremail@domain.tld";
$subject "Subject";

// Pop-Up Txt
$thank_you ="Thank you for enquiry, we will contact you back soon";

$c_person $_POST['c_name'];
$c_email $_POST['c_email'];
$c_phone $_POST['c_phone'];
$c_message $_POST['c_message'];

// Build the message
$message "The following person has sent information from the website\n\n";
$message .= "Name: $c_person\n";
$message .= "Telephone: $c_phone\n";
$message .= "Email: $c_email\n";
$message .= "Message: $c_message \n";
$mailheaders "From: $c_person <$c_email> \n";
$mailheaders .= "Reply-To: $c_person <$c_email>\n\n";

// Simple but basic.. Now send the email
mail($send_to$subject$message$mailheaders);

print(
" <script language=\"Javascript\"> alert('$thank_you'); </script> ");

Form Code:

HTML Code:
<form action="contact.php" method="post" enctype="multipart/form-data" name="contact_us" id="form">
  <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
        <td height="23" style="padding:2px 0px 0px 0px;" align="right" width="100%">Your Name:</td>
        <td><input name="c_name" type="text" class="input_2" id="c_name"></td>
    </tr>
    <tr>
        <td height="23" style="padding:2px 0px 0px 0px;" align="right" width="100%">Your Phone:</td>
        <td><input name="c_phone" type="text" class="input_2" id="c_phone"></td>
    </tr>
    <tr>
      <td height="23" style="padding:2px 0px 0px 0px;" align="right">Your email: </td>
      <td><input name="c_email" type="text" class="input_2" id="c_email"></td>
      </tr>
    <tr>
        <td height="23" style="padding:2px 0px 0px 0px;" align="right" width="100%">Message:</td>
        <td><textarea name="c_message" cols="3" rows="3" id="c_message"></textarea></td>
    </tr>
    <tr>
        <td width="100%"><img src="images/spacer.gif" width="1" height="1" alt=""><input name="action" type="hidden" id="action" value="send"></td>
        <td align="right" style="padding:5px 0px 0px 0px;"><img src="images/read_1.gif" alt="" style="margin:0px 5px 0px 0px;"><a href="javascript:document.contact_us.reset();">Reset</a><img src="images/read_1.gif" alt="" style="margin:0px 5px 0px 30px;"><a href="javascript:document.contact_us.submit();">Submit</a></td>
    </tr>
</table>
</form>            
Notice the hidden form element, the form will only be posted, if that variable is sent.

You may wanna use strip_tags on your code too, before posting, stops people injecting nasty code.... I do

HTH - Like i said, its dead basic, but gets you going

__________________
Carl Pickering, Line3 Internet
http://www.line3.co.uk
UK VPS Provider; 99.98% uptime


Reply With Quote
  #7  
Old 01-05-2007, 12:15 PM
acidfire acidfire is offline
Newbie
 
Join Date: Feb 2006
Posts: 9
Thanks for the reply's. Sorry for the late reply but I was busy with the holidays. Thanks for the info David and I will look into that. And thanks for the code cpickering.

__________________
My Sites: Fireson | Jadice426

Reply With Quote
  #8  
Old 01-05-2007, 03:24 PM
VVIP VVIP is offline
Disabled
 
Join Date: Dec 2006
Posts: 20
It looks a great code.

Is it possible to integrate validation code in the form?

I'm looking for that long time.


Thank you,

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
New at the WHIR: Submit a Guest Blog Post to our Industry Perspectives Column Blog 2013-05-02 14:38:57
Lead Generation Part 1 – Form Fills Blog 2012-11-16 09:03:48
Go Daddy College Scholarship Program Nears Application Deadline Web Hosting News 2012-03-15 14:38:10
eleven Survey Lists Spam as Greatest Email Security Threat in Ten Years Web Hosting News 2011-12-02 21:50:09
Open Source Developer Joomla Releases 1.7 CMS with Enhanced Security Tools Web Hosting News 2011-07-19 18:51:20


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?