Old 01-19-2006   #1 (permalink)
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
Getting simple CSS contact for to work..

CONTACT FORM - LOL sorry forgot the M in the subject..

HTML Code:
<form action="default.asp" method="post">
<fieldset class="fieldset">
<legend>Contact Form</legend>
<label for="name">Name:</label><br class="nobr" />
<input name="name" type="text" class="textfield"  id="name"  />
<br />
<label for="email">Email:</label><br class="nobr" />
<input name="email" type="text" class="textfield" id="email" />
<br/>
<label for="website">Phone:</label><br class="nobr" />
<input name="website" type="text" class="textfield" id="website" />
<br />
<label for="comment">Comment:</label><br class="nobr" />
<textarea cols="30" rows="15" name="comment" id="comment" class="textarea"></textarea>
<br />
<label for="submit">&nbsp;</label><br class="nobr" />
<input name="submit" type="submit" class="submit" id="submit" value="submit" />
</fieldset>
</form>
I need to have it be able to be submitted and emailed to me, how can I do this. I tried several ways but nothing seems to work.. I know its simple but ahh.. I been working on my clients site for awhile.. Im quite proud but now.. i feel stupid! can someone help me! I need this done by sunday.. well max deadline for the site is monday because I leave for my trip on tuesday.. anyone please!
__________________
google is my lover, whos yours?
ecntrc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-19-2006   #2 (permalink)
Yup, that's meee!
 
thecubed's Avatar
 
Join Date: Jun 2004
Location: Infront of my screen (most of the time)
Posts: 89

Send a message via AIM to thecubed Send a message via Yahoo to thecubed Send a message via Skype™ to thecubed
Ok, I assume that you want to have all the contents of that form emailed to your email address... there are plenty of ASP form-mail scripts out there, and credits goes to tele-pro.co.uk for this script.

In your code that you posted, change the default.asp to mail.asp and save this code as mail.asp
Code:
<%
' Website Contact Form Generator 
' http://www.tele-pro.co.uk/scripts/contact_form/ 
' This script is free to use as long as you  
' retain the credit link  

' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Tel
Dim Comment

' get posted data into variables
EmailFrom = Trim(Request.Form("email")) 
EmailTo = "--INSERT YOUR PRIVATE EMAIL ADDRESS HERE--"
Subject = "yoursubject"
Name = Trim(Request.Form("name")) 
Tel = Trim(Request.Form("tel")) 
Comment = Trim(Request.Form("comment")) 

' validation
Dim validationOK
validationOK=true
If (Trim(EmailFrom)="") Then validationOK=false
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

' prepare email body text
Dim Body
Body = Body & "Email From: " & EmailFrom & VbCrLf
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Telephone: " & Tel & VbCrLf
Body = Body & "Comment: " & Comment & VbCrLf

' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send 

' redirect to success page 
Response.Redirect("ok.htm?" & EmailFrom)
%>
then change the line with the insert your email address here to where you would like the email sent to when you click the form send button.
that should do it
__________________

www.thecubed.com <--- TheCubed Homepage!
thecubed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-19-2006   #3 (permalink)
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
Well, I did that, but when I pressed submit it took me to the code page. showed the asp code. heres my code.. id ont know what im doing wrong..

heres the form code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
font-family:Arial, Tahoma, sans-serif;
font-size:0.6em;
margin:35px;
color:#000000;}
label {
margin: 0;
margin-top:0.3em;
text-align:right;
width:70px;
float:left;
text-transform:uppercase;
  }
fieldset {
  background-color:#ffffff;
  border:solid 1 #000; /* Opera doesn't get border:none or border:0 on fieldsets */
  width:300px;
  }
legend {
width:100px;
height:0px;
color:#000000;
font-size:2.5em;
padding-left:0em;
position:inherit;
top:-1.5em;
text-transform:uppercase;
font-weight:bold;
letter-spacing:-1px;
}

.br {display:none;}  
  
.textfield {
font:1.1em  Verdana, Arial, Helvetica, sans-serif ;
color:#000000;
margin:3px;
height:18px;
border:solid 1 #000000;
padding: 0px 0px;
width:200px;

width:187px;
}
fieldset>input.textfield {
}
textarea {
font:1.1em Verdana, Arial, Helvetica, sans-serif;
color:#000000 ;
margin:3px;
height:165px;
border:solid 1 #000000;
padding: 0 8px;
width:200px;
width:190px;
}
fieldset>textarea {
}
.submit {
margin:3px;
height:18px;
border:solid 1 #000000;
width:80px;
font:1.1em Verdana, Arial, Helvetica, sans-serif;
color:#000000 ;
text-transform:uppercase;
 }
</style>
</head>

<body>
<form action="mail.asp" method="post">
<fieldset class="fieldset">
<legend>Contact Form</legend>
<label for="name">Name:</label><br class="nobr" />
<input name="name" type="text" class="textfield"  id="name"  />
<br />
<label for="email">Email:</label><br class="nobr" />
<input name="email" type="text" class="textfield" id="email" />
<br/>
<label for="phone">Phone:</label><br class="nobr" />
<input name="website" type="text" class="textfield" id="website" />
<br />
<label for="comment">Comment:</label><br class="nobr" />
<textarea cols="30" rows="15" name="comment" id="comment" class="textarea"></textarea>
<br />
<label for="submit">&nbsp;</label><br class="nobr" />
<input name="submit" type="submit" class="submit" id="submit" value="submit" />
</fieldset>
</form>

</body>
</html>
heres the asp code

Code:
<%
' Website Contact Form Generator 
' http://www.tele-pro.co.uk/scripts/contact_form/ 
' This script is free to use as long as you  
' retain the credit link  

' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Tel
Dim Comment

' get posted data into variables
EmailFrom = Trim(Request.Form("email")) 
EmailTo = "mst0ke@yahoo.com"
Subject = "yoursubject"
Name = Trim(Request.Form("name")) 
Tel = Trim(Request.Form("tel")) 
Comment = Trim(Request.Form("comment")) 

' validation
Dim validationOK
validationOK=true
If (Trim(EmailFrom)="") Then validationOK=false
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

' prepare email body text
Dim Body
Body = Body & "Email From: " & EmailFrom & VbCrLf
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Telephone: " & Tel & VbCrLf
Body = Body & "Comment: " & Comment & VbCrLf

' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send 

' redirect to success page 
Response.Redirect("ok.htm?" & EmailFrom)
%>
__________________
google is my lover, whos yours?
ecntrc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-19-2006   #4 (permalink)
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
well cancel that my clients server dosent support asp, ****ty well.. i want to change it to PHP but i gotta find a PHP script for that..
__________________
google is my lover, whos yours?
ecntrc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-19-2006   #5 (permalink)
Yup, that's meee!
 
thecubed's Avatar
 
Join Date: Jun 2004
Location: Infront of my screen (most of the time)
Posts: 89

Send a message via AIM to thecubed Send a message via Yahoo to thecubed Send a message via Skype™ to thecubed
Check out http://www.tele-pro.co.uk/scripts/contact_form/
that's where I got the ASP code, and they have a PHP version, too!
just add in your fields, and it will do the rest.

try this PHP code:
Code:
<?php
// Website Contact Form Generator 
// http://www.tele-pro.co.uk/scripts/contact_form/ 
// This script is free to use as long as you  
// retain the credit link  

// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); 
$EmailTo = "***_insert your email address here_***";
$Subject = Trim(stripslashes($_POST['Subject'])); 
$Name = Trim(stripslashes($_POST['Name'])); 
$Address = Trim(stripslashes($_POST['Address'])); 
$Telephone = Trim(stripslashes($_POST['Telephone'])); 
$Comment = Trim(stripslashes($_POST['Comment'])); 

// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Telephone: ";
$Body .= $Telephone;
$Body .= "\n";
$Body .= "Comment: ";
$Body .= $Comment;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
__________________

www.thecubed.com <--- TheCubed Homepage!
thecubed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-19-2006   #6 (permalink)
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
http://biorust.com/tutorials/detail/107/en/
__________________
BioRUST Tutorials - the birthplace
scrowler is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-20-2006   #7 (permalink)
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
Ok honestly, I took a look at your contact form tutorial, Id like to use it but i dont knwo what to change because I want to keep the way it looks right now but I need it to work.. Im also trying to change the borders to the right colors and they wont change.. is there anyway you can help me.. like we can do it through messenger? please let me know. my deadline is actually sunday or well monday night.. id really really appreciate it, and i understand if you dont want to.. heres the code for my current one.. i dont know what to change or add in.. help!

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
font-family:Arial, Tahoma, sans-serif;
font-size:0.6em;
margin:35px;
color:#000000;}
label {
margin: 0;
margin-top:0.3em;
text-align:right;
width:70px;
float:left;
text-transform:uppercase;
  }
fieldset {
  background-color:#ffffff;
  border:solid 1 #000; /* Opera doesn't get border:none or border:0 on fieldsets */
  width:300px;
  }
legend {
width:100px;
height:0px;
color:#000000;
font-size:2.5em;
padding-left:0em;
position:inherit;
top:-1.5em;
text-transform:uppercase;
font-weight:bold;
letter-spacing:-1px;
}

.br {display:none;}  
  
.textfield {
font:1.1em  Verdana, Arial, Helvetica, sans-serif ;
color:#000000;
margin:3px;
height:18px;
border:solid 1 #000000;
padding: 0px 0px;
width:200px;

width:187px;
}
fieldset>input.textfield {
}
textarea {
font:1.1em Arial, Tahoma, sans-serif;
color:#000000 ;
margin:3px;
height:165px;
border:solid 1 #000000;
padding: 0 8px;
width:200px;
width:190px;
}
fieldset>textarea {
}
.submit {
margin:3px;
height:18px;
border:solid 1 #000000;
width:80px;
font:1.1em Verdana, Arial, Helvetica, sans-serif;
color:#000000 ;
text-transform:uppercase;
 }
</style>
</head>

<body>
<form action="http://pub40.bravenet.com/emailfwd/senddata.php" method="post" enctype="multipart/form-data">
<fieldset class="fieldset">
<legend>Contact Form</legend>
<label for="name">Name:</label><br class="nobr" />
<input name="name" type="text" class="textfield"  id="name"  />
<br />
<label for="email">Email:</label><br class="nobr" />
<input name="email" type="text" class="textfield" id="email" />
<br/>
<label for="phone">Phone:</label><br class="nobr" />
<input name="website" type="text" class="textfield" id="website" />
<br />
<label for="comment">Comment:</label><br class="nobr" />
<textarea cols="30" rows="15" name="comment" id="comment" class="textarea"></textarea>
<br />
<label for="submit">&nbsp;</label><br class="nobr" />
<input name="submit" type="submit" class="submit" id="submit" value="submit" />
</fieldset>
</form>

</body>
</html>
__________________
google is my lover, whos yours?
ecntrc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-21-2006   #8 (permalink)
Yup, that's meee!
 
thecubed's Avatar
 
Join Date: Jun 2004
Location: Infront of my screen (most of the time)
Posts: 89

Send a message via AIM to thecubed Send a message via Yahoo to thecubed Send a message via Skype™ to thecubed
Border color of what?
and whose tutorial are you using for the email sending program?
When I copy/paste the code into dreamweaver, it looks fine to me.
__________________

www.thecubed.com <--- TheCubed Homepage!
thecubed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 01-21-2006   #9 (permalink)
"Enter Random Text Here"
 
sancho's Avatar
 
Join Date: Jun 2005
Location: Handsacre, UK
Posts: 37

Send a message via MSN to sancho Send a message via Skype™ to sancho
This is your contact form which sends to itself and sends the email

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
font-family:Arial, Tahoma, sans-serif;
font-size:0.6em;
margin:35px;
color:#000000;}
label {
margin: 0;
margin-top:0.3em;
text-align:right;
width:70px;
float:left;
text-transform:uppercase;
  }
fieldset {
  background-color:#ffffff;
  border:solid 1 #000; /* Opera doesn't get border:none or border:0 on fieldsets */
  width:300px;
  }
legend {
width:100px;
height:0px;
color:#000000;
font-size:2.5em;
padding-left:0em;
position:inherit;
top:-1.5em;
text-transform:uppercase;
font-weight:bold;
letter-spacing:-1px;
}

.br {display:none;}  
  
.textfield {
font:1.1em  Verdana, Arial, Helvetica, sans-serif ;
color:#000000;
margin:3px;
height:18px;
border:solid 1 #000000;
padding: 0px 0px;
width:200px;

width:187px;
}
fieldset>input.textfield {
}
textarea {
font:1.1em Arial, Tahoma, sans-serif;
color:#000000 ;
margin:3px;
height:165px;
border:solid 1 #000000;
padding: 0 8px;
width:200px;
width:190px;
}
fieldset>textarea {
}
.submit {
margin:3px;
height:18px;
border:solid 1 #000000;
width:80px;
font:1.1em Verdana, Arial, Helvetica, sans-serif;
color:#000000 ;
text-transform:uppercase;
 }
</style>
</head>

<body>
<?php
if(isset($_POST['sendMail']))
{

	$to = "mst0ke@yahoo.com";
	$name = trim($_POST['name']);
	$email = trim($_POST['email']);
	$message = trim($_POST['comment']);

	if(((empty($name))||(empty($email))||(empty($message))))
	{

		echo 'Sorry, you forgot to fill out some required fields. ';
		echo '<a href="javascript:history.back(1)">Try again</a>';

	} 
	else 
	{

		if(!strstr($email , "@"))
		{

			echo 'Please enter a valid email address. ';
			echo '<a href="javascript:history.back(1)">Try again</a>';
		
		}
		else
		{

			$send = mail($to , "Contact message from YourWebsite" , "This email was sent from your website.\n\n".$name." send this message from ".$email.":\n\n".$message."\n\nClick reply and it will send to this email." , "From: Contact Form Reply-to: ".$email);

			if($send)
			{

				echo 'Mail sent successfully.';

			} 
			else 
			{

				echo 'There was an error sending the mail!';

			}
		}
	}
}
else
{
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data">
<fieldset class="fieldset">
<legend>Contact Form</legend>
<label for="name">Name:</label><br class="nobr" />
<input name="name" type="text" class="textfield"  id="name"  />
<br />
<label for="email">Email:</label><br class="nobr" />
<input name="email" type="text" class="textfield" id="email" />
<br/>
<label for="phone">Phone:</label><br class="nobr" />
<input name="website" type="text" class="textfield" id="website" />
<br />
<label for="comment">Comment:</label><br class="nobr" />
<textarea cols="30" rows="15" name="comment" id="comment" class="textarea"></textarea>
<br />
<label for="submit">&nbsp;</label><br class="nobr" />
<input name="sendMail" type="submit" class="submit" id="sendMail" value="submit" />
</fieldset>
</form>
<?php
}
?>
</body>
</html>
__________________

Portfolio: www.simonmclaughlin.co.uk
Cheap UK hosting: www.qubithosting.com

Last edited by sancho; 01-22-2006 at 05:50 PM.
sancho is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 05-02-2006   #10 (permalink)
robin
 
robin746's Avatar
 
Join Date: May 2006
Location: Eire
Posts: 48

From a usability point of view, contact forms are wrong-headed. The polite thing is to simply give your user an email address and let them decide how to contact you. Anything else is a barrier in their way.
__________________
"out of environment space"
robin746 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ma "Love"ly Work masN Showrooms & Works In Progress 1 11-08-2005 07:43 PM
volcano starting(My new Work) The Lover Showrooms & Works In Progress 1 08-24-2005 07:31 PM
Simple User Info - Beta Testing ViciOuS HTML / PHP / ASP / JS 5 06-30-2005 06:33 AM
Simple Member script help? ViciOuS HTML / PHP / ASP / JS 17 04-15-2005 10:42 PM


All times are GMT +1. The time now is 01:29 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT