A
A
Anton2017-08-26 02:11:10
1C-Bitrix
Anton, 2017-08-26 02:11:10

How to make a form to send data to the server?

<?

$el = new CIBlockElement;

$PROP = array();
$PROP['FIO'] = "Михаил"; 
$PROP['MAIL'] = "[email protected]";     
$PROP['PHONE'] = "87654376"; 
$PROP['TIME'] = "11.00";  
$arLoadProductArray = Array(
  'IBLOCK_ID'      => 34,
  'PROPERTY_VALUES'=> $PROP,//Должны быть указаны ВСЕ свойства, не указаные БУДУТ ЗАТЕРТЫ.
  'NAME'           => ConvertTimeStamp($linuxTimeStamp,'FULL'),
  'ACTIVE'         => 'Y',     
  'DATE_ACTIVE_FROM'    => ConvertTimeStamp($linuxTimeStamp,'FULL'),       
  );

if ($PRODUCT_ID) { //Обновим элемент
    if (!$res = $el->Update($PRODUCT_ID, $arLoadProductArray)){
        echo "Error: ".$el->LAST_ERROR;
    }
} else { //Добавим элемент
    if (!$PRODUCT_ID = $el->Add($arLoadProductArray)){
        echo "Error: ".$el->LAST_ERROR;
    }
}
?>

How can I attach a form to this code to fill in the fields and a submit button?
If it's not difficult to sketch a skeleton, you can do it without styles
Input fields are required
$PROP['FIO'] = "Mikhail";
$PROP['MAIL'] = "[email protected]";
$PROP['PHONE'] = "87654376";
$PROP['TIME'] = "11.00";

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question