The code I have is a side bar that uses javascript to appear and disappear. When a button (create group) is pressed it resets the page. I want to be able to press the button, have php do something like: and It has to not refresh the page. Here is the code:
   <header class="header">
     <div class="btn-toggle-nav" onclick="toggleNav()"></div>
     <h1 class="logobrand">DEVIE</h1>
   </header>
   <aside class="nav-sidebar">
     <ul>
       <li> <p>Friends</p> </li>
       <li>
         <button name="creategroup">Create a group</button></li>
       <?php
     foreach (getGroups($_SESSION['user-id']) as $group) {
           echo "<li> <p> ". $group ." </p> </li>";
       }
       ?>
     </ul>
   </aside>
   <?php if (isset(['creategroup'])) {
     echo "please work";
   } ?>
 </body>
Please help
 
     
    
element and add an additional `- ` with the info it just got back from the server.
– Andry Jul 22 '20 at 12:51