Poster une réponse à un sujet: Test de code + php
Attention, ce sujet est un sujet ancien (7019 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. if (isset($btnLDI) && empty($textfile)) { 
  49.     $js_to_run = 'functions.js'
  50.     require_once('./header.inc.php'); 
  51.     $message = $strMustSelectFile
  52.     require('./ldi_table.php'); 
  53. elseif (isset($btnLDI) && ($textfile != 'none')) { 
  54.     if (!isset($replace)) { 
  55.         $replace = ''
  56.     } 
  57.     // the error message does not correspond exactly to the error... 
  58.     if (!@chmod($textfile0644)) { 
  59.        echo $strFileCouldNotBeRead . ' ' . $textfile . '<br />'
  60.        require_once('./footer.inc.php'); 
  61.     } 
  62.     // Kanji encoding convert appended by Y.Kawada 
  63.     if (function_exists('PMA_kanji_file_conv')) { 
  64.         $textfile         = PMA_kanji_file_conv($textfile$knjencisset($xkana) ? $xkana : ''); 
  65.     } 
  66.     // Convert the file's charset if necessary 
  67.     if ($cfg['AllowAnywhereRecoding'] && $allow_recoding 
  68.         && isset($charset_of_file) && $charset_of_file != $charset) { 
  69.         $textfile         = PMA_convert_file($charset_of_file$convcharset$textfile); 
  70.     } 
  71.     // Formats the data posted to this script 
  72.     $textfile             = PMA_sqlAddslashes($textfile); 
  73.     $enclosed             = PMA_sqlAddslashes($enclosed); 
  74.     $escaped              = PMA_sqlAddslashes($escaped); 
  75.     $column_name          = PMA_sqlAddslashes($column_name); 
  76.     // (try to) make sure the file is readable: 
  77.     chmod($textfile0777); 
  78.     // Builds the query 
  79.     $sql_query     =  'LOAD DATA'
  80.     if ($local_option == "1") { 
  81.         $sql_query     .= ' LOCAL'
  82.     } 
  83.     $sql_query     .= ' INFILE \'' . $textfile . '\''
  84.     if (!empty($replace)) { 
  85.         $sql_query .= ' ' . $replace
  86.     } 
  87.     $sql_query     .= ' INTO TABLE ' . PMA_backquote($into_table); 
  88.     if (isset($field_terminater)) { 
  89.         $sql_query .= ' FIELDS TERMINATED BY \'' . $field_terminater . '\''
  90.     } 
  91.     if (isset($enclose_option) && strlen($enclose_option) > 0) { 
  92.         $sql_query .= ' OPTIONALLY'
  93.     } 
  94.     if (strlen($enclosed) > 0) { 
  95.         $sql_query .= ' ENCLOSED BY \'' . $enclosed . '\''
  96.     } 
  97.     if (strlen($escaped) > 0) { 
  98.         $sql_query .= ' ESCAPED BY \'' . $escaped . '\''
  99.     } 
  100.     if (strlen($line_terminator) > 0){ 
  101.         $sql_query .= ' LINES TERMINATED BY \'' . $line_terminator . '\''
  102.     } 
  103.     if (strlen($column_name) > 0) { 
  104.         $sql_query .= ' ('
  105.         $tmp   = split(',( ?)'$column_name); 
  106.         $cnt_tmp = count($tmp); 
  107.         for ($i = 0$i < $cnt_tmp$i++) { 
  108.             if ($i > 0) { 
  109.                 $sql_query .= ', '
  110.             } 
  111.             $sql_query     .= PMA_backquote(trim($tmp[$i])); 
  112.         } // end for 
  113.         $sql_query .= ')'
  114.     } 
  115.     // We could rename the ldi* scripts to tbl_properties_ldi* to improve 
  116.     // consistency with the other sub-pages. 
  117.     // 
  118.     // The $goto in ldi_table.php is set to tbl_properties.php but maybe 
  119.     // if would be better to Browse the latest inserted data. 
  120.     require('./sql.php'); 
  121.     if ($unlink_local_textfile) { 
  122.         unlink($textfile); 
  123.     } 
  124. else { 
  125.     require('./ldi_table.php'); 
  126. ?>


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-2024 AkretioSPRL  - Generated via Kelare
The Akretio Network: Akretio - Freedelity - KelCommerce - Votre publicité sur informaticien.be ?