예제 #1
0
        if (!empty($type[$i])) {
            $flag = $flag || $type[$i] == $post['type'];
        }
    }
    if (!$flag) {
        redirect("Location: error.php");
    }
}
if (isset($_POST['submit'])) {
    if ($user->getPower() != 0) {
        $_POST['type'] = "草稿";
    }
    if ($_GET['id'] == "new") {
        $id = $eassy->createEassy($_POST['title'], $user->getUser(), $_POST['type'], $_POST['post']);
    } else {
        $id = $eassy->updateEassy($_GET['id'], $_POST['title'], $user->getUser(), $_POST['type'], $_POST['post']);
    }
    if ($id == false) {
        header("Location: error.php");
    } else {
        header("Location: eedit.php?id=" . $id);
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>文章管理 > <?php 
if ($t) {
    echo "文章:" . $post['title'];
예제 #2
0
파일: eedit.php 프로젝트: springhack/etech
    for ($i = 0; $i < count($type); ++$i) {
        if (!empty($type[$i])) {
            $flag = $flag || $type[$i] == $post['type'];
        }
    }
    if (!$flag) {
        redirect("Location: error.php");
    }
}
if (isset($_POST['submit'])) {
    //if ($user->getPower() != 0)
    //$_POST['type'] = "草稿";
    if ($_GET['id'] == "new") {
        $id = $eassy->createEassy($_POST['title'], $user->getUser(), $_POST['type'], $_POST['post']);
    } else {
        $id = $eassy->updateEassy($_GET['id'], $_POST['title'], $post['author'], $_POST['type'], $_POST['post']);
    }
    if ($id == false) {
        header("Location: error.php");
    } else {
        header("Location: eedit.php?id=" . $id);
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>文章管理 > <?php 
if ($t) {
    echo "文章:" . $post['title'];