What happens when someone fills in a contact form on a website?

I am trying to debug a problem on a website I am working on. The contact form doesn’t work. In my quest to find answers it occurred to me that I don’t even actually know what’s going on in the background in order to understand the sites that I’m reading for help!

So basically my question is: what happens when someone submits a form on a website?

I see that my hosting company has provided me a mail box with some arbitrary email address where the form submission gets returned to when it fails. Why? Do all form submissions actually come from this email address? What does PHP or SMTP have to do with this?

Fills inputs of form with data

 function fillFormInputs(data) {       $  ('input[name="name"]').val(data.name);       $  ('input[name="surname"]').val(data.surname);       $  ('input[name="patronymic"]').val(data.patronymic);       $  ('input[name="email"]').val(data.email);       $  ('input[name="skype"]').val(data.skype);       $  ('input[name="icq"]').val(data.icq);       $  ('input[name="homeAddress"]').val(data.homeAddress);       $  ('input[name="additionalInfo"]').val(data.additionalInfo);       $  ('input[name="birthday"]').val(dateInISOFormat(new Date(data.birthday)));       for (var i = 0; i < data.phones.length; i++) {         var phone = data.phones[i];         insertPhoneNumber(phone.number, phone.type);       }       $  ("img:first").attr("src", "data:image/png;base64, " + data.image.content);     } 

Data it is planeObject. Method works fine, but can i rewrite this simpler?

Growing a chain of unit-area triangles: Fills the plane?

Define a process to start with a unit-area equilateral triangle, and at each step glue on another unit-area triangle.


          n50
          $ 50$ triangles.


Above, the red dot marks the starting triangle $ T_0$ . Then on one edge $ e$ of $ T_0$ , a point $ p$ is chosen to form a unit-area triangle $ T_1$ . Now there are two edges of $ T_1$ for possible growth. One edge is chosen randomly, and another unit-area triangle $ T_2$ is erected on that edge. Then $ T_3$ is built on an edge of $ T_2$ . And so on.

The point $ p$ at each step is chosen according to a normal distribution $ \cal N(0,1)$ centered on the midpoint normal vector to $ e$ , as illustrated below:


          Tri_Normal
          The location of $ p$ follows a normal distribution.


My question is:

Q. Does this process fill the plane in the limit?

I think Yes but am not certain.

Here are two more examples (using different random seeds):


          n500
          $ 500$ triangles.


          n1000
          $ 1000$ triangles.


How to delete logs automatically after a certain time and restart the process that fills up the log file?

Server is Ubuntu 16.04. I have a process running with nohup that logs into a local file. This file gets big enough to consume 100% disk space. To resolve this I have to kill the process first and then remove the log file. Then i restart the process. How can i resolve this with a script or some other tool?

When i press edit, it will not automatically fills the input text from the table

on the index.php there link edit, when i press edit it should be redirect to edit.php and fill the form automatically based on row i pressed edit, but it wont fill based on the table

index.php

 <?php   $  tampil="SELECT * FROM obat";  $  result=mysqli_query($  conn,$  tampil);  if(mysqli_num_rows($  result)){     while ($  row=mysqli_fetch_assoc($  result)) {     ?>     <tr>        <td><?=$  row['id_obat']?></td>        <td><?=$  row['namaObat']?></td>        <td><?=$  row['jenisObat']?></td>        <td><?=$  row['stok']?></td>        <td><a class="btn btn-success" href="edit.php">Edit</a>            <a class="btn btn-danger" href="">Delete</a>            </td>     </tr>     <?php     }      } ?> 

edit.php

<?php      include('config.php');          $  id_obat = 'id_obat';         $  namaObat = 'namaObat';         $  jenisObat = 'jenisObat';         $  stok = 'stok';          if (isset($  _GET['id_obat'])) {             $  sql="SELECT * FROM obat WHERE id_obat=$  id_obat";             $  result=mysqli_query($  conn,$  sql);             $  row=mysqli_fetch_assoc($  result);         }         ?>         <form method="POST" action="edit.php">           <div>             <label>Nama Obat</label>             <input type="text" class="form-control" name="namaObat" value="<?=$  namaObat?>">         </form>