How to add a contact form in a page

Here is my sample code which I made from http://kinse.net/contact_us
<?php
require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';
//no need to maintain two version of node.tpl.php
//include "node.tpl.php";
function local_contact_page(){
$form = contact_mail_page();
// override default values here if you want
// next one will select a different category
//$form['cid']['#default_value'] = 0;
return($form);
}


function local_contact_page_submit($form_id, $form_values){
return(contact_mail_page_submit($form_id, $form_values));
}

function local_contact_page_validate($form, $form_state){
return(contact_mail_page_validate($form, $form_state));
}
?>

Welcome to KINSE Systems Website

<?php print t('Contact Us'); ?>



<?php // here we will render the contact form
print drupal_get_form('local_contact_page'); ?>

0 comments:

Post a Comment