$xml->preserveWhiteSpace = false;
     $xml->load('../config.xml') or die("Couldn't load config.xml for theme");
     //Get item Element
     $element = $xml->getElementsByTagName('Configuration')->item(0) or die("Couldn't find Configuration node for changing theme ");
     //Load child elements
     $NameofActivity = $element->getElementsByTagName('ThemeName')->item(0) or die("Couldn't load ThemeName");
     //Replacing the value
     $NameofActivity->nodeValue = $_POST['theme'];
     $xml->save("../config.xml") or die("Couldn't change the theme");
     echo "Theme has been changed successfully!";
 } elseif (!empty($_POST['beforeimageupload'])) {
 } elseif (!empty($_POST['updateWords'])) {
     //	addWord
     addWord($_POST['word'], $_POST['category'], $_POST['tags'], '4pics1');
     //	getLastWordDetails
     $mslno = getLastWordDetails();
     //	updateFolderName
     updateWordFolder($_POST['loc'], $mslno);
     echo "Your word has been added to database successfully !";
 } elseif (!empty($_FILES)) {
     //	$mime_type=check_mime_content_type($_FILES["activity-file"]["name"]);
     //	echo $mime_type;
     if (is_zip_file($_FILES["activity-file"]["name"]) && zipIsValid($_FILES["activity-file"]["tmp_name"])) {
         //		echo "VALID";
         //		pr($_FILES);
         //		echo $mime_type;
         $zip = new ZipArchive();
         $filedetail = pathinfo($_FILES["activity-file"]["name"]);
         if ($zip->open($_FILES["activity-file"]["tmp_name"]) === TRUE) {
             $zip->extractTo('../assets/Games/' . $filedetail["filename"] . "/");
             recurse_copy("../assets/support_files/", '../assets/Games/' . $filedetail["filename"] . "/");
Beispiel #2
0

<?php 
// Starting the session to track the latest word
session_start();
include_once "../../../thfl-admin/model/functions.php";
$table = "4pics1";
//Getting the serial number of last inserted pic.
//				 NEW CODE by Jay: 2 May 2015, 10:01 AM
$mslno = getLastWordDetails($table);
$serial = $_SESSION['serial'];
if ($_GET['num']) {
    $serial = $_GET['num'];
}
//Get word details from serial no
// NEW CODE BY Jay: 2 May,2015 10:09 AM
$get_word_details = getWordDetails($serial, $table);
$word = $get_word_details[0]['word'];
$folder = $get_word_details[0]['slno'] . "/";
// scoring if right or wrong
if (isset($_SESSION['replay']) && $_SESSION['replay'] == true) {
    echo "Game over";
} else {
    if ($_POST["submit"] == "Send Answer") {
        $_SESSION['isLoggedIn'] = true;
        if (isset($_POST['visitor_email']) && strcmp($_POST['visitor_email'], "") != 0 && strcmp($_POST['visitor_email'], "underfined") != 0) {
            $_SESSION['visitor_email'] = $_POST['visitor_email'];
        }
        if (isset($_POST['visitor_name']) && strcmp($_POST['visitor_name'], "") != 0 && strcmp($_POST['visitor_name'], "underfined") != 0) {
            $_SESSION['visitor_name'] = $_POST['visitor_name'];
        }