Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit


Reply
 
LinkBack (1) Thread Tools Display Modes
Old 21-11-2007, 09:57 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Arrow [Readymade script] A feedback/contact form for your website


You can use this form to allow your visitor contact you for enquiries or feedback. you don't have to give out your email address so that people wont spam you.

Step 1: The script. It has two parts:
1. The feedback form which is to be filled by the visitor. It is in plain HTML. It will contain necessary variables such as 'From', 'subject', 'message'.
2. The PHP script which would be hosted on your server. This script will process the variables in the feedback form and send the email.

The HTML form:
Copy below code and save it in a file named as feedback.html. When a visitor clicks on fedback link, he should be taken to feedback.html
Code:
<form method="POST" action="/feedback.php">
<table border="0" cellpadding="0" width="63%" cellspacing="0">
  <tr>
    <td width="23%">Your email address:</td>
    <td width="77%"> <input type="text" name="from" size="40"></td>
  </tr>
  <tr>
    <td width="23%">Subject of mail: </td>
    <td width="77%"> <input type="text" name="subject" size="40"></td>
  </tr>
  <tr>
    <td width="23%" valign="top">Your message:</td>
    <td width="77%"> <textarea name="body" rows="7" col="20" cols="34"></textarea></td>
  </tr>
  <tr>
    <td width="23%"> </td>
    <td width="77%">
<input type="submit" value="Send feedback">
    </td>
  </tr>
</table>
</form>
The PHP script:
Copy below code and save in a file named feedback.php
Code:
<?php
$to="youruserid@yourdomain.com";
$subject= $_POST['subject'];
$body = $_POST['body'];
$headers= $_POST['from'];

if(mail($to,$subject,$body,"From: $headers"))
{
echo "Thank you for your valuable feedback";
}
else
{
echo "Oops, there seems some problem with sending the feedback. Please try again later. If problem persists, you may send your feedback directly to $to.";
}
?>
You MUSt replace youruserid@yourdomain.com with your email address.

Step 2: Now upload both the files to your server. You will have to change the relative path of the feedback form if you are not uploading the two giles to the same directory.

Step3: Format the elements as per your needs.

Personal notes:References:
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता

Last edited by victor_rambo; 21-11-2007 at 11:40 PM.
victor_rambo is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 21-11-2007, 11:27 PM   #2 (permalink)
mera kutch nahi ho sakta
 
chesss's Avatar
 
Join Date: Oct 2005
Location: Delhi
Posts: 880
Default Re: [Readymade script] A feedback/contact form for your website

Quote:
If we submit the form through the same window, the user will get a blank form when he clicks 'Back' button to make some correction.
not if the user is using Opera (and firefox?)
__________________
jin files ka koi server nahi hota unka bittorrent hota hai
chesss is offline   Reply With Quote
Old 21-11-2007, 11:46 PM   #3 (permalink)
Be CoOl rAp RuLeZ !!!
 
krates's Avatar
 
Join Date: Feb 2007
Posts: 1,967
Default Re: [Readymade script] A feedback/contact form for your website

you made the script after 2 hours before i have done here

http://www.thinkdigit.com/forum/show...452#post666452

and this must go to programming
__________________
iPhone 3G 16GB + Samsung I450 + Sennheiser CXL 400 + PSP Phat + Samsung NC10 :D

Previous phones: N73ME , W810I , Asus P320
krates is offline   Reply With Quote
Old 21-11-2007, 11:55 PM   #4 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [Readymade script] A feedback/contact form for your website

Quote:
Originally Posted by kushagra_krates@yahoo.com
you made the script after 2 hours before i have done here

http://www.thinkdigit.com/forum/show...452#post666452

and this must go to programming
Changes made to the script: The target=_blank attribute has been removed considering that pop-up blockers may block the message from being sent. Some pop-up blockers do block target="_blank" hrefs.

@ Kushagra, This thread is not meant to display coding, its meant for people who want to make a contact form for their site. So this should be in tutorials rather than programming.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline   Reply With Quote
Old 22-11-2007, 11:38 AM   #5 (permalink)
vaibhavtek
Guest
 
Posts: n/a
Default Re: [Readymade script] A feedback/contact form for your website

nice 1
  Reply With Quote
Old 22-11-2007, 11:51 AM   #6 (permalink)
TechFreakiez.com
 
Abhishek Dwivedi's Avatar
 
Join Date: Sep 2006
Location: New Delhi
Posts: 621
Default Re: [Readymade script] A feedback/contact form for your website

gud job...but wrong section...
__________________
Personal Log | Star date 05.04.2009: TDF Meet Kanpur was Awesome :D
www.TechFreakiez.com
Abhishek Dwivedi is offline   Reply With Quote
Old 22-11-2007, 11:58 AM   #7 (permalink)
vaibhavtek
Guest
 
Posts: n/a
Default Re: [Readymade script] A feedback/contact form for your website

i doesnot thinks it is wrong section.
he had made a tut. and posted in tut. section....
  Reply With Quote
Old 22-11-2007, 06:10 PM   #8 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [Readymade script] A feedback/contact form for your website

Thanks!

yeah! its a utility. Not a programming one!

and I wonder what sort of visibility would this have in programming section which has only 2 or 3 viewing.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline   Reply With Quote
Old 22-11-2007, 06:12 PM   #9 (permalink)
vaibhavtek
Guest
 
Posts: n/a
Default Re: [Readymade script] A feedback/contact form for your website

thats correct buddy
  Reply With Quote
Old 22-11-2007, 09:09 PM   #10 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: [Readymade script] A feedback/contact form for your website

Quote:
Originally Posted by rohan_shenoy
and I wonder what sort of visibility would this have in programming section which has only 2 or 3 viewing.
It isn't about more reads you get, its about people finding things easily when needed.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline   Reply With Quote
Old 22-11-2007, 09:15 PM   #11 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [Readymade script] A feedback/contact form for your website

Quote:
Originally Posted by QwertyManiac
It isn't about more reads you get, its about people finding things easily when needed.
Its not about how many read this tutorial, it about how many can see it when they need it.

The description given for the Programming section is hi-funda enough to put off a newbie.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline   Reply With Quote
Old 22-11-2007, 09:19 PM   #12 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: [Readymade script] A feedback/contact form for your website

*shrugs* I'd head to an apt section if what I'm looking for is PHP. Your call anyway.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline   Reply With Quote
Old 22-11-2007, 09:30 PM   #13 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [Readymade script] A feedback/contact form for your website

Quote:
Originally Posted by QwertyManiac
*shrugs* I'd head to an apt section if what I'm looking for is PHP. Your call anyway.
Not everybody knows if that is made in PHP.
Moreover, it is may be possible to make such script even in CGI, ASP, Perl,etc.
So how many sections should a member search in?
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline   Reply With Quote
Old 27-11-2007, 02:27 PM   #14 (permalink)
Wise Old Owl
 
harryneopotter's Avatar
 
Join Date: Feb 2007
Posts: 1,009
Default Re: [Readymade script] A feedback/contact form for your website

thnx buddy ...... but plz tell me one more thing ....... wat if i want to redirect to a webpage after successfull submission ......wat change shld i do in ur script ?? plz help soon ....
harryneopotter is offline   Reply With Quote
Old 27-11-2007, 04:05 PM   #15 (permalink)
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default Re: [Readymade script] A feedback/contact form for your website

thanks
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore
Gigacore is offline   Reply With Quote
Old 29-11-2007, 06:13 PM   #16 (permalink)
Be CoOl rAp RuLeZ !!!
 
krates's Avatar
 
Join Date: Feb 2007
Posts: 1,967
Wink Re: [Readymade script] A feedback/contact form for your website

Quote:
Originally Posted by harryneopotter
thnx buddy ...... but plz tell me one more thing ....... wat if i want to redirect to a webpage after successfull submission ......wat change shld i do in ur script ?? plz help soon ....
use redirect(url name);

__________________
iPhone 3G 16GB + Samsung I450 + Sennheiser CXL 400 + PSP Phat + Samsung NC10 :D

Previous phones: N73ME , W810I , Asus P320
krates is offline   Reply With Quote
Old 29-11-2007, 08:50 PM   #17 (permalink)
Wise Old Owl
 
harryneopotter's Avatar
 
Join Date: Feb 2007
Posts: 1,009
Default Re: [Readymade script] A feedback/contact form for your website

thnx ............. can i make costum scripts for any form easlily ? mean if i have more fields in the form then how wld i link them to script ? plz tell if u can ...........
harryneopotter is offline   Reply With Quote
Old 10-12-2007, 09:07 PM   #18 (permalink)
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default Re: [Readymade script] A feedback/contact form for your website

thanks a lot rohan_shenoy, i've added it to my site!
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore
Gigacore is offline   Reply With Quote
Old 10-12-2007, 10:29 PM   #19 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: [Readymade script] A feedback/contact form for your website

Quote:
Originally Posted by harryneopotter
thnx ............. can i make costum scripts for any form easlily ? mean if i have more fields in the form then how wld i link them to script ? plz tell if u can ...........
Define the variable in PHP script and then have input fields for them in HTML form.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline   Reply With Quote
Old 29-03-2009, 02:43 PM   #20 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2009
Posts: 1
Default Re: [Readymade script] A feedback/contact form for your website

If i want to recive this form data to my yahoo or other mail
jameel.khattak is offline   Reply With Quote
Old 29-03-2009, 03:17 PM   #21 (permalink)
Call me D_J!
 
Disc_Junkie's Avatar
 
Join Date: Nov 2008
Location: INDIA
Posts: 866
Default Re: [Readymade script] A feedback/contact form for your website

^ Look at the date before posting.
__________________
ASUS K42JA-VX032D RAWKS !!!!!!:grin:
Disc_Junkie is offline   Reply With Quote
Reply

Bookmarks

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


LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/tutorials/73786-readymade-script-feedback-contact-form-your-website.html
Posted By For Type Date
[Readymade script] A feedback/contact form for your website « Phutse’s Weblog This thread Refback 28-10-2011 12:56 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
!!! Advanced feedback form !!! krates Programming 6 21-11-2007 11:19 PM
Feedback form harshaz QnA (read only) 3 10-06-2007 09:07 AM
PHP Feedback form not working........? satyamy QnA (read only) 18 25-04-2007 06:12 PM
Contact US php script problem Choto Cheeta Open Source 2 11-03-2006 09:28 PM
Saving yourself from contact form hijacking Deep Tutorials 2 30-11-2005 10:00 AM

 
Latest Threads
- by Who
- by Krow
- by clmlbx
- by Tech&ME
- by icebags

Advertisement




All times are GMT +5.5. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2