简体   繁体   中英

PHP Redirect to a Root PHP File

I have a form submission function and upon submission I want the user to be redirected to a view. But my redirect is adding something on the link.

My Directory System is Like this.

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

My OperatorController.php handles form sumbmission processing which is located at exercise3\\inc\\Controller\\OperatorController.php . If form is success I have this

if ($result == '1')
        {

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

so basically I'm want the user to be redirected to exercise3/fillup-view.php The problem is it is directed at

 /exercise3/inc/fillup-view.php/

it is inserting "inc" is there something wrong in

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

.. is not pointing to root but on inc? Thanks!

why don't you try something like this. $this->redirect(array('controller' => 'controller_name', 'action' => 'fillup-view'));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM