簡體   English   中英

PHP重定向到根PHP文件

[英]PHP Redirect to a Root PHP File

我具有表單提交功能,提交后我希望將用戶重定向到視圖。 但是我的重定向是在鏈接上添加一些內容。

我的目錄系統就是這樣。

exercise3/
         css/
          js/
          inc/
             /Controller
                OperatorController.php
             /Model
                FormModel.php
             include.php
fillup.php
fillup-view.php

我的OperatorController.php處理表單提交處理,該處理位於exercise3 \\ inc \\ Controller \\ OperatorController.php中。 如果形式成功,我有這個

if ($result == '1')
        {

            header("Location: ../fillup-view.php/");      
        }

所以基本上我希望用戶重定向到exercise3 / fillup-view.php,問題在於

 /exercise3/inc/fillup-view.php/

它插入“ inc”在哪里有問題

header("Location: ../fillup-view.php/");  

..不是指向root而是指向inc? 謝謝!

你為什么不嘗試這樣的事情。 $ this-> redirect(array('controller'=>'controller_name','action'=>'fillup-view')));

暫無
暫無

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

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