Jump to content
xisto Community
tempest

Feedback Form Into Your Web-page

Recommended Posts

Hello! I run pass some tutorial here and saw, that here isn`t normal tutorial for simple feedback (contact) form! So, I`m going to write one here! Let`s start:

 

<table width="400" border="0" align="center" cellpadding="3" cellspacing="1"><tr><td><strong>Contact Form </strong></td></tr></table><table width="400" border="0" align="center" cellpadding="0" cellspacing="1"><tr><td><form name="form1" method="post" action="send_contact.php"><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td width="16%">Subject</td><td width="2%">:</td><td width="82%"><input name="subject" type="text" id="subject" size="50"></td></tr><tr><td>Detail</td><td>:</td><td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td></tr><tr><td>Name</td><td>:</td><td><input name="name" type="text" id="name" size="50"></td></tr><tr><td>Email</td><td>:</td><td><input name="customer_mail" type="text" id="customer_mail" size="50"></td></tr><tr><td> </td><td> </td><td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></tr></table></form></td></tr></table>

Paste this code into Notepad and save it as contact.php . That`s the first step! Ofcourse you can change all the questions or add some!

 

Next step is to creat in-comeing form, so here is code for it -

 

<?php// Contact subject$subject ="$subject";// Details$message="$detail";// Mail of sender$mail_from="$customer_mail";// From$header="from: $name <$mail_from>";// Enter your email address$to ='someone@somewhere.com';$send_contact=mail($to,$subject,$message,$header);// Check, if message sent to your email// display message "We've recived your information"if($send_contact){echo "We've recived your contact information";}else {echo "ERROR";}?>

Save it as send_contact.php There is something more, that you need to do, so find // Enter your email address

$to ='someone@somewhere.com'; in second code and change someone@somewhere.com to your e-mail! In my mind that got to work!

 

http://forums.xisto.com/no_longer_exists/ - that`s how it looks for me!

Share this post


Link to post
Share on other sites

Thank you for this tutorial you can make a small code that verifies if the email is in the correct form for example: Email must be in this form : something@domain.com And everyone who enters an email not in this format, then that message will comeup. Now the problem is that I don't know what is this code, but I think you can find it by googling.

Share this post


Link to post
Share on other sites

Thanks, it?s basic but I appreciate it, since the ones I?ve done are just made by copying and replacing things. Hopefully this will help me to understand things.

Share this post


Link to post
Share on other sites

Well, i did something similar, but definately decided not to send to an email address, cuz it sometimes went to Spam folder, or strange things, my Feedback Form (wroted weeks ago) putted the output into an html file so you could read it wherever you want, if it's on a pub server.

Here is the topic of my tutorial.

Share this post


Link to post
Share on other sites

That's nice! I don't really like using the complicated form.phps that you can find in hotscripts.com or something. However, it doesn't seem like it has validation. Validation should be easy, just have something like

if ($message=='') {echo "You didn't fill out the message";}

Share this post


Link to post
Share on other sites

Hello, I need a form to send e-mails, but that is not created in PHP, but I need it for JSP.

 

It would thank for the aid to them that can offer me, since it is necessary for a project of the university.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.