H
H
Hiroshima2021-03-28 15:58:25
PHP
Hiroshima, 2021-03-28 15:58:25

How will this php code be implemented on node.js?

Good day, please help me translate this code into node.js:

<?php
$output ='';
if (isset($_POST['nameUser'])) {
  $name = $_POST['nameUser'];
  $output .= 'Здравствуйте, '.$name.'! ';
  if ($_SERVER['REMOTE_ADDR']) {
    $output .= 'Ваш IP адрес: '. $_SERVER['REMOTE_ADDR'];
  }
  else {
   $output .= 'Ваш IP адрес неизвестен.';
  }
  echo $output;
}

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