phphp 14 Junior Poster in Training

Sir I have these codes

<div class="menu_box image16">
    <div id="small_header">Chart</div>

    <h4><a href="chart_qt.php" title="Close">
        <img src="images/16x16/chart_bar.png" hspace="4">Qty</a>
        </h4>

        <h4><a href="chart_wt.php" title="Close">
        <img src="images/16x16/server_chart.png" hspace="4">Weight</a>
        </h4>

        <h4><a href="chart_at.php" title="Close">
        <img src="images/16x16/chart_pie.png" hspace="4">Amount</a>
        </h4>

  </div>

Untitled.png

when any use click on any <a></a> then his $_SESSION['id'] must save in events table

Suppose:

if a user clicks on this anchor

 <h4><a href="chart_qt.php" title="Close">
        <img src="images/16x16/chart_bar.png" hspace="4">Qty</a> // qty is file name
        </h4>

then I want to save this record in table

$query2 = "INSERT INTO events (user_id,file,time) VALUES (".$_SESSION['id'].",'qty','date('Y-m-d H:i:s')'";

Please