3
/********************************************************
5
AUTHOR: Ben Weinberg <ben@bensbrain.com>
6
FILE: source/addcontacts.php
8
Add contacts from csv file...
10
********************************************************/
12
include("../include/super2global.inc");
13
//include("../include/contacts_commons.inc");
14
//include_once("../include/data_manager.inc");
16
include("../include/header_main.inc");
17
include("../lang/".$my_prefs["lang"]."/contacts.inc");
18
include("../lang/".$my_prefs["lang"]."/compose.inc");
21
include_once("../include/icl.inc");
22
$conn=iil_Connect($host, $loginID, $password, $AUTH_MODE);
26
echo "Authentication failed.";
34
<table width="100%" cellpadding=2 cellspacing=0>
35
<tr bgcolor="#222244"><td>
36
<span class="bigTitle">Contact Importer: Page 1/3</span>
38
<tr bgcolor="#f0f0f0"><td>
39
<script language="JavaScript" type="text/javascript">
40
function checkform() {
41
form1 = document.forms['firstform'];
43
if (form1.userfile.value=="") {strerror += "please find a file to upload first\n";}
45
if (form1.userfile.value.indexOf(".csv")>0) form1.format[0].checked = true;
46
else if (form1.userfile.value.indexOf(".tsv")>0) form1.format[1].checked = true;
47
else { if (form1.format[0].checked != true && form1.format[1].checked != true) strerror += "Please choose whether your file is a csv or tsv file.\n"; }
49
if (strerror == "") {return true;}
50
else {alert(strerror);return false;}
55
<table width="500" cellpadding=0 cellspacing=0>
57
Export your contacts from your current email program's address book to a text file. <br>
58
<b>Note:</b> This file <b>must</b> be in CSV (comma separated variable) or TSV (tab separated variable) format with column headers in the first row. Any other format will cause the address import to fail.<br>
60
Once you have done this, use the form below to browse for the exported address book file on your computer and then hit the "upload" button to proceed to the next step.<br>
62
<form name="firstform" action="addcontacts2.php?user=<?php echo($user)?>" method="post" enctype="multipart/form-data" onSubmit="return checkform()">
63
<input type="hidden" name="max_file_size" value="1000000">
64
Find the exported address book file:<br>
65
<input type="file" name="userfile"><br>
67
If the file chosen above DOES NOT have a .csv or .tsv file extension, please choose the format of the file here (if you don't know, open it in a plain text editor).<br>
69
<input type="radio" name="format" value="csv"> CSV<br>
70
<input type="radio" name="format" value="tsv"> TSV<br>
72
<input type="submit" value="upload address file and begin import process">