if(!CModule::IncludeModule("iblock")) return;
$ID_PRODUCT = intval($_REQUEST['prod_id']);
$NAME = $ID_PRODUCT;
$ID_USER = $USER->GetID();
$TEXT = $_REQUEST['txt'];
$IBLOCK_ID = $_REQUEST['iblock_id'];
$arPROPS = Array(
"ID_PRODUCT" => $ID_PRODUCT,
"ID_USER" => $ID_USER,
"TEXT" => $TEXT,
);
$arFields = Array(
"IBLOCK_ID"=>$IBLOCK_ID,
"NAME"=>$NAME,
"PROPERTY_VALUES" => $arPROPS,
);
print_r ($arFields);
$e = new CIBlockElement;
if (!$e->Add($arFields)) {
echo "Error: ".$e->LAST_ERROR;
} |