Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if (empty($_POST['titre']) && isset($_POST['titre']))
  2.         {
  3.                         echo"lol";
  4.         }
  5.        
  6.         else{
  7.                 try
  8.                 {
  9.  
  10.                 $cnx->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  11.                
  12.                 $cnx->beginTransaction();
  13.                
  14.                 $sql="INSERT INTO tutoriel ( titre, contenu, lien)
  15.                                 VALUES (:titre, :contenu, :lien)";
  16.                
  17.                 $qid=$cnx->prepare($sql);
  18.                 $qid->execute(array(
  19.                         ':lien'     => htmlentities($_POST['lien']),
  20.                         ':contenu'  => htmlentities($_POST['contenu']),
  21.                         ':titre'    => htmlentities($_POST['titre']),
  22.                 ));
  23.  
  24.                
  25.                 $cnx = null;
  26.                 }
  27.  
  28.                 catch (Exception $e)
  29.                 {
  30.                         echo 'Erreur : ' . $e->getMessage();
  31.                 }
  32.  
  33.          }
  34. ?>