本文整理匯總了PHP中common::redirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP common::redirect方法的具體用法?PHP common::redirect怎麽用?PHP common::redirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common
的用法示例。
在下文中一共展示了common::redirect方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit_user
function edit_user($user_id = '')
{
if (!common::update_permit()) {
common::redirect();
}
if ($_POST['save']) {
if ($this->form_validation->run('valid_user')) {
$this->mod_user->update_user();
//Don't Change
$this->session->set_flashdata('msg', 'Content Updated Successfully!');
redirect('user');
}
}
$id = $user_id;
if ($id == '') {
redirect('user');
}
$data = sql::row("scic_user", "id={$id}");
$this->session->set_userdata('edit_user_id', $data['id']);
//Don't Change
$data['nav_array'] = array(array('title' => 'Manage Users', 'url' => site_url('user')), array('title' => 'Add New User', 'url' => ''));
$data['dir'] = 'user';
$data['action'] = 'user/edit_user/' . $user_id;
$data['page'] = 'user_form';
//Don't Change
$data['page_title'] = 'Edit User';
$this->load->view('main', $data);
}
示例2: evaluate_third
function evaluate_third($user_id = '')
{
if (!common::update_permit()) {
common::redirect();
}
$id = $user_id;
if ($_POST['save']) {
if ($this->form_validation->run('valid_third')) {
$this->mod_result->update_third_marks($id);
//Don't Change
$this->session->set_flashdata('msg', 'Third Part Evaluated Successfully!');
$check = sql::row("scic_result", "user_id={$id}");
if ($check['general'] != -1 && $check['third_part'] != -1 && $check['notification'] == 0) {
$this->mod_result->sendEmail($id);
}
redirect('result');
}
}
if ($id == '') {
redirect('result');
}
$data = sql::row("scic_result", "user_id={$id}");
//$this->session->set_userdata('edit_user_id', $data['id']); //Don't Change
$data['nav_array'] = array(array('title' => 'Manage Results', 'url' => site_url('result')), array('title' => 'Evaluate Third Part', 'url' => ''));
$data['question'] = $this->mod_result->get_third();
$data['answer'] = $this->mod_result->get_third_answer($id);
$data['dir'] = 'result';
$data['action'] = 'result/evaluate_third/' . $user_id;
$data['page'] = 'third_form';
//Don't Change
$data['page_title'] = 'Evaluation';
$this->load->view('main', $data);
}
示例3: is_admin
function is_admin()
{
$CI =& get_instance();
if ($CI->session->userdata('logged_in') && $CI->session->userdata('user_name') == 'admin') {
return true;
} else {
common::redirect();
}
}
示例4: add_url
function add_url()
{
if (!common::add_permit()) {
common::redirect();
}
if ($_POST['save']) {
if ($this->form_validation->run('add_url')) {
if ($this->shorturl_model->add_url()) {
$this->session->set_flashdata('msg', 'Url Added Successfully!!!');
redirect('shorturl');
}
}
}
$data['msg'] = $this->session->flashdata('msg');
$data['dir'] = 'shorturl';
$data['page'] = 'add_url';
$this->load->view('main', $data);
}
示例5: new_question
function new_question()
{
if (!common::add_permit()) {
common::redirect();
}
if ($_POST['save']) {
if ($this->form_validation->run('new_question')) {
if ($this->question_model->add_question()) {
$this->session->set_flashdata('msg', 'Question Added Successfully!!!');
redirect('question');
}
}
}
$data['msg'] = $this->session->flashdata('msg');
$data['action'] = 'question/new_question';
$data['dir'] = 'shorturl';
$data['page'] = 'add_url';
$data['page_title'] = 'Add Questions';
$this->load->view('main', $data);
}