mjcom le savoir est universel | 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 :
- <head>
- <title>Club d investissement - Need 4 Cash - Rédaction des rapports</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <style type="text/css">
- <!--
- /*
- The original subSilver Theme for phpBB version 2+
- Created by subBlue design
- http://www.subBlue.com
-
- NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
- theme administration centre. When you have finalised your style you could cut the final CSS code
- and place it in an external file, deleting this section to save bandwidth.
- */
- /* General page style. The scroll bar colours only visible in IE5.5+ */
- body {
- background-color: #E5E5E5;
- scrollbar-face-color: #DEE3E7;
- scrollbar-highlight-color: #FFFFFF;
- scrollbar-shadow-color: #DEE3E7;
- scrollbar-3dlight-color: #D1D7DC;
- scrollbar-arrow-color: #006699;
- scrollbar-track-color: #EFEFEF;
- scrollbar-darkshadow-color: #98AAB1;
- }
- /* General font families for common tags */
- font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
- a:link,a:active,a:visited { color : #006699; }
- a:hover { text-decoration: underline; color : #DD6900; }
- hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}
- /* This is the border line & background colour round the entire page */
- .bodyline { background-color: #FFFFFF; border: 1px #98AAB1 solid; }
- /* This is the outline round the main forum tables */
- .forumline { background-color: #FFFFFF; border: 2px #006699 solid; }
- /* Main table cell colours and backgrounds */
- td.row1 { background-color: #EFEFEF; }
- td.row2 { background-color: #DEE3E7; }
- td.row3 { background-color: #D1D7DC; }
- /*
- This is for the table cell above the Topics, Post & Last posts on the index.php page
- By default this is the fading out gradiated silver background.
- However, you could replace this with a bitmap specific for each forum
- */
- td.rowpic {
- background-color: #FFFFFF;
- background-image: url(templates/subSilver/images/cellpic2.jpg);
- background-repeat: repeat-y;
- }
- /* Header cells - the blue and silver gradient backgrounds */
- th {
- color: #FFA34F; font-size: 11px; font-weight : bold;
- background-color: #006699; height: 25px;
- background-image: url(templates/subSilver/images/cellpic3.gif);
- }
- td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom {
- background-image: url(templates/subSilver/images/cellpic1.gif);
- background-color:#D1D7DC; border: #FFFFFF; border-style: solid; height: 28px;
- }
- /*
- Setting additional nice inner borders for the main table cells.
- The names indicate which sides the border will be on.
- Don't worry if you don't understand this, just ignore it :-)
- */
- td.cat,td.catHead,td.catBottom {
- height: 29px;
- border-width: 0px 0px 0px 0px;
- }
- th.thHead,th.thSides,th.thTop,th.thLeft,th.thRight,th.thBottom,th.thCornerL,th.thCornerR {
- font-weight: bold; border: #FFFFFF; border-style: solid; height: 28px;
- }
- td.row3Right,td.spaceRow {
- background-color: #D1D7DC; border: #FFFFFF; border-style: solid;
- }
- th.thHead,td.catHead { font-size: 12px; border-width: 1px 1px 0px 1px; }
- th.thSides,td.catSides,td.spaceRow { border-width: 0px 1px 0px 1px; }
- th.thRight,td.catRight,td.row3Right { border-width: 0px 1px 0px 0px; }
- th.thLeft,td.catLeft { border-width: 0px 0px 0px 1px; }
- th.thBottom,td.catBottom { border-width: 0px 1px 1px 1px; }
- th.thTop { border-width: 1px 0px 0px 0px; }
- th.thCornerL { border-width: 1px 0px 0px 1px; }
- th.thCornerR { border-width: 1px 1px 0px 0px; }
- /* The largest text used in the index page title and toptic title etc. */
- .maintitle {
- font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
- text-decoration: none; line-height : 120%; color : #000000;
- }
- /* General text */
- .gen { font-size : 12px; }
- .genmed { font-size : 11px; }
- .gensmall { font-size : 10px; }
- .gen,.genmed,.gensmall { color : #000000; }
- a.gen,a.genmed,a.gensmall { color: #006699; text-decoration: none; }
- a.gen:hover,a.genmed:hover,a.gensmall:hover { color: #DD6900; text-decoration: underline; }
- /* The register, login, search etc links at the top of the page */
- .mainmenu { font-size : 11px; color : #000000 }
- a.mainmenu { text-decoration: none; color : #006699; }
- a.mainmenu:hover{ text-decoration: underline; color : #DD6900; }
- /* Forum category titles */
- .cattitle { font-weight: bold; font-size: 12px ; letter-spacing: 1px; color : #006699}
- a.cattitle { text-decoration: none; color : #006699; }
- a.cattitle:hover{ text-decoration: underline; }
- /* Forum title: Text and link to the forums used in: index.php */
- .forumlink { font-weight: bold; font-size: 12px; color : #006699; }
- a.forumlink { text-decoration: none; color : #006699; }
- a.forumlink:hover{ text-decoration: underline; color : #DD6900; }
- /* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */
- .nav { font-weight: bold; font-size: 11px; color : #000000;}
- a.nav { text-decoration: none; color : #006699; }
- a.nav:hover { text-decoration: underline; }
- /* titles for the topics: could specify viewed link colour too */
- .topictitle,h1,h2 { font-weight: bold; font-size: 11px; color : #000000; }
- a.topictitle:link { text-decoration: none; color : #006699; }
- a.topictitle:visited { text-decoration: none; color : #5493B4; }
- a.topictitle:hover { text-decoration: underline; color : #DD6900; }
- /* Name of poster in viewmsg.php and viewtopic.php and other places */
- .name { font-size : 11px; color : #000000;}
- /* Location, number of posts, post date etc */
- .postdetails { font-size : 10px; color : #000000; }
- /* The content of the posts (body of text) */
- .postbody { font-size : 12px; line-height: 18px}
- a.postlink:link { text-decoration: none; color : #006699 }
- a.postlink:visited { text-decoration: none; color : #5493B4; }
- a.postlink:hover { text-decoration: underline; color : #DD6900}
- /* Quote & Code blocks */
- .code {
- font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
- background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
- border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
- }
- .quote {
- font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
- background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
- border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
- }
- /* Copyright and bottom info */
- .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;}
- a.copyright { color: #444444; text-decoration: none;}
- a.copyright:hover { color: #000000; text-decoration: underline;}
- /* Form elements */
- input,textarea, select {
- color : #000000;
- font: normal 11px Verdana, Arial, Helvetica, sans-serif;
- border-color : #000000;
- }
- /* The text input fields background colour */
- input.post, textarea.post, select {
- background-color : #FFFFFF;
- }
- input { text-indent : 2px; }
- /* The buttons used for bbCode styling in message post */
- input.button {
- background-color : #EFEFEF;
- color : #000000;
- font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;
- }
- /* The main submit button option */
- input.mainoption {
- background-color : #FAFAFA;
- font-weight : bold;
- }
- /* None-bold submit button */
- input.liteoption {
- background-color : #FAFAFA;
- font-weight : normal;
- }
- /* This is the line in the posting page which shows the rollover
- help line. This is actually a text box, but if set to be the same
- colour as the background no one will know ;)
- */
- .helpline { background-color: #DEE3E7; border-style: none; }
- -->
- </style>
- </head>
- <body>
- <br />
- <script language="JavaScript" type="text/javascript">
- <!--
- // bbCode control by
- // subBlue design
- // www.subBlue.com
- // Startup variables
- var imageTag = false;
- var theSelection = false;
- // Check for Browser & Platform for PC & IE specific bits
- // More details from: http://www.mozilla.org/docs/web-de [...] _type.html
- var clientPC = navigator.userAgent.toLowerCase(); // Get client info
- var clientVer = parseInt(navigator.appVersion); // Get browser version
- var is_ie = ((clientPC.indexOf("msie" ) != -1) && (clientPC.indexOf("opera" ) == -1));
- var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
- && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
- && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
- var is_moz = 0;
- var is_win = ((clientPC.indexOf("win" )!=-1) || (clientPC.indexOf("16bit" ) != -1));
- 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 :
- // Helpline messages
- b_help = "Texte gras : {b}exte{/b} (alt+b)";
- i_help = "Texte italique : {i}texte{/i} (alt+i)";
- u_help = "Texte souligné : {u}exte{u} (alt+u)";
- q_help = "Citation : {quote}texte cité{/quote} (alt+q)";
- c_help = "Afficher du code : {code}code{/code} (alt+c)";
- l_help = "Liste : {list}texte{/list} (alt+l)";
- o_help = "Liste ordonnée : {list=}texte{/list} (alt+o)";
- p_help = "Insérer une image : {img}http://image_url/{/img} (alt+p)";
- w_help = "Insérer un lien : {url}http://url/{/url}ou {url=http://url/}Nom{/url} (alt+w)";
- a_help = "Fermer toutes les balises BBCode ouvertes";
- s_help = "Couleur du texte : {color=red}texte{/color} ce rouge fait partie du code, l'astuce : #FF0000 fonctionne aussi";
- f_help = "Taille du texte : {size=x-small}texte en petit{/size}";
- // Define the bbCode tags
- bbcode = new Array();
- bbtags = new Array('{b}','{/b}','{i}','{/i}','{u}','{/u}','{quote}','{/quote}','{code}','{/code}','{list}','{/list}','{list=}','{/list}','{img}','{/img}','{url}','{/url}');
- imageTag = false;
- // Shows the help messages in the helpline window
- function helpline(help) {
- document.post.helpbox.value = eval(help + "_help" );
- }
- // Replacement for arrayname.length property
- function getarraysize(thearray) {
- for (i = 0; i < thearray.length; i++) {
- if ((thearray[i] == "undefined" ) || (thearray[i] == "" ) || (thearray[i] == null))
- return i;
- }
- return thearray.length;
- }
- // Replacement for arrayname.push(value) not implemented in IE until version 5.5
- // Appends element to the array
- function arraypush(thearray,value) {
- thearray[ getarraysize(thearray) ] = value;
- }
- // Replacement for arrayname.pop() not implemented in IE until version 5.5
- // Removes and returns the last element of an array
- function arraypop(thearray) {
- thearraysize = getarraysize(thearray);
- retval = thearray[thearraysize - 1];
- delete thearray[thearraysize - 1];
- return retval;
- }
- function checkForm() {
- formErrors = false;
- if (document.post.contenu.value.length < 2) {
- formErrors = "Vous devez entrer un rapport avant de poster.";
- }
- if (formErrors) {
- alert(formErrors);
- return false;
- } else {
- bbstyle(-1);
- // formObj.preview.disabled = true;
- // formObj.submit.disabled = true;
- return true;
- }
- }
- function emoticon(text) {
- var txtarea = document.post.contenu;
- text = ' ' + text + ' ';
- if (txtarea.createTextRange && txtarea.caretPos) {
- var caretPos = txtarea.caretPos;
- caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
- txtarea.focus();
- } else {
- txtarea.value += text;
- txtarea.focus();
- }
- }
- function bbfontstyle(bbopen, bbclose) {
- var txtarea = document.post.contenu;
- if ((clientVer >= 4) && is_ie && is_win) {
- theSelection = document.selection.createRange().text;
- if (!theSelection) {
- txtarea.value += bbopen + bbclose;
- txtarea.focus();
- return;
- }
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- txtarea.focus();
- return;
- }
- else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
- {
- mozWrap(txtarea, bbopen, bbclose);
- return;
- }
- else
- {
- txtarea.value += bbopen + bbclose;
- txtarea.focus();
- }
- storeCaret(txtarea);
- }
- function bbstyle(bbnumber) {
- var txtarea = document.post.contenu;
- txtarea.focus();
- donotinsert = false;
- theSelection = false;
- bblast = 0;
- if (bbnumber == -1) { // Close all open tags & default button names
- while (bbcode[0]) {
- butnumber = arraypop(bbcode) - 1;
- txtarea.value += bbtags[butnumber + 1];
- buttext = eval('document.post.addbbcode' + butnumber + '.value');
- eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
- }
- imageTag = false; // All tags are closed including image tags :D
- txtarea.focus();
- return;
- }
- if ((clientVer >= 4) && is_ie && is_win)
- {
- theSelection = document.selection.createRange().text; // Get text selection
- if (theSelection) {
- // Add tags around selection
- document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
- txtarea.focus();
- theSelection = '';
- return;
- }
- }
- else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
- {
- mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
- return;
- }
- // Find last occurance of an open tag the same as the one just clicked
- for (i = 0; i < bbcode.length; i++) {
- if (bbcode[i] == bbnumber+1) {
- bblast = i;
- donotinsert = true;
- }
- }
- if (donotinsert) { // Close all open tags up to the one just clicked & default button names
- while (bbcode[bblast]) {
- butnumber = arraypop(bbcode) - 1;
- txtarea.value += bbtags[butnumber + 1];
- buttext = eval('document.post.addbbcode' + butnumber + '.value');
- eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
- imageTag = false;
- }
- txtarea.focus();
- return;
- } else { // Open tags
- if (imageTag && (bbnumber != 14)) { // Close image tag before adding another
- txtarea.value += bbtags[15];
- lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list
- document.post.addbbcode14.value = "Img"; // Return button back to normal state
- imageTag = false;
- }
- // Open tag
- txtarea.value += bbtags[bbnumber];
- if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
- arraypush(bbcode,bbnumber+1);
- eval('document.post.addbbcode'+bbnumber+'.value += "*"');
- txtarea.focus();
- return;
- }
- storeCaret(txtarea);
- }
- // From http://www.massless.org/mozedit/
- function mozWrap(txtarea, open, close)
- {
- var selLength = txtarea.textLength;
- var selStart = txtarea.selectionStart;
- var selEnd = txtarea.selectionEnd;
- if (selEnd == 1 || selEnd == 2)
- selEnd = selLength;
- var s1 = (txtarea.value).substring(0,selStart);
- var s2 = (txtarea.value).substring(selStart, selEnd)
- var s3 = (txtarea.value).substring(selEnd, selLength);
- txtarea.value = s1 + open + s2 + close + s3;
- return;
- }
- // Insert at Claret position. Code from
- // http://www.faqts.com/knowledge_bas [...] 52/fid/130
- function storeCaret(textEl) {
- if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
- }
- //-->
- </script>
- <br />
- <a href="liste_rpt.php">Retour à la liste des rapports par secteur</a>
- <?php
- include('../connexion.php');
- if (isset($_GET['modifier_rpt'])) // Si on demande de modifier une news
- {
- // On récupère les infos de la correspondante
- $retour = mysql_query('SELECT * FROM rapport WHERE id=' . $_GET['modifier_rpt']);
- $donnees = mysql_fetch_array($retour);
- // On place le titre et le contenu dans des variables simples
- $secteur = $donnees['secteur'];
- $contenu = $donnees['contenu'];
- $membre = $données['membre'];
- $id_rpt = $donnees['id']; // Cette variable va servir pour se souvenir que c'est une modification
- }
- else // C'est qu'on rédige une nouvelle news
- {
- // Les variables $titre et $contenu sont vides, puisque c'est une nouvelle news
- $secteur = '';
- $contenu = '';
- $membre='';
- $id_rpt = 0; // La variable vaut 0, donc on se souviendra que ce n'est pas une modification
- }
- ?>
- <form action="liste_rpt.php" method="post" name="post" onsubmit="return checkForm(this)">
- <table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
- <tr>
- <th class="thHead" colspan="2" height="25"><b>Poster un nouveau rapport</b></th>
- </tr>
- <tr>
- <td class="row1" width="22%"><span class="gen"><b>Secteur :</b></span></td>
- <td class="row2" width="78%"> <span class="gen">
- <input type="text" size="30" name="secteur" id="secteur" value="<?php echo $secteur; ?>" /
- >
- </span> </td>
- </tr>
- <tr>
- <td class="row1" width="22%"><span class="gen"><b>Membre :</b></span></td>
- <td class="row2" width="78%"> <span class="gen">
- <input type="text" size="30" name="titre" id="membre" value="<?php echo $membre; ?>" /
- >
- </span> </td>
- </tr>
- <tr>
- <td class="row1" valign="top">
- <table width="100%" border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td><span class="gen"><b>Corps du rapport</b></span> </td>
- </tr>
-
- </table>
- </td>
- <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
- <table width="450" border="0" cellspacing="0" cellpadding="2">
- <tr align="center" valign="middle">
- <td><span class="genmed">
- <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" />
- </span></td>
- <td><span class="genmed">
- <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
- </span></td>
- </tr>
- <tr>
- <td colspan="9">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><span class="genmed"> Couleur:
- <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
- <option style="color:black; background-color: #FAFAFA" value="#444444" class="genmed">Défaut</option>
- <option style="color:darkred; background-color: #FAFAFA" value="darkred" class="genmed">Rouge foncé</option>
- <option style="color:red; background-color: #FAFAFA" value="red" class="genmed">Rouge</option>
- <option style="color:orange; background-color: #FAFAFA" value="orange" class="genmed">Orange</option>
- <option style="color:brown; background-color: #FAFAFA" value="brown" class="genmed">Marron</option>
- <option style="color:yellow; background-color: #FAFAFA" value="yellow" class="genmed">Jaune</option>
- <option style="color:green; background-color: #FAFAFA" value="green" class="genmed">Vert</option>
- <option style="color:olive; background-color: #FAFAFA" value="olive" class="genmed">Olive</option>
- <option style="color:cyan; background-color: #FAFAFA" value="cyan" class="genmed">Cyan</option>
- <option style="color:blue; background-color: #FAFAFA" value="blue" class="genmed">Bleu</option>
- <option style="color:darkblue; background-color: #FAFAFA" value="darkblue" class="genmed">Bleu foncé</option>
- <option style="color:indigo; background-color: #FAFAFA" value="indigo" class="genmed">Indigo</option>
- <option style="color:violet; background-color: #FAFAFA" value="violet" class="genmed">Violet</option>
- <option style="color:white; background-color: #FAFAFA" value="white" class="genmed">Blanc</option>
- <option style="color:black; background-color: #FAFAFA" value="black" class="genmed">Noir</option>
- </select> Taille:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')">
- <option value="0" class="genmed">Taille</option>
- <option value="7" class="genmed">Très petit</option>
- <option value="9" class="genmed">Petit</option>
- <option value="12" selected class="genmed">Normal</option>
- <option value="18" class="genmed">Grand</option>
- <option value="24" class="genmed">Très grand</option>
- </select>
- </span></td>
- <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">Fermer les Balises</a></span></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="9"> <span class="gensmall">
- <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é." />
- </span></td>
- </tr>
- <tr>
- <td colspan="9"><span class="gen">
- <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>
- </span></td>
- </tr>
- </table>
- </span></td>
- </tr>
- <tr>
- <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>
- </tr>
- </table>
-
- </td>
- </tr>
- </table></form>
- </body>
- </html>
|
et celui de mon autre page vers laquelle est redirigé mon formulaire.
Code :
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/
- xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
- <head>
- <title>Club d'investissement - Need 4 Cash - Liste des rapports</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <style type="text/css">
- h2, th, td
- {
- text-align:center;
- }
- table
- {
- border-collapse:collapse;
- border:2px solid black;
- margin:auto;
- }
- th, td
- {
- border:1px solid black;
- }
- </style>
- </head>
- <body><br />
- <h2><a href="rediger_rpt.php">Ajouter un rapport</a></h2>
- <?php
- include('../connexion.php');
- //-----------------------------------------------------
- // Vérification 1 : est-ce qu'on veut poster une news ?
- //-----------------------------------------------------
- if (isset($_POST['secteur']) AND isset($_POST['membre']) AND isset($_POST['contenu']))
- {
- $membre = ($_POST['membre']);
- $secteur = ($_POST['secteur']);
- $contenu = ($_POST['contenu']);// On vérifie si c'est une modification de news ou pas
- if ($_POST['id_rpt'] == 0)
- {
- // Ce n'est pas une modification, on crée une nouvelle entrée dans la table
- mysql_query("INSERT INTO rapport VALUES('', '" . $contenu . "', '" . time() . "','" . $membre .
- "','" . $secteur ."')" );
- }
- else
- {
- // C'est une modification, on met juste à jour le secteur et le contenu
- mysql_query("UPDATE rapport SET contenu='" . $contenu . "', secteur='" . $secteur . "'WHERE id=" . $_POST['id_rpt']);
- }
- }
- //--------------------------------------------------------
- // Vérification 2 : est-ce qu'on veut supprimer une news ?
- //--------------------------------------------------------
- if (isset($_GET['supprimer_rpt'])) // Si on demande de supprimer une news
- {
- // Alors on supprime la news correspondante
- mysql_query('DELETE FROM rapport WHERE id=' . $_GET['supprimer_rpt']);
- }
- ?>
- <table><tr>
- <th>Modifier</th>
- <th>Supprimer</th>
- <th>secteur</th>
- <th>Date</th>
- <th>Rapport</th>
- </tr>
- <?php
- $retour = mysql_query('SELECT * FROM rapport ORDER BY id DESC');
- while ($donnees = mysql_fetch_array($retour)) // On fait une boucle pour lister les news
- {
- ?>
- <tr>
- <td><?php echo '<a href="rediger_rpt.php?modifier_rpt=' . $donnees['id'] . '">'; ?>
- >Modifier</a></td>
- <td><?php echo '<a href="liste_rpt.php?supprimer_rpt=' . $donnees['id'] . '">'; ?>
- >Supprimer</a></td>
- <td><?php echo stripslashes($donnees['secteur']); ?></td>
- <td><?php echo date('d/m/Y', $donnees['timestamp']); ?></td>
- <td><?php echo stripslashes($donnees['contenu']); ?></td>
- </tr>
- <?php
- } // Fin de la boucle qui liste les news
- ?>
- </table>
- <h2><a href="index.php">Index</a></h2>
- <br /><h2><a href="../accueil.php">Accueil</a></h2>
- </body>
- </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
|