Poster une réponse à un sujet: Test de code + php
Attention, ce sujet est un sujet ancien (7911 jours sans réponse)
Gras [b]Texte[/b] Italique [i]Italique[/i] Souligné [u]Souligné[/u] Barré [strike]Barré[/strike]
Courriel [email=nobody@nobody.org]Nom[/email] Lien [url=http://www.website.com]Texte[/url] Ancre [anchor]Nom[/anchor] Image [img]http://www.website.com/image.jpg[/img] Insérer une image en provenance du site
Aligné à gauche [align=left]Texte[/align] Centré [align=center]Texte[/align] Aligné à droite [align=right]Texte[/align] Toute la largeur [align=justify]Texte[/text]
Couleur [color=#000000]Text[/color] Mise en forme [highlight=pascal]Texte[/highlight] Widgets Emoticons :code: [:code] Convertisseur HTML vers BBCode Convertisseur Word vers BBCode
Prévisualisation Vérification de l'orthographe

Copier Coller Couper Tout sélectionner
Tout effacer Insérer la date Insérer l'heure Insérer la date et heure Insérer votre IP
Liste [list=square][item]BlaBla[/item][/list] Liste Numérotée [list=decimal][item]BlaBla[/item][/list]
Citation [quote=name]Texte[/quote] Spoiler [spoiler]James est le meurtrier![/spoiler]
Tout en majuscules [uppercase]Texte[/uppercase] Tout en minuscules [lowercase]Texte[/lowercase] l33t [l33t]Je suis un nerd[/l33t] Texte en indice [sub]Texte[/sub] Texte en exposant [sup]Texte[/sup] Taille du texte [size=8]Texte[/size]
 
zion
Démo protection anti grosse image

http://www.wallpapersforfun.nl/BethOstrosky/Beth_Ostrosky002.jpg
zion
  1. <?php 
  2. /* $Id: ldi_check.php,v 2.4 2004/06/15 16:52:18 lem9 Exp $ */ 
  3. // vim: expandtab sw=4 ts=4 sts=4: 
  4. require_once('./libraries/grab_globals.lib.php'); 
  5. require_once('./libraries/common.lib.php'); 
  6. // Check parameters 
  7. PMA_checkParameters(array('db', 'table')); 
  8. $unlink_local_textfile = false; 
  9. if (isset($btnLDI) && isset($local_textfile) && $local_textfile != '') { 
  10.     if (empty($DOCUMENT_ROOT)) { 
  11.         if (!empty($_SERVER) && isset($_SERVER['DOCUMENT_ROOT'])) { 
  12.             $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT']; 
  13.         } 
  14.         else if (!empty($_ENV) && isset($_ENV['DOCUMENT_ROOT'])) { 
  15.             $DOCUMENT_ROOT = $_ENV['DOCUMENT_ROOT']; 
  16.         } 
  17.         else if (@getenv('DOCUMENT_ROOT')) { 
  18.             $DOCUMENT_ROOT = getenv('DOCUMENT_ROOT'); 
  19.         } 
  20.         else { 
  21.             $DOCUMENT_ROOT = '.'; 
  22.         } 
  23.     } // end if 
  24.     if (substr($cfg['UploadDir'], -1) != '/') { 
  25.         $cfg['UploadDir'] .= '/'; 
  26.     } 
  27.     $textfile = $DOCUMENT_ROOT . dirname($PHP_SELF) . '/' . preg_replace('@^./@s', '', $cfg['UploadDir']) . PMA_securePath($local_textfile); 
  28.     if (file_exists($textfile)) { 
  29.         $open_basedir = @ini_get('open_basedir'); 
  30.         // If we are on a server with open_basedir, we must move the file 
  31.         // before opening it. The doc explains how to create the "./tmp" 
  32.         // directory 
  33.         if (!empty($open_basedir)) { 
  34.             $tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : './tmp/'); 
  35.             // function is_writeable() is valid on PHP3 and 4 
  36.             if (!is_writeable($tmp_subdir)) { 
  37.                 echo $strWebServerUploadDirectoryError . ': ' . $tmp_subdir 
  38.                  . '<br />'; 
  39.                 exit(); 
  40.             } else { 
  41.                 $textfile_new = $tmp_subdir . basename($textfile); 
  42.                 move_uploaded_file($textfile, $textfile_new); 
  43.                 $textfile = $textfile_new; 
  44.                 $unlink_local_textfile = true; 
  45.             } 
  46.         } 
  47.     } 
  48. } 
  49. if (isset($btnLDI) && empty($textfile)) { 
  50.     $js_to_run = 'functions.js'; 
  51.     require_once('./header.inc.php'); 
  52.     $message = $strMustSelectFile; 
  53.     require('./ldi_table.php'); 
  54. } elseif (isset($btnLDI) && ($textfile != 'none')) { 
  55.     if (!isset($replace)) { 
  56.         $replace = ''; 
  57.     } 
  58.     // the error message does not correspond exactly to the error... 
  59.     if (!@chmod($textfile, 0644)) { 
  60.        echo $strFileCouldNotBeRead . ' ' . $textfile . '<br />'; 
  61.        require_once('./footer.inc.php'); 
  62.     } 
  63.     // Kanji encoding convert appended by Y.Kawada 
  64.     if (function_exists('PMA_kanji_file_conv')) { 
  65.         $textfile         = PMA_kanji_file_conv($textfile, $knjenc, isset($xkana) ? $xkana : ''); 
  66.     } 
  67.     // Convert the file's charset if necessary 
  68.     if ($cfg['AllowAnywhereRecoding'] && $allow_recoding 
  69.         && isset($charset_of_file) && $charset_of_file != $charset) { 
  70.         $textfile         = PMA_convert_file($charset_of_file, $convcharset, $textfile); 
  71.     } 
  72.     // Formats the data posted to this script 
  73.     $textfile             = PMA_sqlAddslashes($textfile); 
  74.     $enclosed             = PMA_sqlAddslashes($enclosed); 
  75.     $escaped              = PMA_sqlAddslashes($escaped); 
  76.     $column_name          = PMA_sqlAddslashes($column_name); 
  77.     // (try to) make sure the file is readable: 
  78.     chmod($textfile, 0777); 
  79.     // Builds the query 
  80.     $sql_query     =  'LOAD DATA'; 
  81.     if ($local_option == "1") { 
  82.         $sql_query     .= ' LOCAL'; 
  83.     } 
  84.     $sql_query     .= ' INFILE \'' . $textfile . '\''; 
  85.     if (!empty($replace)) { 
  86.         $sql_query .= ' ' . $replace; 
  87.     } 
  88.     $sql_query     .= ' INTO TABLE ' . PMA_backquote($into_table); 
  89.     if (isset($field_terminater)) { 
  90.         $sql_query .= ' FIELDS TERMINATED BY \'' . $field_terminater . '\''; 
  91.     } 
  92.     if (isset($enclose_option) && strlen($enclose_option) > 0) { 
  93.         $sql_query .= ' OPTIONALLY'; 
  94.     } 
  95.     if (strlen($enclosed) > 0) { 
  96.         $sql_query .= ' ENCLOSED BY \'' . $enclosed . '\''; 
  97.     } 
  98.     if (strlen($escaped) > 0) { 
  99.         $sql_query .= ' ESCAPED BY \'' . $escaped . '\''; 
  100.     } 
  101.     if (strlen($line_terminator) > 0){ 
  102.         $sql_query .= ' LINES TERMINATED BY \'' . $line_terminator . '\''; 
  103.     } 
  104.     if (strlen($column_name) > 0) { 
  105.         $sql_query .= ' ('; 
  106.         $tmp   = split(',( ?)', $column_name); 
  107.         $cnt_tmp = count($tmp); 
  108.         for ($i = 0; $i < $cnt_tmp; $i++) { 
  109.             if ($i > 0) { 
  110.                 $sql_query .= ', '; 
  111.             } 
  112.             $sql_query     .= PMA_backquote(trim($tmp[$i])); 
  113.         } // end for 
  114.         $sql_query .= ')'; 
  115.     } 
  116.     // We could rename the ldi* scripts to tbl_properties_ldi* to improve 
  117.     // consistency with the other sub-pages. 
  118.     // 
  119.     // The $goto in ldi_table.php is set to tbl_properties.php but maybe 
  120.     // if would be better to Browse the latest inserted data. 
  121.     require('./sql.php'); 
  122.     if ($unlink_local_textfile) { 
  123.         unlink($textfile); 
  124.     } 
  125. } 
  126. else { 
  127.     require('./ldi_table.php'); 
  128. } 
  129. ?>


Catégorie:  






Ada
CSS
Cobol
CPP
HTML
Fortran
Java
JavaScript
Pascal
Perl
PHP
Python
SQL
VB
XML
Anon URL
DailyMotion
eBay
Flickr
FLV
Google Video
Google Maps
Metacafe
MP3
SeeqPod
Veoh
Yahoo Video
YouTube
6px
8px
10px
12px
14px
16px
18px
Informaticien.be - © 2002-2026 Akretio SRL  - Generated via Kelare Haut de page