View Full Version : customizing a formmail script

10-30-2007, 09: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.



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

10-31-2007, 01: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

10-31-2007, 01: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");
} 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";
}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!

10-31-2007, 01:44 AM
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">

10-31-2007, 04:36 AM
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