FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » Making forms work on webpages

   
Author Topic: Making forms work on webpages
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
Obligatory disclaimer: I have no idea what i'm doing. I know how to make web pages look pretty, and that's about it. Thank all you fine people for humoring me.

Situation: I've managed to make a really pretty form here. I've been trying to teach myself how to make it work, reading through tutorials here.

Question: I'm not quite sure where the infor actually goes when someone hits "submit." Can I make it go to an email address? I tried the tutorial on that page, and it makes it open mail rather than sending the information. What I'd like to do is make the information go into an email and send the submitter to another page that says "Thank you for submitting."

Any ideas on how I can make this work?

Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
Bokonon
Member
Member # 480

 - posted      Profile for Bokonon           Edit/Delete Post 
The form handling usually requires plugins to your server system that you can interface with, or require coding of some sort.

-Bok

Posts: 7021 | Registered: Nov 1999  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
You can make it go to an e-mail (give me a sec and I'll post how), the other option is submitting it to a CGI program of some sort (probably Perl). Perl's a good thing to know, but I'm going to assume that for this you don't really want to go to the trouble of learning a programming language so I'll try to remember the e-mail one and tell you. [Smile]

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
code:
<form action="MAILTO:my_e-mail@AnnieIsPerfect.true" method="post" enctype="text/plain">

There you go, now when you hit the submit button, it will fire off an e-mail with the information from the form to the specificed adress. [Cool]

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
http://www.dtheatre.com/scripts/formmail.php
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
And no, that won't work Hobbes . . .
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
Why not Fugu? I've actually done this before and got it to work...

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
I tried that Hobbesy (or something really similar) and that's what opened Mail.
Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
She wants it to mail it directly, not open up a mail, which she said she could already get it to do.
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
Well that's really odd, I've gotten this to work before... I'm going to go find my notes.

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
TMedina
Member
Member # 6649

 - posted      Profile for TMedina   Email TMedina         Edit/Delete Post 
This was a great site reference when I was bashing out webpages at GSU.

HTMLgoodies.com

I'd be happy to sit down and help you putz with the code if you like - sit down as in skim the site, look at your code and do some research. [Big Grin]

-Trevor

Posts: 5413 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
Plus it'll just fail on a computer without an application set up to handle mail, or the application set up to handle mail not having an SMTP server set up (many windows users use web mail, but still have Outlook Express set as the default mail handler, with no accounts defined).
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
The formmail script I pointed you at will do anything you need to do.
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
Ohh, it was a while ago I did this...

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
That would be great, Trevor. I'm trying to use these forms in two sites I'm working on.

And where did I get the code in the first place? I have my ways.

Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
By the way, Hatrack boys ROCK.
Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
TMedina
Member
Member # 6649

 - posted      Profile for TMedina   Email TMedina         Edit/Delete Post 
I'm an idiot...ok...trying plan B.

-Trevor

Posts: 5413 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
TMedina
Member
Member # 6649

 - posted      Profile for TMedina   Email TMedina         Edit/Delete Post 
After much crunching and muttering, I can make the "mailto:" command work, but as it has been pointed out, will not do wonders for customers who haven't configured their email programs or browser programs.

Plan B would involve loading a CGI to the server which generates the email directly without requiring client-side access.

-Trevor

Posts: 5413 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
http://www.dtheatre.com/scripts/formmail_doc.php describes how to set it up in many imaginable situations. Can you link to the form you'd like to use? I can show you how you'd modify it to work with the formmail script.
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Nato
Member
Member # 1448

 - posted      Profile for Nato   Email Nato         Edit/Delete Post 
Isn't http://www.sacajaweagallery.com/information.html the link to the form?

That looks like a useful script, fugu.

Posts: 1592 | Registered: Jan 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
Oops, completely forgot about that link at the top.

Lets see, first you need to enclose all your form elements in
code:
<form action="formmail.php" action="POST">

</form>

Then you want to change the name of the email field to email (lower case), the phone field to phone_no, and rename the title field to something like job_title (so the formmail script doesn't think its one of its special variables).

Then you want to add the following form inputs:
code:
<input type="hidden" name="required" value="email, phone_no, anything else you want required" />

<input type="hidden" name="redirect" value="URL page I want redirected to upon a successful result" />

<input type="hidden" name="missing_fields_redirect" value="URL of page for missing fields
which states which fields should be filled in and says the person should hit their back button to return to the form" />

<input type="hidden" name="sort" value="order: put the names of the fields
you want in the order you want to see them appear in the email, separated by commas" />

<input type="hidden" name="subject" value="Desired Subject of the email" />

In the script itself (after you download it, before you upload it), you want to make the line that defines $recipient look like the following:
code:
$recipient = "email_to_send_to@example.org";

and the line that defines $referers look like the following:
code:
$referers = ('sacajaweagallery.com', '217.160.226.67');

Upload the formmail script, and it should probably work right off.

[ July 07, 2004, 09:23 PM: Message edited by: fugu13 ]

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
*bump*
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
Thanks for the info, Fugu! I've been off and on with my internet accessibility, so I just wanted you to know that I got it OK. [Smile]
Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
Can I ask if I've got this all configured correctly? I can't test it yet because I have to approve the page before uploading it to its real domain.

The one question I had is if there's any way to determine the number part of the domain name if I don't know it. Here's what I have in the formmail.php file:

code:
$referers = array ('jessewhenderson.com','www.jessewhenderson.com','121.0.0.111');

code:
$recipient = "michelle@crazyboy.biz"; // michelle@crazyboy.biz

...and here are the changes I made to the html of the form pages:

code:
 <input type="hidden" name="required" value="SendProductLiterature, SendCompanyliterature, SalesContactRequested, custname, company, address, email, phone" />
<input type="hidden" name="redirect" value="success.htm" />
<input type="hidden" name="missing_fields_redirect" value="missing.htm" />
<input type="hidden" name="sort" value="order: SendProductLiterature, SendCompanyliterature, SalesContactRequested, custname, company, address, email, phone" />
<input type="hidden" name="subject" value="Customer Information Request" />

Does that all look right?

[ July 12, 2004, 12:19 AM: Message edited by: Annie ]

Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
fallow
Member
Member # 6268

 - posted      Profile for fallow   Email fallow         Edit/Delete Post 
too good. just a hair. breadth's.

night.

enjoy.

[Razz]

Posts: 3061 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2