[Résolu] Probleme d'enregistrement lors d'un envoi de formulaire

Probleme d'enregistrement lors d'un envoi de formulaire [Résolu] - HTML/CSS - Programmation

Marsh Posté le 10-10-2007 à 01:41:02    

Bonjour,
 
Je sais pas si c'est un probleme HTML, Js ou PHP. C'est pour ca que je le mets ici.
voilà j'ai fait une page pour poster des news sur mon site, mais le probleme c'est que quand j'envoi mon formulaire il n'y a aucune donnée qui s'enregistre dans ma base de données. Bon j'ai fait un peu de bricolage avec du BBcode sur ma page de création de news. Je vous mets quand meme code

Code :
  1. <head>
  2. <title>Club d investissement - Need 4 Cash - Rédaction des rapports</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <style type="text/css">
  5. <!--
  6. /*
  7.   The original subSilver Theme for phpBB version 2+
  8.   Created by subBlue design
  9.   http://www.subBlue.com
  10.   NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
  11.   theme administration centre. When you have finalised your style you could cut the final CSS code
  12.   and place it in an external file, deleting this section to save bandwidth.
  13. */
  14. /* General page style. The scroll bar colours only visible in IE5.5+ */
  15. body {
  16. background-color: #E5E5E5;
  17. scrollbar-face-color: #DEE3E7;
  18. scrollbar-highlight-color: #FFFFFF;
  19. scrollbar-shadow-color: #DEE3E7;
  20. scrollbar-3dlight-color: #D1D7DC;
  21. scrollbar-arrow-color:  #006699;
  22. scrollbar-track-color: #EFEFEF;
  23. scrollbar-darkshadow-color: #98AAB1;
  24. }
  25. /* General font families for common tags */
  26. font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
  27. a:link,a:active,a:visited { color : #006699; }
  28. a:hover  { text-decoration: underline; color : #DD6900; }
  29. hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}
  30. /* This is the border line & background colour round the entire page */
  31. .bodyline { background-color: #FFFFFF; border: 1px #98AAB1 solid; }
  32. /* This is the outline round the main forum tables */
  33. .forumline { background-color: #FFFFFF; border: 2px #006699 solid; }
  34. /* Main table cell colours and backgrounds */
  35. td.row1 { background-color: #EFEFEF; }
  36. td.row2 { background-color: #DEE3E7; }
  37. td.row3 { background-color: #D1D7DC; }
  38. /*
  39.   This is for the table cell above the Topics, Post & Last posts on the index.php page
  40.   By default this is the fading out gradiated silver background.
  41.   However, you could replace this with a bitmap specific for each forum
  42. */
  43. td.rowpic {
  44.  background-color: #FFFFFF;
  45.  background-image: url(templates/subSilver/images/cellpic2.jpg);
  46.  background-repeat: repeat-y;
  47. }
  48. /* Header cells - the blue and silver gradient backgrounds */
  49. th {
  50. color: #FFA34F; font-size: 11px; font-weight : bold;
  51. background-color: #006699; height: 25px;
  52. background-image: url(templates/subSilver/images/cellpic3.gif);
  53. }
  54. td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom {
  55.   background-image: url(templates/subSilver/images/cellpic1.gif);
  56.   background-color:#D1D7DC; border: #FFFFFF; border-style: solid; height: 28px;
  57. }
  58. /*
  59.   Setting additional nice inner borders for the main table cells.
  60.   The names indicate which sides the border will be on.
  61.   Don't worry if you don't understand this, just ignore it :-)
  62. */
  63. td.cat,td.catHead,td.catBottom {
  64. height: 29px;
  65. border-width: 0px 0px 0px 0px;
  66. }
  67. th.thHead,th.thSides,th.thTop,th.thLeft,th.thRight,th.thBottom,th.thCornerL,th.thCornerR {
  68. font-weight: bold; border: #FFFFFF; border-style: solid; height: 28px;
  69. }
  70. td.row3Right,td.spaceRow {
  71. background-color: #D1D7DC; border: #FFFFFF; border-style: solid;
  72. }
  73. th.thHead,td.catHead { font-size: 12px; border-width: 1px 1px 0px 1px; }
  74. th.thSides,td.catSides,td.spaceRow  { border-width: 0px 1px 0px 1px; }
  75. th.thRight,td.catRight,td.row3Right  { border-width: 0px 1px 0px 0px; }
  76. th.thLeft,td.catLeft   { border-width: 0px 0px 0px 1px; }
  77. th.thBottom,td.catBottom  { border-width: 0px 1px 1px 1px; }
  78. th.thTop  { border-width: 1px 0px 0px 0px; }
  79. th.thCornerL { border-width: 1px 0px 0px 1px; }
  80. th.thCornerR { border-width: 1px 1px 0px 0px; }
  81. /* The largest text used in the index page title and toptic title etc. */
  82. .maintitle {
  83. font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
  84. text-decoration: none; line-height : 120%; color : #000000;
  85. }
  86. /* General text */
  87. .gen { font-size : 12px; }
  88. .genmed { font-size : 11px; }
  89. .gensmall { font-size : 10px; }
  90. .gen,.genmed,.gensmall { color : #000000; }
  91. a.gen,a.genmed,a.gensmall { color: #006699; text-decoration: none; }
  92. a.gen:hover,a.genmed:hover,a.gensmall:hover { color: #DD6900; text-decoration: underline; }
  93. /* The register, login, search etc links at the top of the page */
  94. .mainmenu  { font-size : 11px; color : #000000 }
  95. a.mainmenu  { text-decoration: none; color : #006699;  }
  96. a.mainmenu:hover{ text-decoration: underline; color : #DD6900; }
  97. /* Forum category titles */
  98. .cattitle  { font-weight: bold; font-size: 12px ; letter-spacing: 1px; color : #006699}
  99. a.cattitle  { text-decoration: none; color : #006699; }
  100. a.cattitle:hover{ text-decoration: underline; }
  101. /* Forum title: Text and link to the forums used in: index.php */
  102. .forumlink  { font-weight: bold; font-size: 12px; color : #006699; }
  103. a.forumlink  { text-decoration: none; color : #006699; }
  104. a.forumlink:hover{ text-decoration: underline; color : #DD6900; }
  105. /* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */
  106. .nav   { font-weight: bold; font-size: 11px; color : #000000;}
  107. a.nav   { text-decoration: none; color : #006699; }
  108. a.nav:hover  { text-decoration: underline; }
  109. /* titles for the topics: could specify viewed link colour too */
  110. .topictitle,h1,h2 { font-weight: bold; font-size: 11px; color : #000000; }
  111. a.topictitle:link   { text-decoration: none; color : #006699; }
  112. a.topictitle:visited { text-decoration: none; color : #5493B4; }
  113. a.topictitle:hover { text-decoration: underline; color : #DD6900; }
  114. /* Name of poster in viewmsg.php and viewtopic.php and other places */
  115. .name   { font-size : 11px; color : #000000;}
  116. /* Location, number of posts, post date etc */
  117. .postdetails  { font-size : 10px; color : #000000; }
  118. /* The content of the posts (body of text) */
  119. .postbody { font-size : 12px; line-height: 18px}
  120. a.postlink:link { text-decoration: none; color : #006699 }
  121. a.postlink:visited { text-decoration: none; color : #5493B4; }
  122. a.postlink:hover { text-decoration: underline; color : #DD6900}
  123. /* Quote & Code blocks */
  124. .code {
  125. font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
  126. background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
  127. border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
  128. }
  129. .quote {
  130. font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
  131. background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
  132. border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
  133. }
  134. /* Copyright and bottom info */
  135. .copyright  { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;}
  136. a.copyright  { color: #444444; text-decoration: none;}
  137. a.copyright:hover { color: #000000; text-decoration: underline;}
  138. /* Form elements */
  139. input,textarea, select {
  140. color : #000000;
  141. font: normal 11px Verdana, Arial, Helvetica, sans-serif;
  142. border-color : #000000;
  143. }
  144. /* The text input fields background colour */
  145. input.post, textarea.post, select {
  146. background-color : #FFFFFF;
  147. }
  148. input { text-indent : 2px; }
  149. /* The buttons used for bbCode styling in message post */
  150. input.button {
  151. background-color : #EFEFEF;
  152. color : #000000;
  153. font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;
  154. }
  155. /* The main submit button option */
  156. input.mainoption {
  157. background-color : #FAFAFA;
  158. font-weight : bold;
  159. }
  160. /* None-bold submit button */
  161. input.liteoption {
  162. background-color : #FAFAFA;
  163. font-weight : normal;
  164. }
  165. /* This is the line in the posting page which shows the rollover
  166.   help line. This is actually a text box, but if set to be the same
  167.   colour as the background no one will know ;)
  168. */
  169. .helpline { background-color: #DEE3E7; border-style: none; }
  170. -->
  171. </style>
  172. </head>
  173. <body>
  174.  <br />
  175. <script language="JavaScript" type="text/javascript">
  176. <!--
  177. // bbCode control by
  178. // subBlue design
  179. // www.subBlue.com
  180. // Startup variables
  181. var imageTag = false;
  182. var theSelection = false;
  183. // Check for Browser & Platform for PC & IE specific bits
  184. // More details from: http://www.mozilla.org/docs/web-de [...] _type.html
  185. var clientPC = navigator.userAgent.toLowerCase(); // Get client info
  186. var clientVer = parseInt(navigator.appVersion); // Get browser version
  187. var is_ie = ((clientPC.indexOf("msie" ) != -1) && (clientPC.indexOf("opera" ) == -1));
  188. var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
  189.                 && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
  190.                 && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
  191. var is_moz = 0;
  192. var is_win = ((clientPC.indexOf("win" )!=-1) || (clientPC.indexOf("16bit" ) != -1));
  193. var is_mac = (clientPC.indexOf("mac" )!=-1);


Ici les balise pour le code marche pas à cause de mes balise bbcode en dessous. Je remplacer les [] par des {}

Code :
  1. // Helpline messages
  2. b_help = "Texte gras : {b}exte{/b} (alt+b)";
  3. i_help = "Texte italique : {i}texte{/i} (alt+i)";
  4. u_help = "Texte souligné : {u}exte{u} (alt+u)";
  5. q_help = "Citation : {quote}texte cité{/quote} (alt+q)";
  6. c_help = "Afficher du code : {code}code{/code} (alt+c)";
  7. l_help = "Liste : {list}texte{/list} (alt+l)";
  8. o_help = "Liste ordonnée : {list=}texte{/list} (alt+o)";
  9. p_help = "Insérer une image : {img}http://image_url/{/img} (alt+p)";
  10. w_help = "Insérer un lien : {url}http://url/{/url}ou {url=http://url/}Nom{/url} (alt+w)";
  11. a_help = "Fermer toutes les balises BBCode ouvertes";
  12. s_help = "Couleur du texte : {color=red}texte{/color} ce rouge fait partie du code, l'astuce : #FF0000 fonctionne aussi";
  13. f_help = "Taille du texte : {size=x-small}texte en petit{/size}";
  14. // Define the bbCode tags
  15. bbcode = new Array();
  16. bbtags = new Array('{b}','{/b}','{i}','{/i}','{u}','{/u}','{quote}','{/quote}','{code}','{/code}','{list}','{/list}','{list=}','{/list}','{img}','{/img}','{url}','{/url}');
  17. imageTag = false;
  18. // Shows the help messages in the helpline window
  19. function helpline(help) {
  20. document.post.helpbox.value = eval(help + "_help" );
  21. }
  22. // Replacement for arrayname.length property
  23. function getarraysize(thearray) {
  24. for (i = 0; i < thearray.length; i++) {
  25.  if ((thearray[i] == "undefined" ) || (thearray[i] == "" ) || (thearray[i] == null))
  26.   return i;
  27.  }
  28. return thearray.length;
  29. }
  30. // Replacement for arrayname.push(value) not implemented in IE until version 5.5
  31. // Appends element to the array
  32. function arraypush(thearray,value) {
  33. thearray[ getarraysize(thearray) ] = value;
  34. }
  35. // Replacement for arrayname.pop() not implemented in IE until version 5.5
  36. // Removes and returns the last element of an array
  37. function arraypop(thearray) {
  38. thearraysize = getarraysize(thearray);
  39. retval = thearray[thearraysize - 1];
  40. delete thearray[thearraysize - 1];
  41. return retval;
  42. }
  43. function checkForm() {
  44. formErrors = false;
  45. if (document.post.contenu.value.length < 2) {
  46.  formErrors = "Vous devez entrer un rapport avant de poster.";
  47. }
  48. if (formErrors) {
  49.  alert(formErrors);
  50.  return false;
  51. } else {
  52.  bbstyle(-1);
  53. //  formObj.preview.disabled = true;
  54. //  formObj.submit.disabled = true;
  55.  return true;
  56. }
  57. }
  58. function emoticon(text) {
  59. var txtarea = document.post.contenu;
  60. text = ' ' + text + ' ';
  61. if (txtarea.createTextRange && txtarea.caretPos) {
  62.  var caretPos = txtarea.caretPos;
  63.  caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
  64.  txtarea.focus();
  65. } else {
  66.  txtarea.value  += text;
  67.  txtarea.focus();
  68. }
  69. }
  70. function bbfontstyle(bbopen, bbclose) {
  71. var txtarea = document.post.contenu;
  72. if ((clientVer >= 4) && is_ie && is_win) {
  73.  theSelection = document.selection.createRange().text;
  74.  if (!theSelection) {
  75.   txtarea.value += bbopen + bbclose;
  76.   txtarea.focus();
  77.   return;
  78.  }
  79.  document.selection.createRange().text = bbopen + theSelection + bbclose;
  80.  txtarea.focus();
  81.  return;
  82. }
  83. else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
  84. {
  85.  mozWrap(txtarea, bbopen, bbclose);
  86.  return;
  87. }
  88. else
  89. {
  90.  txtarea.value += bbopen + bbclose;
  91.  txtarea.focus();
  92. }
  93. storeCaret(txtarea);
  94. }
  95. function bbstyle(bbnumber) {
  96. var txtarea = document.post.contenu;
  97. txtarea.focus();
  98. donotinsert = false;
  99. theSelection = false;
  100. bblast = 0;
  101. if (bbnumber == -1) { // Close all open tags & default button names
  102.  while (bbcode[0]) {
  103.   butnumber = arraypop(bbcode) - 1;
  104.   txtarea.value += bbtags[butnumber + 1];
  105.   buttext = eval('document.post.addbbcode' + butnumber + '.value');
  106.   eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
  107.  }
  108.  imageTag = false; // All tags are closed including image tags :D
  109.  txtarea.focus();
  110.  return;
  111. }
  112. if ((clientVer >= 4) && is_ie && is_win)
  113. {
  114.  theSelection = document.selection.createRange().text; // Get text selection
  115.  if (theSelection) {
  116.   // Add tags around selection
  117.   document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
  118.   txtarea.focus();
  119.   theSelection = '';
  120.   return;
  121.  }
  122. }
  123. else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
  124. {
  125.  mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
  126.  return;
  127. }
  128. // Find last occurance of an open tag the same as the one just clicked
  129. for (i = 0; i < bbcode.length; i++) {
  130.  if (bbcode[i] == bbnumber+1) {
  131.   bblast = i;
  132.   donotinsert = true;
  133.  }
  134. }
  135. if (donotinsert) {  // Close all open tags up to the one just clicked & default button names
  136.  while (bbcode[bblast]) {
  137.    butnumber = arraypop(bbcode) - 1;
  138.    txtarea.value += bbtags[butnumber + 1];
  139.    buttext = eval('document.post.addbbcode' + butnumber + '.value');
  140.    eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
  141.    imageTag = false;
  142.   }
  143.   txtarea.focus();
  144.   return;
  145. } else { // Open tags
  146.  if (imageTag && (bbnumber != 14)) {  // Close image tag before adding another
  147.   txtarea.value += bbtags[15];
  148.   lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list
  149.   document.post.addbbcode14.value = "Img"; // Return button back to normal state
  150.   imageTag = false;
  151.  }
  152.  // Open tag
  153.  txtarea.value += bbtags[bbnumber];
  154.  if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
  155.  arraypush(bbcode,bbnumber+1);
  156.  eval('document.post.addbbcode'+bbnumber+'.value += "*"');
  157.  txtarea.focus();
  158.  return;
  159. }
  160. storeCaret(txtarea);
  161. }
  162. // From http://www.massless.org/mozedit/
  163. function mozWrap(txtarea, open, close)
  164. {
  165. var selLength = txtarea.textLength;
  166. var selStart = txtarea.selectionStart;
  167. var selEnd = txtarea.selectionEnd;
  168. if (selEnd == 1 || selEnd == 2)
  169.  selEnd = selLength;
  170. var s1 = (txtarea.value).substring(0,selStart);
  171. var s2 = (txtarea.value).substring(selStart, selEnd)
  172. var s3 = (txtarea.value).substring(selEnd, selLength);
  173. txtarea.value = s1 + open + s2 + close + s3;
  174. return;
  175. }
  176. // Insert at Claret position. Code from
  177. // http://www.faqts.com/knowledge_bas [...] 52/fid/130
  178. function storeCaret(textEl) {
  179. if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
  180. }
  181. //-->
  182. </script>
  183. <br />
  184. <a href="liste_rpt.php">Retour à la liste des rapports par secteur</a>
  185. <?php
  186. include('../connexion.php');
  187. if (isset($_GET['modifier_rpt'])) // Si on demande de modifier une news
  188. {
  189. // On récupère les infos de la correspondante
  190. $retour = mysql_query('SELECT * FROM rapport WHERE id=' . $_GET['modifier_rpt']);
  191. $donnees = mysql_fetch_array($retour);
  192. // On place le titre et le contenu dans des variables simples
  193. $secteur = $donnees['secteur'];
  194. $contenu = $donnees['contenu'];
  195. $membre = $données['membre'];
  196. $id_rpt = $donnees['id']; // Cette variable va servir pour se souvenir que c'est une modification
  197. }
  198. else // C'est qu'on rédige une nouvelle news
  199. {
  200. // Les variables $titre et $contenu sont vides, puisque c'est une nouvelle news
  201. $secteur = '';
  202. $contenu = '';
  203. $membre='';
  204. $id_rpt = 0; // La variable vaut 0, donc on se souviendra que ce n'est pas une modification
  205. }
  206. ?>
  207. <form action="liste_rpt.php" method="post" name="post" onsubmit="return checkForm(this)">
  208. <table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
  209. <tr>
  210.  <th class="thHead" colspan="2" height="25"><b>Poster un nouveau rapport</b></th>
  211. </tr>
  212. <tr>
  213.   <td class="row1" width="22%"><span class="gen"><b>Secteur :</b></span></td>
  214.   <td class="row2" width="78%"> <span class="gen">
  215.   <input type="text" size="30" name="secteur" id="secteur" value="<?php echo $secteur; ?>" /
  216. >
  217.  </span> </td>
  218. </tr>
  219. <tr>
  220.   <td class="row1" width="22%"><span class="gen"><b>Membre :</b></span></td>
  221.   <td class="row2" width="78%"> <span class="gen">
  222.   <input type="text" size="30" name="titre" id="membre" value="<?php echo $membre; ?>" /
  223. >
  224.  </span> </td>
  225. </tr>
  226. <tr>
  227.   <td class="row1" valign="top">
  228.  <table width="100%" border="0" cellspacing="0" cellpadding="1">
  229.    <tr>
  230.   <td><span class="gen"><b>Corps du rapport</b></span> </td>
  231.    </tr>
  232.   
  233.  </table>
  234.   </td>
  235.   <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
  236.  <table width="450" border="0" cellspacing="0" cellpadding="2">
  237.    <tr align="center" valign="middle">
  238.   <td><span class="genmed">
  239.     <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
  240.     </span></td>
  241.   <td><span class="genmed">
  242.     <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
  243.     </span></td>
  244.   <td><span class="genmed">
  245.     <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
  246.     </span></td>
  247.   <td><span class="genmed">
  248.     <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
  249.     </span></td>
  250.   <td><span class="genmed">
  251.     <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
  252.     </span></td>
  253.   <td><span class="genmed">
  254.     <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
  255.     </span></td>
  256.   <td><span class="genmed">
  257.     <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
  258.     </span></td>
  259.   <td><span class="genmed">
  260.     <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onClick="bbstyle(14)" onMouseOver="helpline('p')" />
  261.     </span></td>
  262.   <td><span class="genmed">
  263.     <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
  264.     </span></td>
  265.    </tr>
  266.    <tr>
  267.   <td colspan="9">
  268.     <table width="100%" border="0" cellspacing="0" cellpadding="0">
  269.    <tr>
  270.      <td><span class="genmed"> &nbsp;Couleur:
  271.     <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
  272.       <option style="color:black; background-color: #FAFAFA" value="#444444" class="genmed">Défaut</option>
  273.       <option style="color:darkred; background-color: #FAFAFA" value="darkred" class="genmed">Rouge foncé</option>
  274.       <option style="color:red; background-color: #FAFAFA" value="red" class="genmed">Rouge</option>
  275.       <option style="color:orange; background-color: #FAFAFA" value="orange" class="genmed">Orange</option>
  276.       <option style="color:brown; background-color: #FAFAFA" value="brown" class="genmed">Marron</option>
  277.       <option style="color:yellow; background-color: #FAFAFA" value="yellow" class="genmed">Jaune</option>
  278.       <option style="color:green; background-color: #FAFAFA" value="green" class="genmed">Vert</option>
  279.       <option style="color:olive; background-color: #FAFAFA" value="olive" class="genmed">Olive</option>
  280.       <option style="color:cyan; background-color: #FAFAFA" value="cyan" class="genmed">Cyan</option>
  281.       <option style="color:blue; background-color: #FAFAFA" value="blue" class="genmed">Bleu</option>
  282.       <option style="color:darkblue; background-color: #FAFAFA" value="darkblue" class="genmed">Bleu foncé</option>
  283.       <option style="color:indigo; background-color: #FAFAFA" value="indigo" class="genmed">Indigo</option>
  284.       <option style="color:violet; background-color: #FAFAFA" value="violet" class="genmed">Violet</option>
  285.       <option style="color:white; background-color: #FAFAFA" value="white" class="genmed">Blanc</option>
  286.       <option style="color:black; background-color: #FAFAFA" value="black" class="genmed">Noir</option>
  287.     </select> &nbsp;Taille:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')">
  288.       <option value="0" class="genmed">Taille</option>
  289.       <option value="7" class="genmed">Très petit</option>
  290.       <option value="9" class="genmed">Petit</option>
  291.       <option value="12" selected class="genmed">Normal</option>
  292.       <option value="18" class="genmed">Grand</option>
  293.       <option  value="24" class="genmed">Très grand</option>
  294.     </select>
  295.     </span></td>
  296.      <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">Fermer les Balises</a></span></td>
  297.    </tr>
  298.     </table>
  299.   </td>
  300.    </tr>
  301.    <tr>
  302.   <td colspan="9"> <span class="gensmall">
  303.     <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="Astuce : Une mise en forme peut être appliquée au texte sélectionné." />
  304.     </span></td>
  305.    </tr>
  306.    <tr>
  307.   <td colspan="9"><span class="gen">
  308.     <textarea name="contenu" id="contenu" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"><?php echo $contenu; ?></textarea>
  309.     </span></td>
  310.    </tr>
  311.  </table>
  312.  </span></td>
  313. </tr>
  314. <tr>
  315.   <td class="catBottom" colspan="2" align="center" height="28"> <input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="Envoyer" /><input type="hidden" name="id_rpt" value="<?php echo $id_rpt; ?>" /></td>
  316. </tr>
  317.   </table>
  318.  
  319. </td>
  320.   </tr>
  321. </table></form>
  322. </body>
  323. </html>


 
et celui de mon autre page vers laquelle est redirigé mon formulaire.

Code :
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/
  2. xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
  4. <head>
  5. <title>Club d'investissement - Need 4 Cash - Liste des rapports</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7. <style type="text/css">
  8. h2, th, td
  9. {
  10. text-align:center;
  11. }
  12. table
  13. {
  14. border-collapse:collapse;
  15. border:2px solid black;
  16. margin:auto;
  17. }
  18. th, td
  19. {
  20. border:1px solid black;
  21. }
  22. </style>
  23. </head>
  24. <body><br />
  25. <h2><a href="rediger_rpt.php">Ajouter un rapport</a></h2>
  26. <?php
  27. include('../connexion.php');
  28. //-----------------------------------------------------
  29. // Vérification 1 : est-ce qu'on veut poster une news ?
  30. //-----------------------------------------------------
  31. if (isset($_POST['secteur']) AND isset($_POST['membre']) AND isset($_POST['contenu']))
  32. {
  33. $membre = ($_POST['membre']);
  34. $secteur = ($_POST['secteur']);
  35. $contenu = ($_POST['contenu']);// On vérifie si c'est une modification de news ou pas
  36. if ($_POST['id_rpt'] == 0)
  37. {
  38. // Ce n'est pas une modification, on crée une nouvelle entrée dans la table
  39. mysql_query("INSERT INTO rapport VALUES('', '" . $contenu . "', '" . time() . "','" . $membre .
  40. "','" . $secteur ."')" );
  41. }
  42. else
  43. {
  44. // C'est une modification, on met juste à jour le secteur et le contenu
  45. mysql_query("UPDATE rapport SET contenu='" . $contenu . "', secteur='" . $secteur . "'WHERE id=" . $_POST['id_rpt']);
  46. }
  47. }
  48. //--------------------------------------------------------
  49. // Vérification 2 : est-ce qu'on veut supprimer une news ?
  50. //--------------------------------------------------------
  51. if (isset($_GET['supprimer_rpt'])) // Si on demande de supprimer une news
  52. {
  53. // Alors on supprime la news correspondante
  54. mysql_query('DELETE FROM rapport WHERE id=' . $_GET['supprimer_rpt']);
  55. }
  56. ?>
  57. <table><tr>
  58. <th>Modifier</th>
  59. <th>Supprimer</th>
  60. <th>secteur</th>
  61. <th>Date</th>
  62. <th>Rapport</th>
  63. </tr>
  64. <?php
  65. $retour = mysql_query('SELECT * FROM rapport ORDER BY id DESC');
  66. while ($donnees = mysql_fetch_array($retour)) // On fait une boucle pour lister les news
  67. {
  68. ?>
  69. <tr>
  70. <td><?php echo '<a href="rediger_rpt.php?modifier_rpt=' . $donnees['id'] . '">'; ?>
  71. >Modifier</a></td>
  72. <td><?php echo '<a href="liste_rpt.php?supprimer_rpt=' . $donnees['id'] . '">'; ?>
  73. >Supprimer</a></td>
  74. <td><?php echo stripslashes($donnees['secteur']); ?></td>
  75. <td><?php echo date('d/m/Y', $donnees['timestamp']); ?></td>
  76. <td><?php echo stripslashes($donnees['contenu']); ?></td>
  77. </tr>
  78. <?php
  79. } // Fin de la boucle qui liste les news
  80. ?>
  81. </table>
  82. <h2><a href="index.php">Index</a></h2>
  83. <br /><h2><a href="../accueil.php">Accueil</a></h2>
  84. </body>
  85. </html>


Si vous pouvez me dire où ca va pas, je vous en serez grandement reconnaissant...
Merci bcp
 
l'adresse de mon site où sont les pages: need.4.cash.free.fr/rapport/rediger_rpt.php


Message édité par mjcom le 10-10-2007 à 11:48:37
Reply

Marsh Posté le 10-10-2007 à 01:41:02   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed