3 include_once('config.php');
\r
4 include_once('linkbar.php');
\r
10 if(isset($_REQUEST["formaction"]) && $_REQUEST["formaction"]=="addpeer" && $_REQUEST["publickey"]!="")
\r
13 $db=new PDO('sqlite:'.$dblocation);
\r
14 $st=$db->prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey=?;");
\r
15 $st->bindParam(1,$_REQUEST["publickey"]);
\r
17 if($record=$st->fetch())
\r
19 $message="This peer already exists";
\r
23 $st2=$db->prepare("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES(?,?);");
\r
24 $st2->bindParam(1,$_REQUEST["publickey"]);
\r
25 $st2->bindParam(2,gmdate('Y-m-d H:i:s'));
\r
27 $message="Peer added";
\r
30 <h2><?php print($message) ?></h2>
\r
37 <form name="frmaddpeer" method="POST">
\r
38 <input type="hidden" name="formaction" value="addpeer">
\r
39 Peer Public Key<input type="text" name="publickey" size="100">
\r
41 The public key must be a valid SSK public key and include the / at the end
\r
43 <input type="submit" value="Add">
\r
49 include_once('template.php');
\r