Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » Going crazy over Contact form creation! Please Help!

Going crazy over Contact form creation! Please Help!

Reply
  #1 (permalink)  
Old 06-06-09, 06:19 PM
roig12 roig12 is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Going crazy over Contact form creation! Please Help!

I don't know much about coding, i usually use a program to build my web pages.
I tried some Form Generators/Creators to build a simple form with fields that i set up,
and none of them worked like they should.
I don't want my website to be linked to another server where my Form is located on.
I want to be able to design it like the rest of my website, and not on a different page, and to be able to send the form to a few different email addresses in one click and set up the fields myself.
Is that too complicated?
Is there a way for someone who isn't so good with coding can do this?
I need it for 3 of my websites, and im going crazy over this!
Thanks alot for all the helpers.
Roi.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-07-09, 04:47 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 499
Thanks: 0
Thanked 0 Times in 0 Posts
What you want to do is possible, but perhaps if the previous forms you tried don't work, then either you've set them up wrong, or you try getting support from the sites that offers them.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-10-09, 04:27 PM
xEX3CUT1ONx xEX3CUT1ONx is offline
Newbie Coder
 
Join Date: Jun 2008
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Well from what I could gather from your question is you want a simple form well the most simple I can show it to you is a contact form the easiest way to do this would be in PHP so thats what I did for you, however this small script doesn't have any validation in so they could send blank emails but this is just something i threw together in a minute or two

PHP Code:
<form action="contact.php" method="post">
Name: <input type="text" name="name"  />
<br />
E-Mail: <input type="text" name="email" />
<br />
Subject: <input type="text" name="subject" />
<br />
Message: <textarea name="message" rows="4" cols="25"></textarea>
<br />
<input type="submit" value="Send!" />
</form>

<?php

//First get the information that the user entered and create smaller named variables

$name $_POST['name'];
$email $_POST['email'];
$subject $_POST['subject'];
$message $_POST['message'];

// Your Email address

$your_email "bob@smith.com";

mail($your_email,$subject,$message,"From: $email");


?>
PM if you need any assistance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-13-09, 05:07 PM
roig12 roig12 is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks man, but it doesnt work.
It doesn't send the email.
Do you know how can i add a redirect link?
Is it possible to send the form to a few different email addresses at the same time?
and one last thing, is it possible to make the email address in the code invisible somehow (in case the user wants to see the source).
Thanks man, you are helping alot!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 06-13-09, 10:35 PM
Jcbones Jcbones is offline
Coding Addict
 
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 280
Thanks: 3
Thanked 5 Times in 5 Posts
You need to name your contact page with a .php extenstion, not a .html

the PHP code will not be visible to the browser at all. It will just send the mail, if a sendMail server is set up(it should be).

I'll expand it a bit for you.

file name: contact.php
PHP Code:
<form action="contact.php" method="post">
Name: <input type="text" name="name"  />
<br />
E-Mail: <input type="text" name="email" />
<br />
Subject: <input type="text" name="subject" />
<br />
Message: <textarea name="message" rows="4" cols="25"></textarea>
<br />
<input type="submit" value="Send!" />
</form>

<?php

//First get the information that the user entered and create smaller named variables
if($_POST['name'] == NULL || $_POST['email'] == NULL || $_POST['subject'] == NULL || $_POST['message'] == NULL) echo 'You must fill in ALL fields before submitting your request!';
else {
$name = ($_POST['name'] != NULL) ? strip_tags($_POST['name']) : 'No Name';
$email = ($_POST['email'] != NULL) ? strip_tags($_POST['email']) : 'No Email Address';
$subject = ($_POST['subject'] != NULL) ? strip_tags($_POST['subject']) : 'Contact Form';
$message = ($_POST['message'] != NULL) ? strip_tags(nl2br($_POST['message'])) : 'No message';

// Your Email address
$message wordwrap($message70);
$your_email "bob@smith.com";

if(
mail($your_email,$subject,$message,"From: $email")) echo 'Thanks for contacting us, we will reply shortly';
else echo 
'An error occurred, and your contact info. could not be processed!';
}

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 06-14-09, 10:40 AM
roig12 roig12 is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
I did all you said except for the sendmail server.
How do i set this thing?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 06-14-09, 03:13 PM
Jcbones Jcbones is offline
Coding Addict
 
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 280
Thanks: 3
Thanked 5 Times in 5 Posts
The sendmail server should be set up by your hosting company. The script should work as stated if you make sure that the page is named with a .php instead of a .html . If the mail server is not set up, the page will tell you as soon as you try to run the mail() function. FATAL ERROR: will be displayed on the screen.


IF you need the sendmail server, Your hosting company will have to set it up for you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 06-15-09, 03:22 AM
xEX3CUT1ONx xEX3CUT1ONx is offline
Newbie Coder
 
Join Date: Jun 2008
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks JCBones for expanding on my script I've not been able to check the site for a few days, but roig like JC said you need to have the pages as PHP not HTML, if the server isn't set up you will get an error when you try use the form.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ajax checking and onsubmit issue follower JavaScript 4 10-12-08 04:45 PM
Problem with FormMail script for simple contact form amang Perl 2 09-21-07 08:59 PM
Tute: Create Email based Contact Form Grabber PHP 3 05-31-06 04:11 AM
Contact Form w/ Database Fuyuki Script Requests 0 01-13-06 11:50 AM


All times are GMT -5. The time now is 07:28 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.