-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcreatecontact.php
More file actions
executable file
·58 lines (47 loc) · 1.65 KB
/
createcontact.php
File metadata and controls
executable file
·58 lines (47 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?
/*
File name : createcontact.php
Version : 2.0.0
Last Modified By : Pete Larsen
e-mail : pete@postaciwebmail.org
Last modified : 28 Feb 2005
*/
session_start();
include ("includes/global.inc");
include ("includes/functions.inc");
// ID comparison between logged hash and session. If they are both the same, let the user to go on...
$dbq = $db->execute("select log_id,user_id,username from tblLoggedUsers where hash = '$ID'");
$log_id = $dbq->fields['log_id'];
$user_id = $dbq->fields['user_id'];
$username = $dbq->fields['username'];
$dbq->close();
if ($log_id == ""){
Header("Location: index.php?error_id=1");
} else {
$txtemail = str_replace(";", "", $txtemail);
$abentry = explode(" <", $txtemail);
$txtnamesurname = $abentry[0];
$txtemail = $abentry[1];
$txtemail = str_replace(">", "", $txtemail);
if ($txtemail == "") { $txtemail = $txtnamesurname; }
$txtnamesurname = trim($txtnamesurname);
if ($txtnamesurname == "") {
$txtnamesurname = "-----------";
}
$dbq = $db->execute("select item_id from tblAdressbook order by item_id desc");
$max_item_id = $dbq->fields['item_id'];
$dbq->close();
$max_item_id++;
$txtnamesurname = clean_data($txtnamesurname);
$txtemail = clean_data($txtemail);
$txttelephone = clean_data($txttelephone);
$dbq = $db->execute("insert into tblAdressbook values($max_item_id,$user_id,'$txtnamesurname','$txtemail','','$txttelephone')");
$dbq->close();
if ($rm == 1) {
//$mbox_id = rawurlencode($mbox_id);
Header("Location: readmessage.php?ek=1&mbox_id=$mbox_id&msg_no=$msg_no");
} else {
Header("Location: addressbook.php");
}
}
?>