Hello. Tell me, please, I can’t catch anything because of what the 500 error gets out when sending the form. It comes out when adding such a piece of code to the handler:

if ($id == 'calculator' && !empty($_POST['calculator-data'])) { $out = "\n"; parse_str($_POST['calculator-data'], $calculatorData); foreach ($calculatorData as $index => $params) { $out .= $params['title']. "\n"; $out .= "--------------------------------------\n"; unset($params['title']); foreach ($params as $name => $value) { $out .= "\t" . strip_tags($value) . "\n"; } $out .= "\n"; } $data['windows'] = $out; } 
  • one
    open error_log on the server (if there is an apache) and see what is there. Most likely, there will be warnings indicating the line number. - KoVadim
  • error_log I have not found on the hosting. I wrote to them, maybe they will answer. And maybe some other info is needed to solve the problem? - Batyabest 5:53 pm

1 answer 1

Do you write using framework / CMS? If so, then maybe the system catches errors (even fatal) and logs them into its own log, showing the server error.

Take a good look at your code.

 $id == 'calculator' 

Do you have $id somewhere declared? Otherwise:

 if (isset($id) && $id == 'calculator' && !empty($_POST['calculator-data'])) { ... } 

Further, I am confused:

 parse_str($_POST['calculator-data'], $calculatorData); 

Because the result is given by reference, it is necessary to pre-declare a variable, namely:

 $calculatorData = array(); parse_str($_POST['calculator-data'], $calculatorData); 
  • Soooo, thanks, we'll see - Batyabest
  • Any miracles. Today opened, nothing rules, everything works, no errors come out. - Batyabest
  • @romeo, there is no need to declare a variable. Since at the moment of transmission it is null , its value will be overwritten to the result, but at the same time it already exists at the moment when it is written - stck
  • @stck you are right. I array_shift with array_shift , array_pop , ..., where, in fact, this trick will not work. - romeo