PDA

View Full Version : Creating a feedback page


Mike the Great
05-17-2003, 10:45 AM
Okay, no mumbojumbo, because I really suck at HTML, so, I want to make a feedback page, you enter comments, you enter your name and email address, and you click on a button. It then sends all that info to my email address.

Any help would be very appreciatted.

redhead
05-17-2003, 11:06 AM
firstly you need to set up a form (http://www.w3schools.com/html/html_forms.asp) where the user will enter the relavent info... then you need to sign up for a service that will send the info to your email... such as whammy's FormMail... which you can sign up to here (http://www.solidscripts.com/login/register.asp)...

then just set up the form to work properly and there you go :)

Len Whistler
05-17-2003, 09:41 PM
I would recommend a html form that is processed by a .php file

If you go to my site at http://www.stubby.ca and scroll down the INFORMATION page you will see a very simple feedback form that sends the information to my yahoo email address. Both the .html and .php are very easy to code and they are put into ther same directory as your index.htm file.


Leonard Whistler
http://www.stubby.ca

Mike the Great
05-19-2003, 02:53 PM
I don't really get it, don't you have to assign something to the submit button? Could you put up an example?

Fatman
05-19-2003, 05:33 PM
somethng like the conmtact pacge at www.phatman.co.uk ??

fatman

redhead
05-19-2003, 06:16 PM
Originally posted by Mike the Great
I don't really get it, don't you have to assign something to the submit button? Could you put up an example? not to the submit button, but you put action="yourForumPage.php" or whatever in the <form> tag...

len's suggestion is also good if you are familiar with PHP... but if you are not it would be best to use a remotly hosted script to process your form... like whammys script that i recommended above

any more clear now? :thumbsup:

Mike the Great
05-19-2003, 07:57 PM
:confused: I tried to get the Whammy Mail Form thingy, but it says that to get to the program I need to register, when I register (which I've already done) it sends me back to the home page, an it takes me to the same exact place!

ionsurge
05-19-2003, 09:18 PM
Guys why not just post up some of the html/php source that you are talking of for Mike The Great showing what goes in the html page and what goes into the php page (which should be in the same place).

Len Whistler
05-19-2003, 09:51 PM
1...Below is the php code I use for my form. Cut and copy it into Notepad and save it as feedback.php

2....Go to my html form at http://www.stubby.ca/contactb.htm and cut the form code out and paste it in the location you want the form. You should have a basic idea of HTML to find the form code.

3...Create a thankyou.htm form to let the user of your form know that the info was sent. Go to my site at www.stubby.ca and then use my form on the Information page to give you an idea how it works.

4...In the code below there are 3 locations that apply to me only, you must find then and change them for your site. Also the error.htm part doesn't work, but this does not affect the function of the form. I haven't had time to fix it.

5...This is a great code for a feedback form, any other questions should be posted in the php forum on this site. I am just learning php and so far I find it to be very usefull.

Leonard Whistler
www.stubby.ca


PHP CODE


<?
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (empty($comments));
header('Location: http://www.stubby.ca/error.htm');

$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS
-------------------------\n\n" .
$comments .

"\n\n------------------------------------------------------------\n"
;

mail('lwhistler@yahoo.com',"Feedback Form", $messageproper,"X-Mailer: chfeedback.php 2.01" );
header('Location: http://www.stubby.ca/thankyou.htm');
exit ;

?>

Nightfire
05-19-2003, 10:48 PM
No pages needed, apart from this one

<?

// Fill in the below with your details
$yourname = 'Jim Brown'; // Your name or company name
$youremail = 'you@yourdomain.com'; // Your e-mail address
$pagetitle = 'Feedback form'; // page title

// No need to edit below!

?>
<html>
<head>
<title><?=$pagetitle?></title>
</head>
<body>
<?

$form = $error.'<br /><form action="'.$_SERVER[PHP_SELF].'" method="post">
<input type="text" name="contact_name" title="Your name" /> Your name<br />
<input type="text" name="email" title="Your e-mail" /> Your e-mail <br />
<textarea cols="30" rows="10" name="message" title="Your message">Your message</textarea><br />
<input type="submit" name="submit" value="Submit" title="Submit form" />
</form>';

if(!isset($_POST('submit')){
echo $form;
}else{
$contact_name = $_POST['contact_name'];
$email = $_POST['email'];
$message = $_POST['message'];

if((!$contact_name) || (!$email) || (!$message)){
$error = '<span style="color:#ff0000">You must fill in all fields!</span><br />';
echo $form;
}else{
$contact_copy = 'Hello '.$contact_name.',
Thank you for your e-mail. You will be contacted soon regarding your query

Faithfully,
'.$yourname;

$contact_subject = 'Thank you from '.$yourname;

$your_copy = 'You have received an e-mail from '.$contact_name.'. Below is the message sent.

'.$message.'

E-mail:

'.$email;

$your_subject = 'Feedback entry from '.$contact_name;

$from = 'From: '.$youremail;

mail($email,$contact_subject,$contact_copy,$from);

mail($youremail,$your_subject,$your_copy,"From: ".$email);

echo 'Thank you '.$contact_name.'. Your e-mail has been sent. You should also receive a copy the form in your e-mail';
}
}
?>
</body>
</html>


untested, but it should work

vasantha
11-27-2003, 06:11 AM
Nightfire,
I've checked ur code. I've copied and pasted the code given in a new form named form1.php and changed the values for $yourname, $youremail, $pagetitle.
But it shows the following error in the browser when I run form1.php file.

Warning: Unknown(C:\Documents and Settings\yvm\Desktop\php\phpform.php): failed to open stream: Permission denied in Unknown on line 0

Warning: (null)(): Failed opening 'C:\Documents and Settings\yvm\Desktop\php\phpform.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0

I am completely new to PHP. Please guide me..

Thanx a million..

netpets
02-04-2004, 06:22 PM
<FORM action="mailto:(enter your email address here)" method=post><INPUT TYPE="hidden" name="userid" value="3283657">
<p align="center">Name:<input name="name" size="20"><BR>Email:<input name="email" size="20"><BR>
Do you like Netpets?&nbsp; Yes<input type="radio" value="V1" checked name="R1">&nbsp;
No<input type="radio" name="R1" value="V2"></p>
<p align="center">Leave your comments here:<BR>
<TEXTAREA name="message" rows="8" cols="33"></TEXTAREA><BR><input value="Enter your feedback" type="submit"></p>
</FORM>
<SCRIPT type = "text/javascript" src="guestbook.js"></SCRIPT>
<input type="hidden" name="next"
value="http://www.freewebs.com/netpetsdemo/feedback_acepted.htm">

you need to do 2 things

1. add your email address after mailto:

2. change the urls