Welcome Guest ( Log In | Join )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Want to ask a question, reply to a topic, or remove all advertising? It's easy, fast and free. Join today!
Spyware, virus, trojan, fake security or privacy alerts? Please start with our malware cleaning guide.
     
 
Reply to this topicStart new topic
How do I create an easy to use web form?
Matt T
post Jul 28 2006, 09:35 PM
Post #1


GeekU Senior
Group Icon
Posts: 636
From: New Zealand
OS: Microsoft Windows XP Home Edition



Hello,

I would like to create an easy to code web form. Could anyone help me? I just need it for like feedback etc. Would it be possible for it to send the data to an e-mail address?

Thankyou for your help,

~Matt smile.gif

This post has been edited by Matt T: Dec 16 2007, 09:49 PM
Go to the top of the page
 
+Quote Post
TaNkZ101
post Jul 29 2006, 03:20 AM
Post #2


Member
***
Posts: 327
From: Zagreb, Croatia
OS: Windows XP HE



you need to use a server scripting technology such as php. here's an example form and script to go with it.
CODE
<form action="mail.php" method="post">
E-mail:
<input type="text" name="email">
First name:
<input type="text" name="firstname">
<br>
Last name:
<input type="text" name="lastname">
Input/feedback:
<textarea rows="10" cols="30" name="feedback">
Enter feedback here
</textarea>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>

as you can see, along with every input it is mandatory to use the name attribute. this is how the php will get the variables- the names become the names of the variables.
CODE
<html>
<body><?php

  //send email
  $email = $_REQUEST['email'];
  $subject = site feedback;
  $feedback = $_REQUEST['feedback'];
  $firstname = $_REQUEST['firstname'];
  $lastname = $_REQUEST['lastname'];
  $message = "$firstname $lastname sends you the following message \n $message";
  mail( "you@yoursite.com", "Subject: $subject", $message, "From: $email" );
  //message displayed on the user's screen
  echo "Thank you for using our mail form";

?>
</body>
</html>

i haven't tested it, however i wouldn't give this to u if i didn't think it works. test it, post the results (if any). there's a form section in www.w3schools.com's html tutorial, and a php mail section in its php tutorial.

This post has been edited by TaNkZ101: Jul 29 2006, 03:25 AM
Go to the top of the page
 
+Quote Post
Allsortgroup
post Jul 29 2006, 03:02 PM
Post #3


I SPAMMED Too Much!
***
Posts: 905
From: Southwater, West sussex, UK
OS: Windows Xp Home edition



Theres a good one here...

http://www.kirupa.com/web/php_contact_form.htm
Go to the top of the page
 
+Quote Post
Matt T
post Jul 29 2006, 05:44 PM
Post #4


GeekU Senior
Group Icon
Posts: 636
From: New Zealand
OS: Microsoft Windows XP Home Edition



Thankyou TaNkZ101, I tried what you suggested and Firefox said the file wasn't found because I couldn't get notepad to save it with a .php extenstion it put it as blahblah.php.txt. I went to the site that you reccomended w3schools.com and I didn't really understand the site.

Thankyou Allsortshop,

I tried that website link and it was very informative. I set all the files up on my websever but because it is free it doesn't support php (great) and this message comes up:

You have accessed a filetype or folder that must be served from a CGI server. This means that this file may exist, but if the site isn't upgraded for CGI, it cannot be served. To avoid this message, do not name your files with a .php, .cgi, or .pl extension, and don't store them in a folder named cgi-bin.

Does anyone know of a way to get around this or to get the script to automatically e-mail it to me preferbly without having to use the persons mail program (I know I am picky).

Thanks you guys for your help,
~Matt smile.gif

This post has been edited by Matt T: Dec 16 2007, 09:50 PM
Go to the top of the page
 
+Quote Post
TaNkZ101
post Jul 30 2006, 02:43 AM
Post #5


Member
***
Posts: 327
From: Zagreb, Croatia
OS: Windows XP HE



you can use asp to do it, but if your server doesn't support php i doubt it supports asp. or maybe cgi? i don't know. if your server doesn't support scripting, then if you HAVE to have the contact/feedback form, you could use html's "mailto:" function, or pick another host (www.free-webhosts.com has a database, including what they offer.)
here is an example with the form's 'mailto' attribute. Beware, it is supposedly extremely unreliable.
CODE
<html>
<body>
<form action="MAILTO:you@yoursite.com" method="post" enctype="text/plain">

<h3>This form sends an e-mail to W3Schools.</h3>
Name:<br>
<input type="text" name="name"
value="yourname" size="20">
<br>
Mail:<br>
<input type="text" name="mail"
value="yourmail" size="20">
<br>
Comment:<br>
<textarea rows="10" cols="30" name="feedback">
Enter feedback here
</textarea>
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">

</form>
</body>
</html>
Go to the top of the page
 
+Quote Post
Matt T
post Jul 30 2006, 10:46 PM
Post #6


GeekU Senior
Group Icon
Posts: 636
From: New Zealand
OS: Microsoft Windows XP Home Edition



Thankyou TaNk101,

I'll try that free web host that you reccomended. I have tried a html script just like the one you posted, but the reason I don't want to use a script like that is because the person who was sending feedback would have to have a mail program and an account set up with it. I could use it though if nothing else worked.

This post has been edited by Matt T: Dec 16 2007, 09:51 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts   1 / 349 23rd October 2005 - 06:01 AM
smpkge started - last by dsm
No New Posts   1 / 617 21st March 2007 - 06:18 AM
gotmtn started - last by Keith
No New Posts   3 / 438 31st March 2008 - 07:54 AM
Elisamark started - last by ScHwErV
No New Posts 7 / 341 20th October 2008 - 10:00 AM
SkyLogic started - last by SRX660

RSS Time is now: 7th January 2009 - 10:50 AM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.