Source for file action-import.php
Documentation is available at action-import.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
include_once 'include/head.php';
if (isset ($_POST['submit'])) {
if ($_POST['mode'] == 'sim') {
include_once 'include/simulations.php';
if (!isset ($GLOBALS['_Contact_AddressBook_simulations'][$_POST['simId']])) {
print 'Error: no simulation file selected';
$file = dirname(__FILE__ ) . '/files/' .
$GLOBALS['_Contact_AddressBook_simulations'][$_POST['simId']]['file'];
$format = $GLOBALS['_Contact_AddressBook_simulations'][$_POST['simId']]['format'];
if (isset ($_FILES['file'])) {
if ($_FILES['file']['error'] !== 0 ) {
print 'An error occurs when uploading file';
$file = $_FILES['file']['tmp_name'];
$format = $_POST['format'];
// Load the Contact_AddressBook.
require_once 'Contact/AddressBook.php';
// Create a new instance of Contact_AddressBook object.
// Call the import method.
$res = $cab->importFromFile ($file, $format);
print '<h3>File contents</h3>' . "\n";
print '<h3>Converted data</h3>' . "\n";
include_once 'include/footer.php';
* c-hanging-comment-ender-p: nil
Documentation generated on Mon, 11 Mar 2019 15:40:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|