Current time: 04-20-2014, 01:14 AM Hello There, Guest! (LoginRegister)

Post Reply 
Where to put PHP file?
03-03-2008, 05:03 PM
Post: #11
Where to put PHP file?
Quote:We basically needed to use the contact forms for 2 reasons: Mailing List signups and Guestlist signups for events.
You might consider, given the DreamHost Anti-spam policy and the Terms of Service, using the DreamHost Announcement lists for "mailing list sign-ups". The formmail script will *not* provide you with the audit trail you need to be compliant with those policies (the confirmed opt-in requirement and the date, time, email address, and IP address of the sign up and the confirmation). In fact. you can even use that Announcement list feature for your event sign-ups too! )and have a better audit trail!)

That said, the formmail script will also work fine though for your event signups (though using the announcement list "formmail style variation" will give you more information about the submission!). Smile
Quote:I was wondering though in your experience, does the DreamHost script allow for either an option for a Drop-Down choice or a Check Box option instead of a text box? Just curious, I will look into it more though the Wiki.
Sure! You can use any html form features you wish for collecting the data, and any data not passed as on of the "required" or "defined" variables will be sent along in the email (the wiki and the formmail page explains better how all that works).

You may want to check out an html form tutorial for a better understanding of how to create a form (or even use the "form" that was created by the "generator", but link it to the DreamHost formmail in the "action" attribute of the "form" tag as instructed in the DH formmail documentation).

--rlparker
Find all posts by this user
Quote this message in a reply
03-03-2008, 05:26 PM
Post: #12
Where to put PHP file?
THANK YOU SO MUCH!!!

I used the form but linked the "action" to DH and it works perfectly!!!

Thank you for your help, I learned so much today!
Find all posts by this user
Quote this message in a reply
03-03-2008, 05:42 PM
Post: #13
Where to put PHP file?
I'm sorry, one quick question. There is a pre-made Form on the template that I am using. I used the DH <form action> and <input type> but for some reason its not working?

<form id="form" action="" enctype="multipart/form-data" name="form">
<form action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" method="POST">
<input type="hidden" name="recipient" value="info">

<div class="form_left">
<div class="row"><input type="text" class="input" value="name" /></div>
<div class="row"><input type="text" class="input" value="e-mail" /></div>
<div class="row"><input type="text" class="input" value="phone" /></div>
</div>
<div class="form_right">
<textarea cols="1" rows="1" class="textarea">message</textarea><br />
<div>
<a href="#" class="more" onclick="document.getElementById('form').reset()">clear</a>      
<a href="#" class="more" onclick="document.getElementById('form').submit()">send</a>
</div>
</div>
<div class="clear"></div>
</form>

How did I mess this one up??
Find all posts by this user
Quote this message in a reply
03-03-2008, 05:50 PM
Post: #14
Where to put PHP file?
Quote:I'm sorry, one quick question. There is a pre-made Form on the template that I am using. I used the DH <form action> and <input type> but for some reason its not working?
You have *two* <form> starting tags:
Quote:<form id="form" action="" enctype="multipart/form-data" name="form">
<form action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" method="POST">
... and the *first* <form .... > starting tag has a "blank" action attribute. Just eliminate the first line, and you should be fine.

You also should not need (or use) the:

<a href="#" class="more" onclick="document.getElementById('form').reset()">clear</a>
<a href="#" class="more" onclick="document.getElementById('form').submit()">send</a>

stuff unless you have that class defined ... you can just use the DreamHost recommended:

<input type="submit" value="Send">

... in it's place. Wink

--rlparker
Find all posts by this user
Quote this message in a reply
03-03-2008, 06:01 PM
Post: #15
Where to put PHP file?
Hmm...okay I removed the first line but when I clicked Submit, nothing happens?
Find all posts by this user
Quote this message in a reply
03-03-2008, 06:23 PM
Post: #16
Where to put PHP file?
Quote:Hmm...okay I removed the first line but when I clicked Submit, nothing happens?
Yeah .. sorry about that. I stopped when I found the first issue ... and there is another issue further on down the form. I edited my last post to reflect that, so you can check there for additional instructions.

Essentially, what you need to do is "merge" your "generated" form with the instructions on the DreamHost wiki ... get rid of those existing submit and reset lines of code, relpacing them with the code in the DreamHost example, and it should work.

Be patient, however, before assuming it doesn't work if you don't get the email immediately when testing .. I have found there there is often a delay in sending/receiving formmail using DreamHost (I think it is queued on the server and sent in batches).

You can also study up a bit more on the DreamHost formmail, and route the user to a special "thank you page" if you wish.

--rlparker
Find all posts by this user
Quote this message in a reply
03-03-2008, 06:46 PM
Post: #17
Where to put PHP file?
Thank you. So after the changes, the form will send to the email, but its not showing any of the fields in the email (name, email, etc). Should I just change everything to how DH is set up?
Find all posts by this user
Quote this message in a reply
03-03-2008, 06:53 PM
Post: #18
Where to put PHP file?
It's not showing the field names or the field contents?

--rlparker
Find all posts by this user
Quote this message in a reply
03-03-2008, 06:59 PM
Post: #19
Where to put PHP file?
The field contents. For example I filled in my name, email, etc but in the email I received none of those were visible?
Find all posts by this user
Quote this message in a reply
03-03-2008, 07:11 PM
Post: #20
Where to put PHP file?
Ok .... let me look at your form a little more closely, and I'll post back.

--rlparker
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: