creating a feedback form - Techist - Tech Forum

Go Back   Techist - Tech Forum > Internet > Web Graphics and Design
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 02-04-2007, 05:08 AM   #1 (permalink)
Ultra Techie
 
Join Date: Jul 2006
Posts: 889
Default creating a feedback form

i have been creating a feedback form and i am stuck i cant get it to send the comments to my email address.i want them to send there comments to my email-address with out using there email address.

Where have i gone wrong?

<form action="" enctype="Text/plain" name="form" id="form">
<input type="hidden" name="next_url" value="www.mysite.co.uk" />
<input name="To" type="hidden" id="To" value="my emailaddress is here" />
<input name="Subject" type="hidden" id="Subject" value="Comments" />
<input name="From" type="hidden" id="From" value="myotheremailaddress is here" />


<table width="466" height="315" border="0" cellspacing="8" id="comment form">
<tr>
<td width="95" height="28"><div align="right">First Name </div></td>
<td colspan="3"><label>
<input name="First Name" type="text" id="First Name" maxlength="20" />
</label></td>
</tr>
<tr>
<td height="24"><div align="right">Last Name </div></td>
<td colspan="3"><label>
<input name="Last Name" type="text" id="Last Name" maxlength="30" />
</label></td>
</tr>
<tr>
<td height="24"><div align="right">Gender</div></td>
<td colspan="3"><label>
<select name="ResList" id="ResList">
<option value="Male" selected="selected">Male</option>
<option value="Female">Female</option>
</select>
</label></td>
</tr>
<tr>
<td height="24"><label>
<div align="right">Email Address </div>
</label></td>
<td height="24" colspan="3"><label>
<input name="Email" type="text" id="Email" size="25" maxlength="50" />
</label></td>
</tr>
<tr>
<td height="24" colspan="4"><label>
<input type="CHECKBOX" name="subscribe" checked />
Subscribe me to the Newsletter </label></td>
</tr>
<tr>
<td height="50"><label></label> <div align="right">Comments</div>


</p>


</p>
<label></label></td>
<td height="50" colspan="3"><textarea name="Email " cols="45" rows="6" id="Email "></textarea></td>
</tr>
<tr>
<td height="24"></td>
<td width="56"><input type="submit" name="Submit" value="Submit" /></td>
<td width="48"><input name="Reset form" type="reset" id="Reset form" /></td>
<td width="219"></td>
</tr>
</table>
</form>


Please help thanks
oyea because i have created the form myself do i need a form processor? if so please help i dont want any banners on them
__________________

jay_bo is offline  
Old 02-04-2007, 12:56 PM   #2 (permalink)
Banned
 
Join Date: Oct 2006
Posts: 81
Default

jay_bo

What you have posted is just the "front end". You also need to add the active back end (.cgi, .asp, .php...depending on the platform) code that resides on your server to process your forms.


One of the first lines in the front end should call this backend code to process your form.
Code:
<form enctype="multipart/form-data" action="formmail.php" method="post">
Your back end code or the code that resides on your server and process the form can very. There is a lot of free and easy stuff out there you can download. I can post or email you a long example of this.

Cheers,
Williwaw
__________________

williwaw is offline  
Old 02-04-2007, 06:40 PM   #3 (permalink)
Wizard Techie
 
CrazeD's Avatar
 
Join Date: Feb 2006
Location: Maine
Posts: 3,736
Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default

I'd go with PHP, it's pretty easy. Here's an example:

Code:
<?php 

$message="Name: {$_POST['First Name']}
";
$message = stripslashes($message);

mail("YOUR EMAIL","THE EMAIL SUBJECT",$message); 

echo "Thank you for submitting feedback!";



?>
Okay, now. If you save the above code as something like "process.php" and throw it in the same directory as your feedback form is in, and then enter something into the 'First Name' field, and hit submit, it will send it to the email that you provided in the 'process.php'.

But first, you ahve to set your action to call upon the 'process.php' as "williwaw" said.

That's probably a little confusing.... if you have any more questions, I'll try to help.

Also: your server needs to support the PHP mail function for this to work.
__________________

Intel Q9400 | Gigabyte EP45-UD3P | G.Skill 2x2GB DDR2 1000 | XFX HD5870

Need website help? PM me!
CrazeD is offline  
Old 02-05-2007, 09:47 AM   #4 (permalink)
Ultra Techie
 
Join Date: Jul 2006
Posts: 889
Default

okay i dont think i will be able to do it would anyone be able to make me one with the following fields: First Name, Last Name, There email address which i dont want them to put in unless they want a reply or subscribe to a newsletter and then the comments and a submit and reset button. I know you will need my email address but would you just put in "youremailaddresshere"

i just dont get what to do on the directory folder and how the php links to the html page

thanks
jay_bo is offline  
Old 02-05-2007, 09:44 PM   #5 (permalink)
Banned
 
Join Date: Oct 2006
Posts: 81
Default

It WILL NOT work UNLESS you use an active server side script such as .php, .cgi, or .asp...

Here are your options:

Option A-Option B-
  • Give me your user name and password to your server...Whaa, ah, ah, ah

Cheers,
Williwaw
williwaw is offline  
Old 02-07-2007, 02:29 AM   #6 (permalink)
Wizard Techie
 
CrazeD's Avatar
 
Join Date: Feb 2006
Location: Maine
Posts: 3,736
Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default

Here you go:

The html file:
Code:
<html>
<body bgcolor="#000000">


<form method="post" action="process.php">
<center>




	<table border="1" bordercolor="#2d2d2d" cellpadding="3" width="70%">

		<tr>
			<td align="center"><font color="#ffffff" face="Arial" size="2">First Name:</font></td>
			<td align="center"><input type="text" name="firstname" /></td>
		</tr>

		<tr>
			<td align="center"><font color="#ffffff" face="Arial" size="2">Last Name:</font></td>
			<td align="center"><input type="text" name="lastname" /></td>
		</tr>

		<tr>
			<td align="center"><font color="#ffffff" face="Arial" size="2">e-Mail:</font></td>
			<td align="center"><input type="text" name="email" /></td>
		</tr>

		<tr>
			<td align="center"><font color="#ffffff" face="Arial" size="2">Comments:</font></td>
			<td align="center"><textarea cols="16" rows="5" wrap></textarea></td>
		</tr>
	</table>


			<input type="submit" name="submit" value="Submit" />
			<input type="reset" name="reset" value="Reset" />
</center>

	
</body>
</html>
And the PHP file:

Code:
<?php 

$message="First Name: {$_POST['firstname']}           // This is where you tell the PHP script which input fields to enter into
Last Name: {$_POST['lastname']}						  // the email. 
e-Mail: {$_POST['email']}							  
Comments: {$_POST['comments']}
";

$message = stripslashes($message);					 // Don't worry about this, leave it be.

mail("YOUR EMAIL","THE EMAIL SUBJECT",$message);     // Change "YOUR EMAIL" to your email address, and change "THE EMAIL SUBJECT"
													 // to what you want the subject to be called.


echo "Thank you for submitting feedback!";           // This will post a line of text on a blank white page after pressing
													 // the 'Submit' button. You can change the text between the quotes, or,
													 // delete the line altogether.

header("Refresh: 0;url=YOUR SITE URL/");             // This will automatically redirect to your site URL after you press the 
													 //	'Submit' button. The '0' indicates how long it will take to redirect.


?>

EDIT: Download link


Hope I helped.
__________________

__________________

Intel Q9400 | Gigabyte EP45-UD3P | G.Skill 2x2GB DDR2 1000 | XFX HD5870

Need website help? PM me!
CrazeD is offline  
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 Off



Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 03:36 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.