日历事件问题

时间:2010-05-23 09:37:06

标签: php

祝大家好! 你能帮我么? 我对这部分剧本有疑问:

$output = cal_top();

switch($action){

    case "add":
        include("includes/event.php");
        $output .= cal_event_form('add');
        break;
    case "delete":
        include("includes/delete.php");
        include('includes/viewdate.php');
        $del_error = cal_del();
        if($del_error!="") $output .= "<center><span class='failure'>$del_error</span></center><br>";
        $output .=  cal_display();
        break;
    case "modify":
        include("includes/event.php");
        $output .=  cal_event_form('modify');
        break;
    case "viewdate":
        include("includes/viewdate.php");
        $output .=  cal_display();
        break;
    case "viewevent":
        include("includes/viewevent.php");
        $output .=  cal_display();
        break;
    case "search":
        include("includes/search.php");
        $output .=  cal_search_form();
        break;
    case "submitevent":
        include('includes/eventsub.php');
        include('includes/viewdate.php');
        $sub_error = cal_submit_event();
        if($sub_error!="") $output .= "<center><span class='failure'>$sub_error</span></center><br>";
        $output .=  cal_display();
        $_SESSION['cal_action'] = "viewdate";
        break;
    case "admin":
        include('includes/admin.php');
        $output .= cal_adminsection();
        break;
    case "login":
        $_SESSION['cal_noautologin'] = 1;
        include('includes/login.php');
        $output .=  cal_login_page();
        break;
    case "logout":
        cal_logout();
        $_SESSION['cal_noautologin'] = 1;
        cal_clear_permissions();
        cal_load_permissions();

它向我显示了这个错误:

Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php  on line 145
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 149
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 156
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 160
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 164
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 168
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 172
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 180
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 184
Notice: Undefined variable: action in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 189

你的帮助对我很有帮助!请帮助我;)谢谢你。

2 个答案:

答案 0 :(得分:1)

您是否尝试阅读错误消息?

答案 1 :(得分:1)

那是因为$action变量未定义,请确保它等于某个值然后用var_dump检查它,例如:

var_dump($action);