<?php
if (isset($_POST['pseudo']) and isset($_POST['msg'])) {
	//try {
	$bdd=new PDO('mysql:host=localhost;dbname=tp2' ,'root','');
	//} catch(exception e) {
		//					die('error');
			//			  }
						  
	$req=$bdd->prepare('INSERT INTO minichat(pseudo,msg) VALUES(:pseudo ,:msg)');
	$req->execute(array('pseudo'=>$_POST['pseudo'] , 'msg'=>$_POST['msg']));
		
	$req->closeCursor();
	
	header('Location: minichat.php');
}




?>