

<html>

<p>ajouter un article</p>
<form method="POST" action="addarticle">
<label>nom: </label><input type="text" name="nom" id="pseudo"/>

<label for="contact_message"><strong>Message: <strong></label>
<textarea name="text" id="contact_message" ></textarea>
<input type="submit" value="enregistrer" />
</form>


 <table id="example">
  <thead>
    <tr><th class="site_name">Nom</th><th class="text">Texte </th></tr>
  </thead>
  <tbody>
  
  
  </table>


<script>
  $(function(){
   $("#example").dataTable({
  "aaData":[
    <?php foreach ($articles as $article) : ?> 
	 <?php echo '["'.$article['nom'].'","'.$article['text'].'"],';?>
	 <?php endforeach; ?>
	
	
  ],
  "aoColumnDefs":[{
        "sTitle":"Nom"
      , "aTargets": [ "site_name" ]
	  ,"mRender": function ( nom, type, full )  {
          return  '<a href="'+nom+'">' + nom + '</a>';}
  },{
        "aTargets": [ "text" ]
      , "bSortable": true
      
     
  }]
});
  })
  </script>


</html>