write in file

This commit is contained in:
Bertrand Cournaud 2012-05-22 10:00:59 +02:00
parent 8a20f8b86a
commit 6885c2883c

View File

@ -3,6 +3,7 @@
define("FILENAME", "questions_file.nemubot"); define("FILENAME", "questions_file.nemubot");
include("Question.class.php"); include("Question.class.php");
include("QuestionsFile.php");
if (isset ($_POST['send'])) if (isset ($_POST['send']))
{ {
@ -30,6 +31,9 @@ if (isset ($_POST['send']))
$quest->print_test(); $quest->print_test();
// @TODO: Create/Load a QuestionFile and add the question (it must be unique) // @TODO: Create/Load a QuestionFile and add the question (it must be unique)
$file = new QuestionsFile('questions.xml');
$file->add_question($quest);
$file->save();
// @TODO: Find a validator (from the list of previous senders for example?) // @TODO: Find a validator (from the list of previous senders for example?)