Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
642 connectés 

 


 Mot :   Pseudo :  
 
 Page :   1  2
Page Suivante
Auteur Sujet :

action submit

n°1143699
bingojm
Posté le 07-07-2005 à 21:58:51  profilanswer
 

Reprise du message précédent :
là je ne connais pas... je dois mettre où exactement ce <cpp> et <\cpp>? merci

mood
Publicité
Posté le 07-07-2005 à 21:58:51  profilanswer
 

n°1143702
snarky
Posté le 07-07-2005 à 22:02:28  profilanswer
 

:lol:
 
tu edit ton message de 800lignes avec http://forum-images.hardware.fr/themes_static/images_forum/1/edit.gif
 
et tu met ton code entre

Code :

et non <cpp> </cpp>


Message édité par snarky le 07-07-2005 à 22:03:00
n°1143707
bingojm
Posté le 07-07-2005 à 22:11:18  profilanswer
 

Comme quoi on en apprend tous les jours;) Merci snarky

Code :
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type"
  4. content="text/html; charset=iso-8859-1">
  5. <meta http-equiv="Expires" content="Mon, 31 Dec 2001 20:01:00 GMT">
  6. <meta http-equiv="Pragma" content="no-cache">
  7. <meta http-equiv="Cache-Control" content="no-cache">
  8. <title>Livre d'Or</title>
  9. </head>
  10. <?php
  11.   require("livredor.txt" );
  12.   $pass = "***";
  13.   $webmaster = "***";
  14.   $ext = "php";
  15.   function stringpos($c,$s)
  16.   {
  17.     global $ext;
  18.     $posi=strpos($s,$c);
  19.     if ($ext!='php3') {
  20.       if ($posi===FALSE) {
  21.         $posi=-1;
  22.       }
  23.     }
  24.     else {
  25.       if (is_string($posi) && !$posi) {
  26.         $posi=-1;
  27.       }
  28.     }
  29.     return $posi;
  30.   }
  31.   function stringalignsx($s)
  32.   {
  33.     $res=chr(ord($s)-1);
  34.     return $res;
  35.   }
  36.   function stringalignsy($s)
  37.   {
  38.     $res=chr(ord($s)+1);
  39.     return $res;
  40.   }
  41.   function stringcopy($s,$p,$l)
  42.   {
  43.     $res=substr($s,$p-1,$l);
  44.     return $res;
  45.   }
  46.   function stringlength($s)
  47.   {
  48.     $res=strlen($s);
  49.     return $res;
  50.   }
  51.   function conv0($t)
  52.   {
  53.     if (strlen($t) == 1) {
  54.       $t="0".$t;
  55.     }
  56.     return $t;
  57.   }
  58.   function GetString(&$r)
  59.   {
  60.     if (stringpos("+",$r)>=0) {
  61.       $res=stringcopy($r,1,stringpos("+",$r)-1);
  62.       $r=stringcopy($r,stringpos("+",$r)+1,stringlength($r));
  63.     }
  64.     else {
  65.       $res=$r;
  66.       $r="";
  67.     }
  68.     return $res;
  69.   }
  70.   function MakeLstMots($s)
  71.   {
  72.     if ($s!="" ) {
  73.       $s=ltrim($s);
  74.       while (($s!="" ) && (stringpos(" ",$s)>=0)) {
  75.         $LstMots[]=UpCaseAllSp(stringcopy($s,1,stringpos(" ",$s)-1));
  76.         $s=stringcopy($s,stringpos(" ",$s)+1,stringlength($s));
  77.       }
  78.       if ($s!="" ) {$LstMots[]=UpCaseAllSp($s);}
  79.     }
  80.     return $LstMots;
  81.   }
  82.   function search($don,$mots)
  83.   {
  84.     if ($mots!="" ) { $LstMots=MakeLstMots($mots); }
  85.     if (file_exists($don)) {
  86.       $fic=file($don);
  87.       reset($fic);
  88.       $i=0;
  89.       while ($val=each($fic)) {
  90.         $ligne=$val[1];
  91.         $i++;
  92.         if ($mots=="" ) { $found=true; }
  93.         else {
  94.           $found=false;
  95.           $foundm=false;
  96.           for ($l=0;$l<count($LstMots);$l++) {
  97.             if (stringpos("+",$LstMots[$l])>=0) {
  98.               $inter=$LstMots[$l];
  99.               $foundm=true;
  100.               while (($inter!="" ) && $foundm) {
  101.                 $foundm=$foundm && (stringpos(GetString($inter),UpCaseAllSp($ligne))>=0);
  102.               }
  103.             }
  104.             else {
  105.               $foundm=$foundm ||
  106.                       (stringpos($LstMots[$l],
  107.                        UpCaseAllSp($ligne))>=0);
  108.             }
  109.           }
  110.           $found=$foundm;
  111.         }
  112.         if ($found) { $SearchResult[]=$ligne.";".$i; }
  113.       }
  114.     }
  115.     return $SearchResult;
  116.   }
  117.   function stringcopysx($s)
  118.   {
  119.     $sd='';
  120.     for ($i=1;$i<=strlen($s);$i++) {
  121.       if (stringcopy($s,$i,1)=='"') {
  122.         $sd=$sd.stringcopy($s,$i,1);
  123.       }
  124.       else {
  125.         if (stringcopy($s,$i,2)=='\!') {
  126.           $sd=$sd.'!';
  127.           $i++;
  128.         }
  129.         else {
  130.           if (stringcopy($s,$i,2)=='\&') {
  131.             $sd=$sd.'&';
  132.             $i++;
  133.           }
  134.           else {
  135.             $sd=$sd.stringalignsx(stringcopy($s,$i,1));
  136.           }
  137.         }
  138.       }
  139.     }
  140.     return $sd;
  141.   }
  142.   function secure($chaine)
  143.   {
  144.     return htmlspecialchars($chaine);
  145.   }
  146.   function HTMLEncode($text)
  147.   {
  148.     $searcharray =  array(
  149.      "'([-_\w\d.]+@[-_\w\d.]+)'",
  150.      "'((?:(?!://).{3}|^.{0,2}))(www\.[-\d\w\.\/\?=&]+)'",
  151.      "'(http[s]?:\/\/[-_~\w\d\.\/\?=&]+)'" ); 
  152.     $replacearray = array(
  153.      "<a href=\"mailto:\\1\">\\1</a>",
  154.      "\\1http://\\2",
  155.      "<a href=\"\\1\" target=\"new\">\\1</a>" );
  156.     return nl2br(preg_replace($searcharray, $replacearray,
  157.                  stripslashes($text) ));
  158.   }
  159.   function TexteEncode($texte)
  160.   {
  161.     $texte=str_replace(".,",";",$texte);
  162.     $texte=str_replace("|:-)","<img src=\"livredor/sm01.gif\" align=\"absmiddle\">",$texte);
  163.     $texte=str_replace("|:-(","<img src=\"livredor/sm02.gif\" align=\"absmiddle\">",$texte);
  164.     $texte=str_replace("|;-)","<img src=\"livredor/sm03.gif\" align=\"absmiddle\">",$texte);
  165.     $texte=HTMLEncode($texte);
  166.     return $texte;
  167.   }
  168.   function PrepPage(&$Ficw)
  169.   {
  170.     $s="=q!bmjho>\"dfoufs\"?=b!isfg>\"iuuq;00";
  171.     $s=$s."gbobufl/gsff/gs\"!ubshfu>\"ofx\"?";
  172.     $Ficw[]=stringcopysx($s);
  173.     $s="=jnh!tsd>\"iuuq;00gbobufl/gsff/gs";
  174.     $s=$s."0jnbhft0mjwsfeps/hjg\"";
  175.     $s=$s."!cpsefs>1!ujumf>\"Wfof{!ufmfdibshfs!df!mjwsf!e(Ps!hsb";
  176.     $s=$s."uvju!fu!jotubmmf{.mf!tvs!wpusf!tjuf!fo!rvfmrvft!njovuft\"?=0b?=0q?";
  177.     $Ficw[]=stringcopysx($s);
  178.     $s="=0CPEZ0IUNM?";
  179.     $Ficw[]=stringcopysx(stringcopy($s,1,6)."?" );
  180.     $Ficw[]=stringcopysx("=".stringcopy($s,7,6));
  181.   }
  182.   function CountPages(&$Ficw,$nmestot,$nmes,&$npag,$mot,$nofb,$nof,$Idx)
  183.   {
  184.     global $ext,$fnnpg,$ftnpg,$fcnpg,$fnpgc,$ftpgc,$fcpgc;
  185.            $s0='';$nn=3;
  186.     if ($nmestot>$nmes) {
  187.       if ($npag=="" ) { $npag=1; }
  188.       $nbpage=$nmestot/$nmes;
  189.       if (($nmestot%$nmes)!=0) { $nbpage++; }
  190.       $Ficw[]="<CENTER>";
  191.       $Ficw[]="<TABLE WIDTH=90% BORDER=1 CELLPADDING=4 CELLSPACING=0 FRAME=HSIDES>";
  192.       $Ficw[]="<COL WIDTH=256*>";
  193.       $Ficw[]="<TR>";
  194.       $Ficw[]="<TD WIDTH=100%>";
  195.       $Ficw[]="<P ALIGN=CENTER>";
  196.       if ($mot=="" ) { $adr="livredor.$ext?action=readall";}
  197.       else {$adr="livredor.$ext?action=read&mots=$mots";}
  198.       $fnpag="<FONT FACE=$fnnpg><FONT SIZE=\"$ftnpg\"><FONT COLOR=\"$fcnpg\">";
  199.       $fpagc="<FONT FACE=$fnpgc><FONT SIZE=\"$ftpgc\"><FONT COLOR=\"$fcpgc\"><B>";
  200.       $Ficw[]=$fpagc."Page ".$nofb;
  201.       $pgsuiv=$npag+1;
  202.       $pgprec=$npag-1;
  203.       if ($npag!=1) {
  204.         $Ficw[]="<a href=\"$adr&npag=$pgprec\">".$fnpag."<<".$nof."</a> ";
  205.       }
  206.       for ($i=1;$i<=$nbpage;$i++) {
  207.         if ($i!=$npag) {
  208.           $Ficw[]="<a href=\"$adr&npag=$i\">".$fnpag.$i.$nof."</a> ";
  209.         }
  210.         else {
  211.           $Ficw[]=$fpagc."$i ".$nofb;
  212.         }
  213.       }
  214.       if ($npag!=$nbpage) {
  215.         $Ficw[]=" <a href=\"$adr&npag=$pgsuiv\">".$fnpag.">>".$nof."</a>";
  216.       }
  217.       $Ficw[]="</P>";
  218.       $Ficw[]="</TD>";
  219.       $Ficw[]="</TR>";
  220.       $Ficw[]="</TABLE>";
  221.       $Ficw[]="</CENTER>";
  222.       $Ficw[]="<BR>";
  223.     }
  224.     else {
  225.       $fnpag="<FONT FACE=$fnnpg><FONT SIZE=\"$ftnpg\"><FONT COLOR=\"$fcnpg\">";
  226.       $fpagc="<FONT FACE=$fnpgc><FONT SIZE=\"$ftpgc\"><FONT COLOR=\"$fcpgc\"><B>";}
  227.       if ($Idx!=0) {
  228.         for ($i=0;$i<=$nn;$i++) {
  229.           $Ficw[]=$Ficw[$Idx+$i];
  230.           $Ficw[$Idx+$i]=$s0;
  231.         }
  232.       $ficw[]=$fpagc."Page ".$nofb;
  233.       $ficw[]="</P>";
  234.       $ficw[]="</TD>";
  235.       $ficw[]="</TR>";
  236.       $ficw[]="</TABLE>";
  237.       $ficw[]="</CENTER>";
  238.       $ficw[]="<BR>";
  239.     }
  240.   }
  241.   function limit($s,$max)
  242.   {
  243.     $split=split(" ",$s);
  244.     $nmots=count($split);
  245.     $so="";
  246.     for ($i=0;$i<$nmots;$i++) {
  247.       $url=($i>0) && ($split[$i-1]=="<a" ) &&
  248.            (stringpos("href=",$split[$i])==0);
  249.       if ((!$url) && (strlen($split[$i])>$max)) {
  250.         $nbm=(strlen($split[$i])/$max)+1;
  251.         $mot=stringcopy($split[$i],1,$max);
  252.         for ($j=1;$j<=$nbm;$j++) {
  253.           $mot=$mot." ".stringcopy($split[$i],$j*$max+1,$max);
  254.         }
  255.         $split[$i]=$mot;
  256.       }
  257.       if ($i==0) {$so=$split[$i];}
  258.       else {$so=$so." ".$split[$i];}
  259.     }
  260.     return $so;
  261.   }
  262.   function CreatePage($mots,$res,$SearchResult,$npag)
  263.   {
  264.   global  $ltab,$tbord,$nmes,$nmax,
  265.           $tbcel1,$lcel2,$tbcel2,$lcel3,$tbcel3,$tbcel4,
  266.           $cfond,$cbord,$cbclair,$cbfonce,$cbbckimg,$cfdat,$cbdat,$cbcdat,$cbfdat,
  267.           $cfnom,$cbnom,$cbcnom,$cbfnom,$cfurl,$cburl,$cbcurl,$cbfurl,
  268.           $cftxt,$cbtxt,$cbctxt,$cbftxt,
  269.           $fccompt,$ftcompt,$fncompt,$fcsign,$ftsign,$fnsign,
  270.           $fcnom,$ftnom,$fnnom,$fcurl,$fturl,$fnurl,
  271.           $fctxt,$fttxt,$fntxt,$anbm,$fcnumm,$fnnumm,$ftnumm,
  272.           $fcnpg,$ftnpg,$fnnpg,$fcpgc,$ftpgc,$fnpgc,$ext,$webmaster;
  273.           $ac="bob";$bc="ff/gs";$Ficw=file($res);$s="g".$ac."ufl/gs".$bc."\"!ubshfu>\"ofx\"?";
  274.           end($Ficw);$s="=q!bmjho>\"dfoufs\"?=b!isfg>\"iuuq;00".$s;$Idx=count($Ficw);
  275.           $Ficw[]=stringcopysx($s);$s="=jnh!tsd>\"iuuq;00g".stringcopy($ac,1,2)."bufl/gs".$bc;
  276.           $s=$s."0jnbhft0mjwsfeps/hjg\"";$s=$s."!cpsefs>1!ujumf>\"Wfof{!ufmfdibshfs!df!mjwsf!e(Ps!hsb";
  277.           $s=$s."uvju!fu!jotubmmf{.mf!tvs!wpusf!tjuf!fo!rvfmrvft!njovuft\"?=0b?=0q?";
  278.           $Ficw[]=stringcopysx($s);
  279.           $s="=0CPEZ?=0IUNM?";
  280.           $Ficw[]=stringcopysx(stringcopy($s,1,7));
  281.           $Ficw[]=stringcopysx(stringcopy($s,8,7));
  282.     if ($mots!="" ) {
  283.       $Ficw[]="<P ALIGN=LEFT STYLE=\"text-decoration: none\"><FONT COLOR=\"$fccompt\">".
  284.               "<FONT FACE=\"$fncompt\"><FONT SIZE=$ftcompt><B>Recherche de :";
  285.       $Ficw[]=$mots." </B></FONT></FONT></FONT></P>";
  286.     }
  287.     $Ficw[]="<P ALIGN=$anbm STYLE=\"text-decoration: none\"><FONT COLOR=\"$fccompt\">".
  288.               "<FONT FACE=\"$fncompt\"><FONT SIZE=$ftcompt><B>".count($SearchResult);
  289.     if ($mots!="" ) {$Ficw[]=" messages trouvés</B></FONT></FONT></FONT></P>"; }
  290.     else           {$Ficw[]=" messages</B></FONT></FONT></FONT></P>"; }
  291.     $nofb="</B></FONT></FONT></FONT>";
  292.     $nof="</FONT></FONT></FONT>";
  293.     $fsign="<FONT FACE=$fnsign><FONT SIZE=\"$ftsign\"><FONT COLOR=\"$fcsign\">";
  294.     $fnumm="<FONT FACE=$fnnumm><FONT SIZE=\"$ftnumm\"><FONT COLOR=\"$fcnumm\">";
  295.     $fnom="<FONT FACE=$fnnom><FONT SIZE=\"$ftnom\"><FONT COLOR=\"$fcnom\"><B>";
  296.     $fip="<FONT FACE=$fnnom><FONT SIZE=\"0\"><FONT COLOR=\"$fcnom\">";
  297.     $furl="<FONT FACE=$fnurl><FONT SIZE=\"$fturl\"><FONT COLOR=\"$fcurl\"><B>";
  298.     $ftxt="<FONT FACE=\"$fntxt\"><FONT SIZE=$fttxt><FONT COLOR=\"$fctxt\">";
  299.     $ptab="border=\"$tbord\" width=\"$ltab\" bgcolor=\"$cfond\" bordercolor=\"$cbord\"
  300.            bordercolordark=\"$cbfonce\" bordercolorlight=\"$cbclair\"";
  301.     //no background
  302.     $pcel1="bgcolor=\"$cfdat\" bordercolor=\"$cbdat\"
  303.             bordercolordark=\"$cbfdat\" bordercolorlight=\"$cbcdat\"";
  304.     $pcel23="bgcolor=\"$cfnom\" bordercolor=\"$cbnom\"
  305.             bordercolordark=\"$cbfnom\" bordercolorlight=\"$cbcnom\"";
  306.     $pcel2="width=\"$lcel2\" bgcolor=\"$cfnom\" bordercolor=\"$cbnom\"
  307.             bordercolordark=\"$cbfnom\" bordercolorlight=\"$cbcnom\"";
  308.     $pcel3="width=\"$lcel3\" bgcolor=\"$cfurl\" bordercolor=\"$cburl\"
  309.             bordercolordark=\"$cbfurl\" bordercolorlight=\"$cbcurl\"";
  310.     $pcel4="width=\"100%\" bgcolor=\"$cftxt\" bordercolor=\"$cbtxt\"
  311.             bordercolordark=\"$cbftxt\" bordercolorlight=\"$cbctxt\"";
  312.     $nmestot=count($SearchResult);
  313.     CountPages($Ficw,$nmestot,$nmes,$npag,$mot,$nofb,$nof,$idx);
  314.     $bi=($npag-1)*$nmes;
  315.     $bs=$npag*$nmes;
  316.     for ($i=$nmestot-1;$i>=0;$i--) {
  317.       $ii=$nmestot-$i;
  318.       if ( ($npag=="" ) || (($bi<$ii) && ($ii<=$bs)) ) {
  319.         $atab=split(";",$SearchResult[$i],13);
  320.         $date=$atab[0];
  321.         $nom=str_replace(".,",";",$atab[1]);
  322.         $email=str_replace(".,",";",$atab[2]);
  323.         $url=str_replace(".,",";",$atab[3]);
  324.         $texte=TexteEncode($atab[4]);
  325.         $nom=limit($nom,40);
  326.         $texte=limit($texte,90);
  327.         $ip=""; //no ip
  328.         $wmtexte=TexteEncode($atab[6]);
  329.         $num=$atab[12];
  330.         $href="http://www.fisenne.be/fichiers/livredor/livredor.$ext?action=edit&numligne=$num";
  331.         $Ficw[]="<CENTER>";
  332.         $Ficw[]="<table $ptab>";
  333.         $Ficw[]="<tr>";
  334.         $Ficw[]="<td width=\"$lcel2\" $pcel1><p align=\"left\">".$fsign.$date.$nof."</p></td>";
  335.         $Ficw[]="<td width=\"$lcel3\" $pcel1><p align=\"right\">"."<a href=$href>".$fnumm.$num.$nof."</a></p></td>";
  336.         $Ficw[]="</tr>";
  337.         $Ficw[]="<tr>";
  338.         if (strtoupper($url)=="HTTP://" ) {$url="";}
  339.         $ucnom=UpCaseAllSp($nom);
  340.         if (($ucnom==UpCaseAllSp($webmaster)) || ($ucnom=="WEBMASTER" )) {
  341.           $wmi="<img src=\"http://www.fisenne.be/fichiers/livredor/webmaster.gif\" align=\"absmiddle\"> ";
  342.           $ip=""; //masquage IP webmaster
  343.         }
  344.         else {
  345.           $wmi="";
  346.         }
  347.         if ($ip!="" ) {
  348.           $iptab=explode(".",$ip);
  349.           $ip=$fip." (".$iptab[0].".".$iptab[1].".".$iptab[2].".---)".$nof;
  350.         }
  351.         if ($url!="" ) {
  352.           if (stringpos("HTTP://",strtoupper($url))!=0) {
  353.             $url="http://".$url;
  354.           }
  355.           $urltxt=limit($url,40);
  356.           if ($email!="" ) {
  357.             $Ficw[]="<td $pcel2>".$wmi."<a href=mailto:$email><img src=\"http://www.fisenne.be/fichiers/livredor/email.gif\" align=\"absmiddle\" border=0 title=\"Envoyez-moi un email - Send me an email\"></a> <a href=mailto:$email>".$fnom.$nom.$nofb."</a>".$ip."</td>";
  358.           }
  359.           else {
  360.             $Ficw[]="<td $pcel2>".$wmi.$fnom.$nom.$nofb.$ip."</td>";
  361.           }
  362.           $Ficw[]="<td $pcel3><a href=\"$url\" target=\"new\"><img src=\"http://www.fisenne.be/fichiers/livredor/www.gif\" align=\"absmiddle\" border=0 title=\"Visitez mon site - Visit my website\"></a> <a href=\"$url\" target=\"new\">".$furl.$urltxt.$nofb."</a></td>";
  363.         }
  364.         else {
  365.           if ($email!="" ) {
  366.             $Ficw[]="<td colspan=\"2\" $pcel23>".$wmi."<a href=mailto:$email><img src=\"http://www.fisenne.be/fichiers/livredor/email.gif\" align=\"absmiddle\" border=0 title=\"Envoyez-moi un email - Send me an email\"></a> <a href=mailto:$email>".$fnom.$nom.$nofb."</a>".$ip."</td>";
  367.           }
  368.           else {
  369.             $Ficw[]="<td colspan=\"2\" $pcel23>".$wmi.$fnom.$nom.$nofb.$ip."</td>";
  370.           }
  371.         }
  372.         $Ficw[]="</tr>";
  373.         $Ficw[]="<tr>";
  374.         if ($wmtexte=="" ) {
  375.           $Ficw[]="<td colspan=\"2\" $pcel4>".$ftxt.$texte.$nof."</td>";
  376.         }
  377.         else {
  378.           $Ficw[]="<td colspan=\"2\" $pcel4>".$ftxt.$texte."<BR><HR><I><B>$webmaster : </B>".$wmtexte.$nof."</I></td>";
  379.         }
  380.         $Ficw[]="</tr>";
  381.         $Ficw[]="</table>";
  382.         $Ficw[]="</CENTER>";
  383.         $Ficw[]="<BR>";
  384.       }
  385.     }
  386.     CountPages($Ficw,$nmestot,$nmes,$npag,$mot,$nofb,$nof,$Idx);
  387.     return $Ficw;
  388.   }
  389.   function convert($ligne,$secureit,$wm)
  390.   {
  391.     $inter="";
  392.     if ($ligne!="" ) {
  393.       $bold=false;$under=false;$ital=false;
  394.       if ($secureit) {$ligne=secure($ligne);}
  395.       for ($i=0;$i<stringlength($ligne);$i++) {
  396.         $add=$ligne[$i];
  397.         if ($ligne[$i]==";" ) {
  398.           $add=".,";
  399.         }
  400.         if ($ligne[$i]=="\r" ) {
  401.           $add="<BR>";
  402.           if ($bold)  { $add="</B>" .$add;  $bold=false; }
  403.           if ($under) { $add="</U>" .$add; $under=false; }
  404.           if ($ital)  { $add="</EM>".$add;  $ital=false; }
  405.           $i++; // pour sauter le #10
  406.         }
  407.         if ($ligne[$i]=="$" ) {
  408.           $i++;
  409.           $c=strtoupper($ligne[$i]);
  410.           if ($c=="G" ) { $add="<B>" ; $bold=true; }
  411.           if ($c=="S" ) { $add="<U>" ;$under=true; }
  412.           if ($c=="I" ) { $add="<EM>"; if (!$wm) {$ital=true;} }
  413.           if (($c!="G" )&&($c!="S" )&&($c!="I" )) { $add="$";$i--; }
  414.         }
  415.         if ($ligne[$i]==" " ) {
  416.           if ($bold)  { $add="</B>" .$add;  $bold=false; }
  417.           if ($under) { $add="</U>" .$add; $under=false; }
  418.           if ($ital)  { $add="</EM>".$add;  $ital=false; }
  419.         }
  420.         $inter=$inter.$add;
  421.       }
  422.       $add="";
  423.       if ($bold)  { $add="</B>" ;  $bold=false; }
  424.       if ($under) { $add="</U>" ; $under=false; }
  425.       if ($ital)  { $add="</EM>";  $ital=false; }
  426.       $inter=$inter.$add;
  427.       $inter=StripSlashes($inter);
  428.     }
  429.     return $inter;
  430.   }
  431.   function produceHTML($f)
  432.   {
  433.     $fic=file($f);
  434.     reset($fic);
  435.     while ($val=each($fic)) {
  436.       echo "$val[1]";
  437.     }
  438.   }
  439.   function echopage($page)
  440.   {
  441.     reset($page);
  442.     if (stringpos('http',$page[count($page)-3])==-1) {PrepPage($page);}
  443.     while ($val=each($page)) {
  444.       echo "$val[1]";
  445.     }
  446.   }
  447.   function preptodel($don)
  448.   {
  449.     global $ext;
  450.     echo "<form action=\"livredor.$ext\" method=\"GET\">";
  451.     echo "<p><input type=\"hidden\" name=\"action\" value=\"delete\"><font face=\"Arial\"><strong>Mot de passe </strong><input type=\"password\" size=\"20\"";
  452.     echo "name=\"mdpass\"></p>";
  453.     echo "<p><input type=\"submit\" name=\"B1\"";
  454.     echo "value=\"Détruire les messages cochés\"></p>";
  455.     $fic=file($don);
  456.     reset($fic);
  457.     $i=0;
  458.     while ($val=each($fic)) {
  459.       $i++;
  460.       echo "<p><input type=\"checkbox\" name=\"numligne[]\" value=\"$i\">$val[1]</p>";
  461.     }
  462.     echo "</form>";
  463.   }
  464.   function preptomod($don,$numligne)
  465.   {
  466.     global $ext;
  467.     echo "<form action=\"livredor.$ext\" method=\"GET\">";
  468.     echo "<p><input type=\"hidden\" name=\"numligne\" value=\"$numligne\"></p>";
  469.     echo "<p align=\"center\"><input type=\"hidden\" name=\"action\" value=\"edit\"><font face=\"Arial\"><strong>Mot de passe </strong><input type=\"password\" size=\"20\"";
  470.     echo "name=\"mdpass\">";
  471.     echo "<input type=\"submit\" name=\"B1\" value=\"Ok\"</p>";
  472.     echo "<p align=\"center\"><font ";
  473.     echo "face=\"Arial\" size=\"2\">Pour détruire plusieurs messages en une fois <a href=\"livredor.$ext?action=delete\">cliquez ici</a></font></p>";
  474.     echo "</form>";
  475.   }
  476.   function isin($i,$numligne,$edit)
  477.   {
  478.     if ($edit=="edit" ) {
  479.       if ($numligne==$i) {$found=true;}
  480.     }
  481.     else {
  482.       $found=false;
  483.       for ($j = 0; $j < count($numligne); $j++)
  484.       {
  485.        if ($numligne[$j]==$i) {$found=true;}
  486.       }
  487.     }
  488.     return $found;
  489.   }
  490.   function deletec($don,$numligne,$edit)
  491.   {
  492.     $fic=file($don);
  493.     $ficw=fopen($don,"w+" );
  494.     $nl=count($fic);
  495.     reset($fic);
  496.     $i=0;
  497.     while ($val=each($fic)) {
  498.       $i++;
  499.       if (!isin($i,$numligne,$edit)) {
  500.         $s=$val[1];
  501.         fwrite($ficw,$s);
  502.       }
  503.       else {
  504.         $last=($i==$nl);
  505.         echo "<p><font face=\"Arial\">Destruction de la ligne : <em>$val[1]</em></font></p>";
  506.       }
  507.     }
  508.     fclose($ficw);
  509.     if ($last) {
  510.       $fic=file($don);
  511.      $ficw=fopen($don,"w+" );
  512.       $nl=count($fic);
  513.       reset($fic);
  514.       $i=0;
  515.       while ($val=each($fic)) {
  516.         $i++;
  517.         $s=$val[1];
  518.         if ($i==$nl) {$s=trim($s);}
  519.         fwrite($ficw,$s);
  520.       }
  521.       fclose($ficw);
  522.     }
  523.     if ($edit!="edit" ) {
  524.       echo "<HR size=\"1\">";
  525.       echo "<BR>";
  526.     }
  527.   }
  528.   function getmodif($don,$numligne,$mdpass)
  529.   {
  530.     global $ext;
  531.     $fic=file($don);
  532.     reset($fic);
  533.     $i=0;
  534.     $s="";
  535.     while ( ($val=each($fic)) && ($s=="" ) ) {
  536.       $i++;
  537.       if ($i==$numligne) {
  538.         $s=$val[1];
  539.       }
  540.     }
  541.     $atab=explode(";",$s);
  542.     $nom=$atab[1];
  543.     $email=$atab[2];
  544.     $url=$atab[3];
  545.     $texte=$atab[4];
  546.     $ip=$atab[5];
  547.     $wmtexte=$atab[6];
  548.     echo "<form action=\"livredor.$ext\" method=\"GET\">";
  549.     echo "<p><input type=\"hidden\" name=\"action\" value=\"edit\">";
  550.     echo "<input type=\"hidden\" name=\"mdpass\" value=\"$mdpass\">";
  551.     echo "<input type=\"hidden\" name=\"numligne\" value=\"$numligne\"></p>";
  552.     echo "<p><font face=\"Arial\">nom :</font></p>";
  553.     echo "<p><input type=\"text\" size=\"75\" name=\"nom\" value=\"$nom\"></p>";
  554.     echo "<p><font face=\"Arial\">IP : $ip</font></p>";
  555.     echo "<p><font face=\"Arial\">email :</font></p>";
  556.     echo "<p><input type=\"text\" size=\"75\" name=\"email\" value=\"$email\"></p>";
  557.     echo "<p><font face=\"Arial\">url :</font></p>";
  558.     echo "<p><input type=\"text\" size=\"75\" name=\"url\" value=\"$url\"></p>";
  559.     echo "<p><font face=\"Arial\">Message d'origine à modifier :</font></p>";
  560.     echo "<p><textarea name=\"texte\" rows=\"8\" cols=\"80\">$texte</textarea></p>";
  561.     echo "<p><font face=\"Arial\">Réponse au message :</font></p>";
  562.     echo "<p><textarea name=\"wmtexte\" rows=\"8\" cols=\"80\">$wmtexte</textarea></p>";
  563.     echo "<p><input type=\"submit\" name=\"B1\" value=\"Valider les modifications\"></p>";
  564.     echo "</form>";
  565.     echo "<form action=\"livredor.$ext\" method=\"GET\">";
  566.     echo "<p><input type=\"hidden\" name=\"action\" value=\"delete\">";
  567.     echo "<input type=\"hidden\" name=\"edit\" value=\"edit\">";
  568.     echo "<input type=\"hidden\" name=\"mdpass\" value=\"$mdpass\">";
  569.     echo "<input type=\"hidden\" name=\"numligne\" value=\"$numligne\"></p>";
  570.     echo "<p><input type=\"submit\" name=\"B1\" value=\"Détruire le message\"></p>";
  571.     echo "</form>";
  572.   }
  573.   function modif($don,$numligne,$nom,$email,$url,$texte,$wmtexte)
  574.   {
  575.     $fic=file($don);
  576.     $ficw=fopen($don,"w+" );
  577.     $nl=count($fic);
  578.     reset($fic);
  579.     $i=0;
  580.     $found=false;
  581.     while (($val=each($fic)) && (!$found)) {
  582.       $i++;
  583.       $s=$val[1];
  584.       if ($i==$numligne) {
  585.         echo "<p><font face=\"Arial\">Modification de la ligne : <em>$val[1]</em></font></p>";
  586.         $atab=explode(";",$s);
  587.         $atab[1]=convert($nom,false,false);
  588.         $atab[2]=convert($email,false,false);
  589.         $atab[3]=convert($url,false,false);
  590.         $atab[4]=convert($texte,false,false);
  591.         $atab[6]=convert($wmtexte,true,true);
  592.         $s=implode(";",$atab);
  593.         echo "<p><font face=\"Arial\">--------> nouvelle ligne : <em>$s</em></font></p>";
  594.         //$found=true;
  595.       }
  596.       fwrite($ficw,$s);
  597.     }
  598.     fclose($ficw);
  599.   }
  600.   function NotYet($don,$texte,$testIP)
  601.   {
  602.     if (file_exists($don)) {
  603.       $texteloc=convert($texte,true,false);
  604.       $fic=file($don);
  605.       $nbm=count($fic);
  606.       reset($fic);
  607.       $yet=1;
  608.       while (($nbm>0) && ($val=each($fic)) && ($yet!=0)):
  609.         $ligne=$val[1];
  610.         $atab=explode(";",$ligne);
  611.         $letexte=$atab[4];
  612.         $yet=strcasecmp($letexte,$texteloc); //0 si ==
  613.       endwhile;
  614.       if (($nbm>4) && ($yet!=0) && ($testIP)) {
  615.         $ipcrt=getenv(REMOTE_ADDR);
  616.         if ($ipcrt=="" ) {$ipcrt="noip";} // pour pb iFrance
  617.         end($fic);
  618.         for ($i=1;$i<=4;$i++) {prev($fic);}
  619.         $sameip=0;
  620.         while (($val=each($fic)) && ($sameip==0)):
  621.           $ligne=$val[1];
  622.           $atab=split(";",$ligne,5);
  623.           $letexte=$atab[4];
  624.           if (stringpos(";",$letexte)>=0) {
  625.             $btab=explode(";",$letexte);
  626.             $ip=$btab[1];
  627.           }
  628.           else {$ip="";}
  629.           $sameip=strcasecmp($ip,$ipcrt); //0 si ==
  630.         endwhile;
  631.         $yet=$sameip;
  632.       }
  633.     }
  634.     else {$yet=1;}
  635.     return $yet;
  636.   }
  637.   function UpDBase($don)
  638.   {
  639.     if (file_exists($don)) {
  640.       $fic=file($don);
  641.       reset($fic);
  642.       $val=each($fic);
  643.       $s=$val[1];
  644.       $n=count(explode(";",$s));
  645.       if ($n<=5) {
  646.         $ficw=fopen($don,"w+" );
  647.         $nl=count($fic);
  648.         reset($fic);
  649.         $i=0;
  650.         while ($val=each($fic)) {
  651.           $i++;
  652.           $s=$val[1];
  653.           $sd=trim($s);
  654.           if (($sd==";;;;" )||($sd=="" )) {
  655.             $numligne[]=$i;
  656.           }
  657.           if ($i!=$nl) {
  658.             $s=$sd.";;;;;;;";
  659.             fwrite($ficw,"$s \r\n" );
  660.           }
  661.           else {
  662.             $s=$s.";;;;;;;";
  663.             fwrite($ficw,$s);
  664.           }
  665.         }
  666.         fclose($ficw);
  667.         if (count($numligne)!=0) {deletec($don,$numligne,"" );}
  668.       }
  669.     }
  670.   }
  671. // ------------------------- MAIN
  672. ignore_user_abort(true);
  673. UpDBase($don);
  674. if ($action=="" ) {$action="readall";}
  675. if ($action=="read" ) {$res=$res1;}
  676. if ($action=="readall" ) {$res=$res2;}
  677. if ($action=="add" ) {$res=$res3;}
  678. if ($action=="delete" ) {$res=$res2;}
  679. if ($action=="edit" ) {$res=$res2;}
  680. if ($action=="add" ) {
  681.   if (($nom!="" ) && ($texte!="" )) {
  682.     $atab=explode(":",$nom);
  683.     $ucnom=UpCaseAllSp($atab[0]);
  684.     $testIP=true;
  685.     if (($ucnom==UpCaseAllSp($webmaster)) || ($ucnom=="WEBMASTER" )) {
  686.       if ($atab[1]!=$pass) {
  687.         $nom="Visiteur";
  688.         echo "<body onload=\"alert ('Mot de passe webmaster omis ou erroné : votre nom est remplacé par Visiteur')\">";
  689.       }
  690.       else {
  691.         $nom=$atab[0];
  692.         $testIP=false;
  693.       }
  694.     }
  695.     $testIP=($testIP && $noflood);
  696.     if (NotYet($don,$texte,$testIP)!=0) {
  697.       $blocked=false;
  698.       if (file_exists($don)) {
  699.         $rc="\r\n";
  700.         $fic=file($don);
  701.         reset($fic);
  702.         $max=$nmes*$nmax;
  703.         if (count($fic)==$max) {
  704.           next($fic);
  705.           $ficw=fopen($don,"w+" );
  706.           while ($val=each($fic)) {
  707.             fwrite($ficw,$val[1]);
  708.           }
  709.         }
  710.         else { $ficw=fopen($don,"a+" ); }
  711.       }
  712.       else {
  713.         $rc="";
  714.         $ficw=fopen($don,"w+" );
  715.       }
  716.       $date=getdate();
  717.       $mday=conv0($date[mday]);
  718.       $mon=conv0($date[mon]);
  719.       $hour=conv0($date[hours]);
  720.       $min=conv0($date[minutes]);
  721.       $email=str_replace(' ','_',$email);
  722.       fwrite($ficw,$rc.$mday."/".$mon."/".$date[year]." ".$hour.
  723.                    ":".$min.";".
  724.                    convert($nom,true,false).";".convert($email,true,false).";".convert($url,true,false).";".
  725.                    convert($texte,true,false).";".getenv(REMOTE_ADDR).";;;;;;" );
  726.       fclose($ficw);
  727.       if ($mailme!="" ) {
  728.         $sujet="Livre d'Or (c) Fanatek";
  729.         mail($mailme,$sujet,$message);
  730.       }
  731.     }
  732.     else {
  733.       $blocked=true;
  734.       echo "<body bgcolor=\"#FFFFFF\">";
  735.       echo "<p align=\"center\"><font color=\"#FF0000\" size=\"4\" face=\"Arial\"><strong><u>Message interdit";
  736.       echo "</u></strong></font></p>";
  737.       echo "<p align=\"left\"><font ";
  738.       echo "size=\"2\" face=\"Arial\">Vous avez tenté d'écrire un message identique au précédent, ou bien vous avez déposé 5 messages consécutifs sur ce livre</font>";
  739.       echo "</font></p>";
  740.       echo "<BR>";
  741.       echo "<p align=\"center\"><font ";
  742.      echo "size=\"2\" face=\"Arial\">Merci de bien vouloir </font>";
  743.    echo "</font><a href=\"http://www.fisenne.be/fichiers/menu.php?page=livredor\">retourner au Livre d'or (Cliquez ici)</a></p>";
  744.       echo "<BR>";
  745.           }
  746.   }
  747.   if (!$blocked) {
  748.     if ($option=="readall" ) {$action="readall";}
  749.     else {produceHTML($res);}
  750.   }
  751. }
  752. if (($action=="delete" ) || ($action=="edit" )) {
  753.   echo "<body bgcolor=\"#FFFFFF\">";
  754.   echo "<p align=\"center\"><font color=\"#660099\" size=\"6\" face=\"Arial\"><strong><u>Administration";
  755.   echo " des messages</u></strong></font></p>";
  756.   echo "<p align=\"center\"><font color=\"#FF0000\" size=\"4\" face=\"Arial\"><strong><u>Espace";
  757.   echo " réservé au webmaster</u></strong></font></p>";
  758.   echo "<p align=\"center\"><font ";
  759.   echo "size=\"2\" face=\"Arial\">Merci de bien vouloir </font>";
  760.   echo "</font><a href=\"http://www.fisenne.be/fichiers/menu.php?page=livredor\">retourner au Livre d'or (Cliquez ici)</a></p>";
  761.   echo "<BR>";
  762.   echo "<BR>";
  763. }
  764. if ($action=="delete" ) {
  765.   if ($numligne=="" ) {
  766.     preptodel($don);
  767.   }
  768.   else {
  769.     if ($mdpass==$pass) {
  770.       echo "<p><font face=\"Arial\" color=\"#00F000\">Mot de passe correct</font></p>";
  771.       deletec($don,$numligne,$edit);
  772.     }
  773.     else {
  774.       echo "<p><font face=\"Arial\" color=\"#FF0000\">Accès impossible : mot de passe erroné</font></p>";
  775.       echo "<HR size=\"1\">";
  776.       echo "<BR>";
  777.     }
  778.     $numligne="";
  779.     if ($edit!="edit" ) {
  780.       preptodel($don);
  781.     }
  782.   }
  783. }
  784. if ($action=="edit" ) {
  785.   if ($mdpass=="" ) {
  786.     if ($numligne!="" ) {
  787.       preptomod($don,$numligne);
  788.     }
  789.     else {
  790.       echo "<p><font face=\"Arial\">Modification d'un message : Cliquer sur le numéro du message à modifier</font></p>";
  791.     }
  792.   }
  793.   else {
  794.     if ($mdpass==$pass) {
  795.       echo "<p><font face=\"Arial\" color=\"#00F000\">Mot de passe correct</font></p>";
  796.       if ($texte=="" ) {
  797.         getmodif($don,$numligne,$mdpass);
  798.       }
  799.       else {
  800.         modif($don,$numligne,$nom,$email,$url,$texte,$wmtexte);
  801.         $numligne="";
  802.       }
  803.     }
  804.     else {
  805.       echo "<p><font face=\"Arial\" color=\"#FF0000\">Accès impossible : mot de passe erroné</font></p>";
  806.       echo "<HR size=\"1\">";
  807.       echo "<BR>";
  808.       preptomod($don,$numligne);
  809.     }
  810.   }
  811. }
  812. if (($action=="delete" ) || ($action=="edit" )) {
  813. }
  814. if (($action=="read" ) || ($action=="readall" )) {
  815.   if ($action!="read" ) { $mots=""; }
  816.   $SearchResult=search($don,$mots);
  817.   $page=CreatePage($mots,$res,$SearchResult,$npag);
  818.   echopage($page);
  819. }
  820. ?>
  821. </body>
  822. </html>


Message édité par bingojm le 07-07-2005 à 22:13:48
n°1143709
snarky
Posté le 07-07-2005 à 22:14:28  profilanswer
 

[/cpp]

n°1143710
snarky
Posté le 07-07-2005 à 22:15:05  profilanswer
 

whaoooo j'avais dit 800lignes et g t pas loin :p

n°1143711
plainsofpa​in
Pingouino's lover
Posté le 07-07-2005 à 22:15:37  profilanswer
 

non c'est [ cpp ]ton code[ /cpp ] ou la meme chose avec code au lieu de cpp.

n°1143715
bingojm
Posté le 07-07-2005 à 22:18:26  profilanswer
 

bon voilà qui est fait. Qui sait m'aider maintenant, on est près du but...
Quels sont les "get" que je dois remplacer par "post" dans ce code php? Merci

n°1143720
sielfried
Posté le 07-07-2005 à 22:28:15  profilanswer
 

Ca va être dur de t'aider avec tout ce bazar...
 
Dans ce cas refous get à la place de post dans le form, avec le input hidden. :sweat:


---------------
StarCraft Professional Gaming Database | [Ze Topic] Starcraft/BroodWar
n°1143726
bingojm
Posté le 07-07-2005 à 22:36:31  profilanswer
 

Faut abandonner alors, aucune solution pour moi?

n°1143727
sielfried
Posté le 07-07-2005 à 22:38:10  profilanswer
 

Ca marche pas non plus ?


---------------
StarCraft Professional Gaming Database | [Ze Topic] Starcraft/BroodWar
mood
Publicité
Posté le 07-07-2005 à 22:38:10  profilanswer
 

n°1143796
bingojm
Posté le 07-07-2005 à 23:29:22  profilanswer
 

ben on revient au point de départ si je remets comme avant?!

n°1143844
Profil sup​primé
Posté le 08-07-2005 à 00:23:13  answer
 

personnellement j'ai meme pas envie de trifouiller ton code : tu semble coder en register_globals à on, dès que je vois ca je vais pas plus loin dans le code...
utilise $_POST et $_GET après on verra
 
aussi, evite  
echo "<body bgcolor=\"#FFFFFF\">";
 
en masse, car ca consomme dans ton temps de generation de page pour rien, parsing inutile, et c'est illisible
 
fait plutot :

Code :
  1. <? $mavaleur='montexte'; ?>
  2. <form method="post" action="tapage.php">
  3. <input type="text" value="<?= $mavaleur; ?>">
  4. </form>
  5. <?
  6. /* suite de toncode ?>
  7. ?>


Message édité par Profil supprimé le 08-07-2005 à 00:24:03
n°1143906
sielfried
Posté le 08-07-2005 à 07:50:29  profilanswer
 

bingojm a écrit :

ben on revient au point de départ si je remets comme avant?!


 
Ben un peu wai, mais tu devrais pas avoir ta page toute blanche en validant...


---------------
StarCraft Professional Gaming Database | [Ze Topic] Starcraft/BroodWar
n°1774022
bingojm
Posté le 18-08-2008 à 09:49:04  profilanswer
 

sielfried a écrit :

T'avais bien dit "dans une nouvelle fenêtre". Ca n'a pas du tout la même signification...
 
Sinon ben jvois pas pourquoi tu mets http://www.monsite.be/fichiers/livredor/livredor.php en action quand l'url doit être de type  
 
Met action="" dans le form.


n°1774023
bingojm
Posté le 18-08-2008 à 09:49:31  profilanswer
 

micfont999 a écrit :


 
Je pense que livredor.pgp doit valider le formulaire..  :hello:


n°1774025
Profil sup​primé
Posté le 18-08-2008 à 09:54:50  answer
 

[:cerveau manust]

mood
Publicité
Posté le   profilanswer
 

 Page :   1  2
Page Suivante

Aller à :
Ajouter une réponse
 

Sujets relatifs
Selection d'une liste déroulante sans bouton submitRecup données html:select dans classe action
passage d'un champ saisie dans l'url (sans submit)Formulaire avec plusieurs 'action'
Affichier progression d'un action !Bouton d'action et lancement de macro avec arguments
calculer le nbr de lignes pour action d'une macro2 submit différents pour un seul formulaire
[php] Action submit pop upformulaire : action submit qd on appuis sur entree
Plus de sujets relatifs à : action submit


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR