특정 페이지에서 특정 데이터베이스 필드를 전환하는 버튼이 있습니다. 내가 404 페이지로 리디렉션 버튼을 클릭하면이 기능은PHP/codeigniter : 클릭하면 링크가 작동하지 않지만 새 탭에서 열면 올바르게 작동합니다.
function source_toggle_paid($event_id = null, $attendee_id = null)
{
$this->authentication->checkLogin(); // Check if the user is logged in
// Check the parameters provided are null
if ($attendee_id == null || $event_id == null)
{
// If either attendee or event ids given are null, give an error message
$data = array(
'type' => 'error',
'message' => $this->message_list->get('DOES_NOT_EXIST', 'attendee') . ' ' . $this->message_list->get('BACK_TO_SOURCE_HOME')
);
// Output the error message
$this->load->view('template/main_header');
$this->load->view('template/message', $data);
$this->load->view('template/main_footer');
}
else // Otherwise, parameters are not null
{
//Load the attendee model, and toggle the paid status of the attendee
$this->load->model('Attendee');
$this->Attendee->toggle_field('paid',$attendee_id);
//Redirect the user back to the attendees page, with the used search term
redirect('admin/source_attendees/'.$event_id);
//redirect('admin/source_attendees/'.$event_id);
}
}
이며, DP가 더 연주에 나는 기능에 도달되고 있지 않습니다 발견했습니다, 변경되지 않습니다. 그러나 수동으로 URL을 입력하면 제대로 작동하고 새 탭에서 마우스 오른쪽 버튼을 클릭하여 열어도 작동합니다.
버튼의 기능과 URI 세그먼트있어 변경? 링크, 양식 제출 버튼입니까? 링크 인 경우 사용자에게 보내는 URL은 무엇입니까? – jfoucher
그것은 링크이고, 보내는 URL은 내가 수동으로 입력하면 작동하는 것과 같습니다 .... source_toggle_paid/17/13 예를 들면. 그러나 링크에 하나가 포함되지 않고 후행 슬래시가 차이를 만들지는 않더라도 후행 슬래시를 추가하면 문제가 발생합니다. – Ryan