This is topic Making forms work on webpages in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=025746

Posted by Annie (Member # 295) on :
 
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?
 
Posted by Bokonon (Member # 480) on :
 
The form handling usually requires plugins to your server system that you can interface with, or require coding of some sort.

-Bok
 
Posted by Hobbes (Member # 433) on :
 
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]
 
Posted by Hobbes (Member # 433) on :
 
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]
 
Posted by fugu13 (Member # 2859) on :
 
http://www.dtheatre.com/scripts/formmail.php
 
Posted by fugu13 (Member # 2859) on :
 
And no, that won't work Hobbes . . .
 
Posted by Hobbes (Member # 433) on :
 
Why not Fugu? I've actually done this before and got it to work...

Hobbes [Smile]
 
Posted by Annie (Member # 295) on :
 
I tried that Hobbesy (or something really similar) and that's what opened Mail.
 
Posted by fugu13 (Member # 2859) on :
 
She wants it to mail it directly, not open up a mail, which she said she could already get it to do.
 
Posted by Hobbes (Member # 433) on :
 
Well that's really odd, I've gotten this to work before... I'm going to go find my notes.

Hobbes [Smile]
 
Posted by TMedina (Member # 6649) on :
 
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
 
Posted by fugu13 (Member # 2859) on :
 
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).
 
Posted by fugu13 (Member # 2859) on :
 
The formmail script I pointed you at will do anything you need to do.
 
Posted by Hobbes (Member # 433) on :
 
Ohh, it was a while ago I did this...

Hobbes [Smile]
 
Posted by Annie (Member # 295) on :
 
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.
 
Posted by Annie (Member # 295) on :
 
By the way, Hatrack boys ROCK.
 
Posted by TMedina (Member # 6649) on :
 
I'm an idiot...ok...trying plan B.

-Trevor
 
Posted by TMedina (Member # 6649) on :
 
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
 
Posted by fugu13 (Member # 2859) on :
 
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.
 
Posted by Nato (Member # 1448) on :
 
Isn't http://www.sacajaweagallery.com/information.html the link to the form?

That looks like a useful script, fugu.
 
Posted by fugu13 (Member # 2859) on :
 
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 ]
 
Posted by fugu13 (Member # 2859) on :
 
*bump*
 
Posted by Annie (Member # 295) on :
 
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]
 
Posted by Annie (Member # 295) on :
 
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 ]
 
Posted by fallow (Member # 6268) on :
 
too good. just a hair. breadth's.

night.

enjoy.

[Razz]
 


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