<?php
return drupal_get_form('test_form');
function test_form() {
$text = 'Have something you want to say to the DJ? Want to request a song or dedication? Send the current DJ a message by filling out this form!';
$form['access'] = array(
'#type' => 'fieldset',
'#title' => t('DJ Instant Request'),
'#tree' => TRUE,
'#description' => $text,
);
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#size' => 30,
'#maxlength' => 64,
'#description' => t('Enter your name here'),
);
$form['content'] = array(
'#type' => 'textarea',
'#title' => t('Request'),
'#description' => t('Enter your request here'),
);
$form['hidden'] = array('#type' => 'value', '#value' => 'is_it_here');
$form['submit'] = array('#type' => 'submit', '#value' => t('Send to DJ'), '#id' => 'submitedit' );
return $form;
}
function test_page() {
return drupal_get_form('test_form');
}
function test_form_validate($form_id, $form_values) {
}
function test_form_submit($form_id, $form_values) {
global $user;
$thetime = time();
$name = mysql_escape_string($form_values['name']);
$content = mysql_escape_string($form_values['content']);
db_query("INSERT INTO new_bhack_requests (time, ip, request_name, content, type) VALUES ('".$thetime."','".$_SERVER['REMOTE_ADDR']."','".$name."','".$content."', '1')");
drupal_set_message(t('Thanks for your request!'));
}
?>


