-2

How to decode the $_get variable using PHP with out form method?

Html code

<a id="msgr"name="msgr<?php echo $d['qid'];?>"href="Chatbox.php">message</a>

php code (chatbox.php)

if(isset($_get["msgr"])){

    $get_id=mysqli_fetch_array(mysqli_query($connection,"SELECT MAX(qid) 
     FROM `queries` WHERE uid='".$_SESSION['id']."'"));

   $result = mysqli_fetch_array(mysqli_query($connection,"SELECT * FROM 
   `queries` where  qid='".$get_id[0]."'"));

}

How can I get URL like example.com/chatbox.php?qid=212 ? Please give explain and give me the solution. Thanks in advance

YakovL
  • 7,557
  • 12
  • 62
  • 102
Munna VMC
  • 35
  • 1
  • 9

1 Answers1

1

Have you tried to put it inside href attribute like:

<a id="msgr" href="/Chatbox.php?msgr=<?php echo $d['qid'];?>">message</a>
Oskyk
  • 448
  • 3
  • 12