コード例 #1
0
ファイル: ss_handler.php プロジェクト: noikiy/owaspbwa
            //make get = to post
            $id = $_POST['ss_id'];
            //    echo "ss_handler.php called with different ss_id: $id.";
        }
    } else {
        $_POST['ss_load'] = TRUE;
        //always make task load ss if $POST ss_id is not set
    }
} else {
    echo 'Wordpress Spreadsheet: No ss_id in URL';
}
require_once '../../../wp-config.php';
require_once 'ss_functions.php';
//handle possible spreadsheet functions from name of submit button in form
if ($_POST['ss_save']) {
    ss_save();
} else {
    if ($_POST['ss_load']) {
        ss_load($id);
        //saved, so reload
    } else {
        if ($_POST['ss_clear']) {
            ss_clear($id);
            //erase spreadsheet, save and reload
        }
    }
}
?>


コード例 #2
0
ファイル: ss_functions.php プロジェクト: noikiy/owaspbwa
function ss_clear($id)
{
    if ($id == '') {
        $id = $_GET['ss_id'];
    }
    global $wpdb;
    $table_name = $wpdb->prefix . "spreadsheet";
    $htmlspreadsheet = wpSS_blank();
    $htmlspreadsheet = $wpdb->escape($htmlspreadsheet);
    $update = "UPDATE " . $table_name . " SET ss_tablehtml = '" . $htmlspreadsheet . "'" . ", ss_name = 'Cleared'" . ", ss_description = 'Empty spreadsheet'" . " WHERE id = {$id} LIMIT 1";
    $results = $wpdb->query($update);
    ss_load($id);
    //reload cleared spreadsheet page
}
コード例 #3
0
ファイル: ss_load.php プロジェクト: noikiy/owaspbwa
<?php

require_once '../../../wp-config.php';
$id = $_GET['ss_id'];
$plain = 0;
if ($_GET['display'] == 'plain' or $_GET['display'] == 1) {
    $plain = TRUE;
}
//  echo "display: ".$_GET['display'].", plain in ssload: $plain";
//if called with no ss_id, assume first spreadsheet
if ($id == '') {
    $id = 1;
}
require_once 'ss_functions.php';
ss_load($id, $plain);