Answer the question
In order to leave comments, you need to log in
GET Requests how to get a single user's message?
there is a message of users who go post method
<table class="table w-100" border="1">
<thead class="thead-dark">
<th>Sender Name</th>
<th>Message</th>
<th>Has been sent</th>
<!-- <th>Time</th> -->
</thead>
<?php foreach($mass as $item){ ?>
<?php
$d = date_default_timezone_set("Asia/Yerevan");
$data = date("Y-m-d H:i:s"); //tvyal jamy
$data_obj = new DateTime($data); //tvyal jamy sargum en data obiekt
$str = $item["data_time"]; //uxarkvac namakneri jamayin tvyalner
$sended = new DateTime($str); //stanum enq uxarkvac namakneri datai obiekty
$interval = $data_obj ->diff($sended); //nranc tarberutyuny
$days = $interval->d;
$hours = $interval->h;
$minutes = $interval->i;
?>
<?php if($_SERVER["REQUEST_METHOD"] == "GET" && $_GET["name"] == $item["name"]){ ?>
<tbody>
<th><?=$item['name']?></th>
<th><?=$item['message']?></th>
<th><?="Sended ".$days." Days ".$hours." Hours ".$minutes." Minutes ago "?></th>
</tbody>
<?php } ?>
<tbody>
<th><?=$item['name']?></th>
<th><?=$item['message']?></th>
<th><?="Sended ".$days." Days ".$hours." Hours ".$minutes." Minutes ago "?></th>
</tbody>
<?php } ?>
</table>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question