17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1667 Views |
-
Email workaround

1 March 2007 at 3:59am
Had to get a site up and use a contact field:
Its not a beauty but it worksclass ContactPage_Controller extends Page_Controller {
function Form() {
return new Form($this, "Form", new FieldSet(
// List the your fields here
new TextField("FullName", "FullName"),
new EmailField("Email", "Email address"),
new TextField("Telephone", "Telephone"),
new TextField("Address", "Address"),
new TextField("Postcode", "Postcode"),
new TextField("Country", "Country"),
new TextField("Comments", "Comments")
), new FieldSet(
// List the action buttons here
new FormAction("doform", "Send")), new RequiredFields(
// "FullName","Email"// List the required fields here: "Email", "FirstName"
));
}
function doform($data, $form) {mail ('your@domain.tld','new contactform Entry', "
Fullname: $data[FullName]
Email: $data
Telephone: $data[Telephone]
Address: $data[Address]
Postcode: $data[Postcode]
Country: $data[Country]
Comments: $data[Comments]");
// Redirect to a page thanking people for emailing
Director::redirect('thanks-for-emailing/');
}
} -
Re: Email workaround

15 March 2007 at 9:27pm
Hey would love to see the site URL in showcase sites forum if you're happy to show it off
| 1667 Views | ||
|
Page:
1
|
Go to Top |


