posted
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 |
posted
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.
posted
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 |
posted
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 |
posted
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.
posted
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 |
posted
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).
<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:
posted
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.
Posts: 8504 | Registered: Aug 1999
| IP: Logged |
posted
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: