SQL ERROR [ mysql4 ] Column 'forum_id' cannot be null [1048]"
Код: Выделить всё
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
global $phpEx;
$phpEx = 'php';
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
define("IN_PHPBB", true);
$phpbb_root_path = dirname(__FILE__) . "/../forum/";
include($phpbb_root_path . "common.php");
include($phpbb_root_path . "includes/functions_posting.php");
include($phpbb_root_path . "includes/message_parser.php");
$name = $_POST["name"];
$age = $_POST["age"];
$feedback = $_POST["feedback"];
// ...
$msg = "Имя: $name\r\n"; // Переменные для формы
$msg .= "Возраст: $age\r\n";
$msg .= "Связь: $feedback\r\n";
// ...
$generated_msg = generate_text_for_storage($msg, $uid, $bitfield, $flags);
echo "6000";
$post_data = array(
// General Posting Settings
"forum_id" => 21, // The forum ID in which the post will be placed. (int)
"topic_id" => 20, // Post a new topic or in an existing one? Set to 0 to create a new one, if not, specify your topic ID here instead.
"icon_id" => false, // The Icon ID in which the post will be displayed with on the viewforum, set to false for icon_id. (int)
// Defining Post Options
"enable_bbcode" => false, // Enable BBcode in this post. (bool)
"enable_smilies" => false, // Enabe smilies in this post. (bool)
"enable_urls" => true, // Enable self-parsing URL links in this post. (bool)
"enable_sig" => false, // Enable the signature of the poster to be displayed in the post. (bool)
// Message Body
"message" => $generated_msg, // Your text you wish to have submitted. It should pass through generate_text_for_storage() before this. (string)
"message_md5" => md5($generated_msg), // The md5 hash of your message
// Values from generate_text_for_storage()
"bbcode_bitfield" => $bitfield, // Value created from the generate_text_for_storage() function.
"bbcode_uid" => $uid, // Value created from the generate_text_for_storage() function.
// Other Options
"post_edit_locked" => 0, // Disallow post editing? 1 = Yes, 0 = No
"topic_title" => $subject, // Subject/Title of the topic. (string)
// Email Notification Settings
"notify_set" => false, // (bool)
"notify" => false, // (bool)
"post_time" => 0, // Set a specific time, use 0 to let submit_post() take care of getting the proper time (int)
"forum_name" => "", // For identifying the name of the forum in a notification email. (string)
// Indexing
"enable_indexing" => true, // Allow indexing the post? (bool)
// 3.0.6
"force_approved_state" => true, // Allow the post to be submitted without going into unapproved queue
// 3.1-dev, overwrites force_approve_state
"force_visibility" => true, // Allow the post to be submitted without going into unapproved queue, or make it be deleted
);
subject = "$nick ($name, $age)";
submit_post ("post", $subject, $nick, POST_NORMAL, $poll, $data);
exit;

