To create a PHP form for a website hosted with GoDaddy:
- Create your form as normal where you want it in your site (sidebar, page, …no matter). Be sure to use unique names for your form items.
*NOTE: “Keep in mind that our form-mailer script will sort the names of your form items alphabetically when it composes the email message. This is the order of precedence: uppercase letters, lowercase letters, numbers.” – Go Daddy
- Choose the type of form you want to use that is provided with your hosting account. These are already in your hosting space (look in the root folder remote view). You have two choices: gdform.php or webformmailer.php. What is the difference?
- If you’re using gdform.php (as found hereon GoDaddy):
- WARNING: The file gdform.php cannot be recovered if it’s deleted.
- In your form tag, enter “/gdform.php” as the action and “post” as the method so it reads
<form action=”/gdform.php” method=”post”>
*NOTE: You do not need to reference the file with the domain name to help it find gdform.php, but it might help in some cases.
- In addition to the fields you create in your form, there are three special fields that you can use: subject, redirect, and email.
Subject Controls the subject line in the form email.
<input type=”hidden” name=”subject” value=”Form Submission” />
Redirect Controls the page that your visitors will see after they submit the form.
<input type=”hidden” name=”redirect” value=”thankyou.html” />
Email Controls the return address for the form email.
<input type=”text” name=”email” />
- If you’re using webformmailer.php, (as found here on GoDaddy):
*NOTE:”webformmailer.php is for use with accounts running Hosting Configuration 2.0 and above, only.” -Go Daddy
- In your form tag, enter “/webformmailer.php” as the action and “post” as the method so it reads
<form action=”/webformmailer.php” method=”post”>
- In addition to the form fields you create in your form, there are three hidden elements you can use.
form_format determines in what format the information is delivered. Its values are ‘text’, ‘csv’, ‘html’, ‘xml’, and ‘default’ (same as ‘text’).
<input type=”hidden” name=”form_format” value=”html”/>
form_order dictates in what order the fields are reported. Its values are ‘default’ (the same order as they appear on in the form), ‘alpha’ (alphabetized by field name) or a comma-separated, case-sensitive list of all or some field names.
<input type=”hidden” name=”form_order” value=”alpha”/>
form_delivery determines the frequency and packaging of delivery. All form submissions are sent via an attachment. You can specify the form_delivery variables as one of the following: ‘digest’, ‘hourly_digest’, and ‘daily_digest’.
<input type=”hidden” name=”form_delivery” value=”hourly_digest”/>
- Don’t forget the submit button.
<input type=”submit” name=”submit” value=”submit”/>
- Save your file.
- Upload your file into your hosting account.
- You’re not done yet.
- You also need to specify an email address for the PHP Form-Mailer to send to, even if you have already assigned a recipient in your form. It is recommended that you make a comment of this crucial step in your form somewhere in case you ever need to update where the form is being delivered to. It would also be helpful to make a note of the most up to date email listed in GoDaddy near this comment.
- To specify the email address for the Form-Mailer you have created (as found hereon GoDaddy):
- Log into your Account Manager (using your GoDaddy login information).
- From the Products section, click Web Hosting.
- Next to the hosting account you want to use, click Launch.
- In the Content secion of the Hosting Control Center, click the Form Mail icon/button.
- In the Forms Email Address section, type the email address you want your form to send to.
- Click Continue.
- Verify the [new] email address and click Update.
- Test your email form from every page it is seen on your site to make sure you have changed it all correctly.
*NOTE: In one of your blanks (like name for example) type in the name of the page you are testing the form from so you can easily tell which work and which are not coming through. If you make additional changes to your form, type a little note to yourself to help you remember what change(s) you are testing rather than just using arbitrary comments like “I really hope you work this time.”
- Additional help can also be found here for instructions about webformmailer.asp, gdform.php, or gdform.asp.