Consegui fazer para enviar CSV, mas não estou conseguindo arrumá-lo para os arquivos...
<?php mysql_connect("xxx", "xxx", "xxx"); mysql_select_db("xxx"); if(isset($_POST['submit'])){ $filename = $_POST['filename']; $handle = fopen("$filename", "r"); while(($data = fgetcsv($handle, 100000, ";")) !== FALSE){ $result = mysql_query("INSERT INTO teste (empresa, nome, email, enviar, status) VALUES ('".$data[2]."', '".$data[0]."', '".$data[1]."', '".$data[3]."', '".$data[4]."')"); } fclose($handle); print "Import done"; }else{ print "<form action='index.php' method='post'>"; print "Type file name to import:<br>"; print "<input type='file' name='filename' size='20'><br>"; print "<input type='submit' name='submit' value='submit'></form>"; } ?>
alguém pode me ajudar...
não teria como fazer um para os 3 tipos de arquivos?
e se tem como consultar o e-mail antes de efetuar o cadastro...
da uma força ai galera...