簡體   English   中英

使用Codeigniter的PHP顯示彈出成功消息框

[英]PHP display pop-up success message box using Codeigniter

記錄更新后,我嘗試顯示一個彈出成功消息框。 這是我在控制器中編寫的代碼

           $status = $this->order_model->set_bookingByOrderID($id,$data);

           if($status ==1)
           {
            echo '<script>alert("You Have Successfully updated this Record!");</script>';
            redirect('orderManagement/index');
           }
           else{
            $this->session->set_flashdata("message","Record Not Updated!");
            redirect('orderManagement/index');
           }

但是該腳本不起作用。 誰能幫我解決這個問題?

我嘗試了您的代碼,只需要刷新重定向即可。 請嘗試以下代碼:

if($status == 1)
           {
               echo '<script>alert("You Have Successfully updated this Record!");</script>';
               redirect('orderManagement/index', 'refresh');
           }
           else{
               $this->session->set_flashdata("message","Record Not Updated!");
               redirect('orderManagement/index', 'refresh');
           }

我希望這能幫到您。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM