Author name: admin

code

<?php // Load the database configuration file include_once ‘config.php’; if(isset($_POST[‘importSubmit’])){ // Allowed mime types $csvMimes = array(‘text/x-comma-separated-values’, ‘text/comma-separated-values’, ‘application/octet-stream’, ‘application/vnd.ms-excel’, ‘application/x-csv’, ‘text/x-csv’, ‘text/csv’, ‘application/csv’, ‘application/excel’, ‘application/vnd.msexcel’, ‘text/plain’); // Validate whether selected file is a CSV file if(!empty($_FILES[‘file’][‘name’]) && in_array($_FILES[‘file’][‘type’], $csvMimes)){ // If the file is uploaded if(is_uploaded_file($_FILES[‘file’][‘tmp_name’])){ // Open uploaded CSV file with read-only mode …

code Read More »

Scroll to Top