(!) $error[$fieldname]"; } } function form_select_create($fieldname) { global $OPTIONS, $DEFAULT_OPTION, $_GET_POST; return form_select($fieldname, @$_GET_POST[$fieldname], array_merge($DEFAULT_OPTION, $OPTIONS[$fieldname])) . signal_if_error($fieldname); } if (form_text_submitted("ok")) { $node = new Node(); $_POST['name'] = strtolower($_POST['name']); $node->feed_hash($_POST); // hack : default value (choose) $node->set('birth_date', implode('-', array( $_POST['birth_date_year'] , $_POST['birth_date_month'], $_POST['birth_date_day'] ))); $error = $node->isNotValid(); if ($_POST['birth_date_month'] == 0) $error['birth_date'] = "You need to select a month."; else if ($_POST['birth_date_day'] == 0) $error['birth_date'] = "You need to select a day."; if (!empty($_POST['email'])) if (preg_match("/\w+@\w+/", $_POST['email']) == 0) $error['email'] = "Email is not valid"; if (!$error) { // Save it. $node->save(); // Send email. $message = print_r2($_POST, true); $message .= "
(english version)"; @mail(EMAIL_WEBMASTER, "CHARACTERS: New entry", $message); $redirect = "node.php?id=" . $node->get('id'); if ($_POST['tour'] == 1) $redirect .= "&tour=2"; header("Location: $redirect"); } } else if (form_text_submitted("cancel")) { header("Location: dictionary.php"); } if ($_GET_POST['tour'] == 1) $inTour = true ?> : ADD YOURSELF
 

Fill the form and click √ ok.

There are errors (!) in your submission, please check it.

 :