PDA

View Full Version : customizing a formmail script


dsnyder
10-30-2007, 10:56 PM
Could anyone give me guidance on customizing a formmail script?

I’d like to:
Change the text of the ‘submit query’ button to ‘send’. I don’t see where the button is coming from. Can I create my own button design to use?
Adjust the length of the ‘email address’ & ‘phone number’ boxes to match the ‘message’ box? Do I set the number of character someplace?
Make some of the field required but not all. Right now all are required.
Remove the line above ‘This form is powered by Jack's Formmail.php! (http://www.dtheatre.com/scripts/)’I assume that I can alter this in the Jack’s script but I’m not seeing it.


http://cellocelli.com/Formmail/contactderek.html

Thanks!



php script: (don't know how to post is as it's ridiculously long. Is there a better way to do this?!) the link won't let you see the code
http://cellocelli.com/Formmail/formmail.php

edbr
10-31-2007, 02:07 AM
the button is part of your form, where formmail is the file that handles the sending so you can change send in your page where the form is.
same with the size of the text /message boxes on that page (contact derek page not in the formail script)
If I remember you make required fields by adding a hidden field in your form
<input type="hidden" name="require" value="email" />as for the mention of jacks script at the end of the script look for
echo "<small>This form is powered by <a href=\"http://www.dtheatre.com/scripts/\">Jack's Formmail.php ".VERSION."!</a></small>\n\n";
but why not give him a link back it is his work after all

dsnyder
10-31-2007, 02:21 AM
but why not give him a link back it is his work after allI totally plan on keeping the link. I just don't necessarily want the line that appears above it and I'm not sure what the line is attached to.

This seems to be the code
// if the redirect option is set: redirect them
if ($redirect) {
header("Location: $redirect");
exit;
} else {
echo "Thank you for your submission\n";
echo "<br><br>\n";
echo "<small>This form is powered by <a href=\"http://www.dtheatre.com/scripts/\">Jack's Formmail.php ".VERSION."!</a></small>\n\n";
exit;
}I notice the $redirect. I assume that this how I tell it where to go after the form is sent? How would I tell it to go to the index page? www.cellocelli.com (http://www.cellocelli.com)


ps thanks for the help!

dsnyder
10-31-2007, 02:44 AM
OK
found the line. I had an <hr> in my HTML. Removed it and line disappeared.
Required field: this is in the top part of my HTML<form method="post" enctype="multipart/form-data" action="formmail.php">
<input type="hidden" name="require" value="email,phone_no">
<input type="hidden" name="recipient" value="your@email.com">
<input type="hidden" name="sort" value="alphabetic">
<input type="hidden" name="ar_file" value="/www/formmail_path/autoresponder.txt">
<input type="hidden" name="ar_subject" value="Thank you for your interest!">
<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
If I don't want to require the phone # do I do this?
<input type="hidden" value="phone_no">

edbr
10-31-2007, 05:36 AM
http://www.dtheatre.com/scripts/formmail_doc.php
the docs for formmail

from those docs
To choose the URL they will end up at:
<input type=hidden name="redirect" value="http://your.host.com/to/ file.html">
again add it to the form