In DG had this to say:
My reply is at the bottom of your sent message:
We are just setting the page up, it isn't online yet. I was using
Word to create our pages and I found the "Web Tools" toolbar. Since
it had form fill buttons, submit, reset, etc., I assumed there would
be a way to use these on a web page. This is our first attempt at a
web page and I see we have a lot to learn. I'll start with the ISP we
plan to use for hosting. Thanks so much for your reply.
Not a problem but look out for folks who will charge you for something so
simple. You can actually BUY scripts that do this for you. Personally I
think that's pretty silly... It looks hard but it's actually either really
easy or free.
If you'd like you can just have mine?
Here's the simplest version:
http://kgiii.info/email_gxgxg.html
So if that's what you're looking for I'll just code you one based on mine.
It uses straight PHP sendmail() function and is VERY basic to edit... (You
can even send me a message through there if you absolutely wanted to test it
but please don't send me too many.)
If you wanted to be fancier with it - believe it or not this is the "same"
script with just about 2 minutes worth of editing:
http://www.whathostingshould.be/order/order.html
You can test that one but PLEASE not too many times.
That is - in all
actuality - the same script that runs it...
The HTML is right there on the page (right click > view source) and here:
I'll comment it some... You'll need to keep it pretty secure so we're only
going to let results be parsed from one header/page...
You'll need a thank you page... (I'll leave my links in there. I did remove
the email.)
You'll need an error page....
***************** Copy below - not this ****************
<?
/*
Order Form
*/
// ------------- FEEL FREE TO ALTER THE STUFF BEGINNING WITH $ (leave the $
though) ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "(e-mail address removed)" ;
$mailto = '(e-mail address removed)' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Your Feedback Form" ;
$subject = "Order Form" ;
// the three page pages to be displayed, eg
//$formurl = "
http://example.com/feedback.html" ;
//$errorurl = "
http://example.com/error.html" ;
//$thankyouurl = "
http://example.com/thankyou.html" ;
$formurl = "
http://whathostingshould.be/order/order.html" ;
$errorurl = "
http://whathostingshould.be/order/ordererror.html" ;
$thankyouurl = "
http://whathostingshould.be/order/ordercomplete.html" ;
// -------------------- EDIT BELOW ONLY IF YOU KNOW WHAT YOU'RE
DOING ---------------
$name = $_POST['name'] ;
$address = $_POST['address'] ;
$city = $_POST['city'] ;
$state = $_POST['state'] ;
$zipcode = $_POST['zipcode'] ;
$phone = $_POST['phone'] ;
$email = $_POST['email'] ;
$plan = $_POST['plan'] ;
$domain = $_POST['domain'] ;
$transaction = $_POST['transaction'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($address) || empty($city) ||
empty($state) || empty($zipcode) || empty($phone) || empty ($plan) ||
empty($domain) || empty($transaction)) {
header( "Location: $errorurl" );
exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"Name: $name\n" .
"Address: $address\n" .
"City: $city\n" .
"State: $state\n" .
"Zip/Postal: $zipcode\n" .
"Phone: $phone\n" .
"Email: $email\n" .
"Plan: $plan\n" .
"Domain: $domain\n" .
"Transaction Number: $transaction\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\"
<$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php
2.04" );
header( "Location: $thankyouurl" );
exit ;
?>
***************** Copy Above this line - don't copy this *****************
Rename that <something>.php
Here's the HTML code....
****************************************************************
<center>
<b><u>FILL IN ALL FIELDS</u></b>
<form action="order.php" method="post">
<table cellspacing="8" summary="order form">
<tr><td>Name:</td><td><input type="text" name="name" size="25"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"
size="25"></td></tr>
<tr><td>City:</td><td><input type="text" name="city" size="25"></td></tr>
<tr><td>State:</td><td><input type="text" name="state" size="25"></td></tr>
<tr><td>Country:</td><td><input type="text" name="country"
size="25"></td></tr>
<tr><td>Zip/Postal Code:</td><td><input type="text" name="zipcode"
size="25"></td></tr>
<tr><td>Phone Number:</td><td><input type="text" name="phone"
size="25"></td></tr>
<tr><td>Domain name:</td><td><input type="text" name="domain"
size="25"></td></tr>
<tr><td>Contact Email address:<font color="#cc0033">*</font></td><td><input
type="text" name="email" size="25"></td></tr>
<tr><td>Plan Ordered:</td><td><input type="text" name="plan"
size="25"></td></tr>
<tr><td>Transaction Number:</td><td><input type="text" name="transaction"
size="25"></td></tr>
<tr>
<td colspan="2">
Additional Comments:<br>
<textarea rows="5" cols="45" name="comments">
</textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<p>By submitting this order you agree abide by the terms of service.</p>
<input type="reset" value=" Reset Form " class="button"> <input
type="submit" value="Place Order" class="button"><br>
</td>
</tr>
</table><p>
<font color="#cc0033">*</font>Please avoid using an email address that will
reside on the server. That way if we need to contact you when there's an
issue with the server we will still be able to do so.</p>
</form>
</center>
***********************************************************
You can play with it quite a bit. You can change fonts, fields, etc. 3rd
line down - see the line with order.php? Whatever you named the first file
you'd simply change the order.php to reflect that - say contact.php for
example. If it was on an alternate page (let's say it - the contact.php was
in public_html/contact/script/contact.php for this one) and you were all the
way over in public_html/my_products/about_us/ and you wanted to only have to
upload it once then you'd use "./../script/contact.php" or
".../script/contact.php" though I think it's the first and not the latter.
Personally I'd just use the contact as a link and send them to the form
itself rather than replicate it all over the place.
Now if you go back to the PHP...
Look for the "if (empty($foo) ||" values..
Scroll down and look at the same value...
Scroll down again and look at the same value...
The first one says - you gotta fill everything in.
The second one says what it's going to do with it - it's going to POST it
(send it) basically.
The third one says how (and where) it's going to include it in the email you
get.
If you don't want to have ALL those fields you'd kill the "if (empty($foo)
||" value.
You *can* leave the rest of them but don't bother - it's just going to make
a CPU cycle but PHP is pretty capable of dealing with silliness and
shouldn't throw any errors that either you or the end-user will see.
Never alter the script to include a blank email address... SPAMers will find
it and be all over it.
Last, but not least, edit the above in a true text editor like Notepad.
Don't do it in Word or WordPad. JUST a true text editor.
I don't dare spell check this.
--
Galen - MS MVP - Windows (Shell/User & IE)
http://dts-l.org/
http://kgiii.info/
"At present I am, as you know, fairly busy, but I propose to devote my
declining years to the composition of a textbook which shall focus the
whole art of detection into one volume." - Sherlock Holmes