убрать:
$recepient = $_POST['recepient'];
...
if (isset($_GET['recepient'])) {
$recepient = $_GET['recepient'];
$query = query("SELECT * FROM test WHERE `recepient` = '$recepient' ORDER BY ID DESC");
while ($row = mysqli_fetch_assoc($query)) {
echo $row['id']."| ".$row['recepient']." | ".$row['msg']."<br>";
}
} else {
и замыкающую }
Заменить
query("INSERT INTO test (`id`, `recepient`, `msg`) VALUES (NULL, '$recepient', '$msgs_array[$i]')");
на
query("INSERT INTO test (`id`, `msg`) VALUES (NULL, '$msgs_array[$i]')");
и
echo $row['id']."| <a href=\"receiver.php?recepient=".$row['recepient']."\">".$row['recepient']."</a> | ".$row['msg']."<br>";
на
echo $row['id']." | ".$row['msg']."<br>";
Как вариант.