php probleme on validaion page
This commit is contained in:
parent
25f8396455
commit
a1c1244e14
@ -93,7 +93,7 @@ class Question
|
|||||||
return $qnode;
|
return $qnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isValidated()
|
public function validated()
|
||||||
{
|
{
|
||||||
$this->validated = true;
|
$this->validated = true;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@ include("Question.class.php");
|
|||||||
include("QuestionsFile.class.php");
|
include("QuestionsFile.class.php");
|
||||||
|
|
||||||
|
|
||||||
|
// Change this variable depending on the server
|
||||||
|
$validationAddress = "http://178.170.101.82/~Cccompany/nemubot_askweb/validation.php?id=";
|
||||||
|
|
||||||
if (isset ($_POST['send']))
|
if (isset ($_POST['send']))
|
||||||
{
|
{
|
||||||
//Gets parameters: course, question and answers
|
//Gets parameters: course, question and answers
|
||||||
@ -57,7 +60,8 @@ if (isset ($_POST['send']))
|
|||||||
$to = "bertrand.cournaud@gmail.com";
|
$to = "bertrand.cournaud@gmail.com";
|
||||||
$subject = "[Nemubot] Validation d'une question";
|
$subject = "[Nemubot] Validation d'une question";
|
||||||
$headers = "From: Nemubot <bot@nemunai.re>";
|
$headers = "From: Nemubot <bot@nemunai.re>";
|
||||||
$message = "Bonjour,\n";
|
$message = 'Bonjour,\n Adresse de validation:
|
||||||
|
$validationAddress . $quest->getId()';
|
||||||
|
|
||||||
if (mail($to, $subject, $message, $headers))
|
if (mail($to, $subject, $message, $headers))
|
||||||
{
|
{
|
||||||
@ -106,8 +110,8 @@ else
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
URL de validation:<br/>
|
URL de validation:<br/>
|
||||||
<a href='http://178.170.101.82/~Cccompany/nemubot_askweb/validation.php?id=
|
<a href=<?php echo
|
||||||
<?php echo $quest->getId() ?>'>Valider la question</a>
|
$validationAddress . $quest->getId() ?>>Valider la question</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include("Question.class.php");
|
include("Question.class.php");
|
||||||
include("QuestionsFile.class.php");
|
include("QuestionsFile.class.php");
|
||||||
|
|
||||||
function print_question()
|
$id = $_GET['id'];
|
||||||
{
|
echo $id;
|
||||||
$id = $_GET['id'];
|
|
||||||
$file = new QuestionsFile('questions.xml');
|
$file = new QuestionsFile("questions.xml");
|
||||||
|
$question = $file->get_question($id);
|
||||||
|
$question->print_test();
|
||||||
|
|
||||||
$questions = $file->get_question($id);
|
|
||||||
$question->print_test();
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
@ -21,11 +20,14 @@ function print_question()
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>Validation de la question</h1>
|
<h1>Validation de la question</h1>
|
||||||
|
<h3>Rappel de la question</h3>
|
||||||
|
<?php $question->print_test() ?><br/>
|
||||||
|
|
||||||
Vous pouvez valider la question. Cliquez simplement sur le
|
Vous pouvez valider la question. Cliquez simplement sur le
|
||||||
lien ci dessous.<br/>
|
lien ci dessous.<br/>
|
||||||
|
|
||||||
<input type="button" value="Valider la question"
|
<input type="button" value="Valider la question"
|
||||||
onclick="<?php print_questions(); ?>"/>
|
onclick='<?php $question->validate() ?>'/>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
Reference in New Issue
Block a user