plz add my code not working 

i want user create post without refresh page on page accueil
// code html for form (title , text)

```
<form class="posting" method="POST" enctype="multipart/form-data"> 

<input type="text" name="title" class="title-input" placeholder="Quelle est votre question... ?"
autocomplete="off">

<textarea name="text" id="text" class="textarea" cols='60' rows='8' ></textarea>

<button class="btn-ajouter" type="submit" onclick="get()" name="ajouter" value="ajouter">ajouter</button>         
</form> 

```

// code php create post (user)

```
if(isset($_POST['ajouter']) && !empty($_POST['text']) && isset($_POST['title']) )
{
  $texte = htmlspecialchars($_POST['text']);
  $title = htmlspecialchars($_POST['title']);

 $stmt=$connect->prepare('INSERT INTO

  publications(title_post,post) VALUES(?,?) ');

  $stmt>execute(array($texte,$title)); 
 }

```

// code display result (page accueil) (page accueil)

```
<div id="result">
 <?php 
  $stmt = $connect->query('SELECT *FROM publications ');

  while($row=$stmt->fetch() )
    {
      echo $row['title_post'] ; 
      echo $row['post'];
 ?>
</div>

```

// code ajax 

```
     function get(){
      var result ;
      if(window.XMLHttpRequest)
      result = new XMLHttpRequest();

      else

      result = new ActiveXObject('Microsoft.XMLHTTP');

      result.onreadystatechange = function()
       { 
      if(result.readyState == 4 & result.status == 200)              
            document.getElementById('allpost').innerHTML = 
                                                      result.responseText;
       }

                  result.open('POST','accueil.php',false);
                  result.setRequestHeader('Content-type','application/x-www-
                   form-urlencoded');
                  result.send();

               }

```