le 26/07/2005 à 14:49
case à cocher
oui c'est ça, il ya une table newsletter avec 2 champs id, et categorie, table membre j'ai mis un champ newsletter (Int)
<?php while($ligne = mysql_fetch_array($result)) { extract($ligne); echo"<input type='checkbox' name='newsletter[]' value='$id_news'>$cat_news\n"; echo"<br>\n";}?>
$newsletter = $_POST['newsletter'];
$requete = "INSERT INTO adherent VALUES (0,'$login', '$pseudo', '".md5($passwd)."', '$email_ami1', '$email_ami2', '$email_ami3', $dept_org, '$date_inscription', $newsletter, 0)";
$resultat = mysql_query($requete);
<script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>
<SCRIPT LANGUAGE="JavaScript">
var max=200; // 50 caractères maximum
function compter(f) {
var txt=f.desc.value;
var nb=txt.length;
if (nb>max) {
alert("Pas plus de "+max+" caractères dans ce champ");
f.desc.value=txt.substring(0,max);
nb=max;
}
f.nbcar.value=nb;
}
function timer() {
compter(document.forms["vehicule"]);
setTimeout("timer()",100);
}
</SCRIPT>