Example #1
0
<?php

include 'header.html';
require_once '../includes/db_conn.php';
require_once 'admin_fun.php';
if (isset($_POST['question_title']) && isset($_POST['key']) && isset($_POST['mark']) && isset($_POST['question_url'])) {
    $question_title = $_POST['question_title'];
    $key = $_POST['key'];
    $mark = $_POST['mark'];
    $type = $_POST['type'];
    $quesion_url = $_POST['question_url'];
    $quesion_id = $_POST['question_id'];
    insert_question($question_id, $question_title, $key, $mark, $type, $question_url);
}
if (isset($_GET['delid'])) {
    delete_question($_GET['delid']);
}
?>

<script type="text/javascript">
	function del(){
		var mymessage=confirm("确认删除吗?");
		if(confirm(mymessage)==true){ 
			return true;
		}else{ 
			return false;
		} 
	}
</script>
<br>
<br>
Example #2
0
        }
        // status='draft' means it's a draft post for payments; return ID
        if ($id > 0 && $status == 'draft') {
            return $id;
        }
        // pending - for subscribers/contributors, go to thankyou page
        if ($id > 0 && $status == 'pending') {
            $paypal = get_option('paypal');
            if ($paypal == 'yes') {
                return $id;
            } else {
                wp_redirect(get_bloginfo('url') . "/?p=" . get_option('thankyou_page_id'));
                exit;
            }
        }
        if (!empty($id) && $id > 0) {
            wp_redirect(get_bloginfo('url') . "/?p={$id}");
            exit;
        }
    } else {
        $_SESSION['post_content'] = $postdata['content'];
        $_SESSION['post_title'] = $postdata['post_title'];
        $_SESSION['tag'] = $postdata['tags'];
        wp_redirect(get_bloginfo('url') . "/?p=" . get_option('signup_page_id'));
        exit;
    }
}
if (!empty($_POST['ask_a_question']) && !isset($_POST['submit_payment'])) {
    // check if title and content are filled
    insert_question($_POST);
}
Example #3
0
} else {
    set_cookie();
}
$_GET['pagename'] = "posting";
include "header.php";
$m_id = $_SESSION['id'];
$content = $_POST['content'];
$question = $_POST['question'];
$choice = $_POST['choice'];
$answer = $_POST['answer'];
if (check_submit($content, $question, $choice, $answer) == false) {
    print "<a href='posting.php'>戻る</a>";
    exit(0);
}
$db = new mydb();
if (insert_question($db, $content, $question, $m_id) == false) {
    sql_failed();
    exit(0);
}
for ($i = 0; $i < count($choice); $i++) {
    if (insert_choice($db, $choice[$i], $answer[$i]) == false) {
        sql_failed();
        exit(0);
    }
}
reset_cookie();
print "診断を追加しました。";
include "footer.php";
function post_check()
{
    return isset($_POST['content']) & isset($_POST['question']) & isset($_POST['choice']) & isset($_POST['answer']);