Accueil/ajax/saveTodoist.php
2010-09-14 21:38:29 +00:00

21 lines
462 B
PHP

<?
$xmla = simplexml_load_file('../db/todoist.xml');
if(isset($_GET['token'])){
$token = trim($_GET['token']);
$xmla->addChild("token", $token);
$xmla->asXML('../db/todoist.xml');
echo $token;
}else if(isset($_GET['name']) && isset($_GET['id'])){
$name = trim($_GET['name']);
$id = trim($_GET['id']);
$xmla->addChild("name", $name);
$xmla->addChild("id", $id);
$xmla->asXML('../db/todoist.xml');
echo $id;
}