I am trying to make a simple form and learn how to use them. I made a testing module called Form Practice and created the formpractice.module and the formpractice.info files. Here is the formpractice.module code:

function formpractice_perm() { //set the permissions
  return array('access formpractice content');
}

function formpractice_menu() {
  $items = array();
  $items['Practice Form'] = array(
    'title' => 'Practice Form',
    'page callback' => 'formpractice_test',
	'access arguments' => array('access formpractice content'),
    'type' => MENU_NORMAL_ITEM,
);
 return $items;
}

function formpractice_test() {
return drupal_get_form('test_form');
}

function test_form() {
$form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#size' => 30,
    '#maxlength' => 64,
    '#description' => t('Enter the name for this group of settings'),
  );
return $form;
}

and here is the formpractice.info code:

; $Id$
name = "Form Practice"
description = "I'm just trying to make a form!"
core = 6.x
php = 5.1

When I install and click on the menu link, I get a white page and then an error message on the front page that says:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'page' was given in /home3/silverho/public_html/php/includes/menu.inc on line 348.

Any help would be greatly appreciated!
Thank you!
Dan Silver

Comments

Dan Silver’s picture

I just cleared the sites cache and the form is now visible.
Feeling stupid...