SHARE
TWEET

Formulaire commentaire

a guest Sep 16th, 2013 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. echo '<form name="com" method="POST" action="' . append_sid('calend.php') . '">';
  3. echo '<p><textarea name="desc" rows="15" cols="135">'.$commentaire.'</textarea></p>';
  4. echo '<p><input type="submit" name="ok"></input></p>';
  5. echo '</form>';
  6. if (isset ($_POST['ok']))
  7.         {
  8.                 //$commentaire = request_var('desc', '');
  9.                 $commentaire = utf8_normalize_nfc(request_var('desc', '', true));
  10.                 //$commentaire=htmlspecialchars($commentaire, ENT_QUOTES);
  11.                 //$commentaire=nl2br($commentaire);
  12.                 $req = mysql_query ("SELECT * FROM jrtm_jour WHERE id_jours='$dateday' AND id_annee='$dateannee' AND id_mois='$idmonth'");
  13.                 if (mysql_numrows($req) > '0')
  14.                         {
  15.                                 $idjour = mysql_result ($req, $zero, "id_jour");
  16.                                 mysql_query ("UPDATE jrtm_jour SET com_jour='$commentaire' WHERE id_jour='$idjour'");
  17.                         }
  18.                 else
  19.                         {
  20.                                 mysql_query ("INSERT INTO jrtm_jour (id_jours, id_mois, id_annee, com_jour) VALUE ('$dateday', '$idmonth', '$dateannee', '$commentaire')");
  21.                         }
  22.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top