downloadbooks_2014 2016-02-28 00:36
浏览 80

PHP CodeIgniter URL导航问题

I am new to CodeIgniter and also have average PHP knowledge. Just started learning CodeIgniter last week and having a basic problem which i can't overcome. my development environment is (OS,PHPStorm,MAMP,APACHE). CI project root is http://localhost:63342/CodeIgniter/ and this address loads my 'default_controller' (login.php in Controllers folder). this controller redirect me to my view "$this->load->view('login_view');". in my view i have a form with this line: which supposed to take me to my form.php in Controller upon the form being submitted but it does not! when i submit i am taken to a url : http://127.0.0.1/CodeIgniter/form with error message "connection attempt to 127.0.0.1 was rejected.".

Also when i try to type a url (i.e. BASE_URL()./index.php/form) or amy other URL in fact, i get errors too. i was under impression that navigating through pages in CI is as simple as typing the name of the file and the method in it in my Controller folder. what am i missing here? any attempt to navigation through URL i get "404 Not Found" error. i am sure i am missing something very simple here but i can't figure out what. i have read the documentations and search the web and no answer is found. i have changed the .htdaccess in root, tried the enable mode in Apache, done all the necessary changes in Config.php , routes.php etc. i would appreciated it if you can tell what am i doing wrong here. i wasn't expecting getting started with CI to be this hard :s

cheers

  • 写回答

2条回答 默认 最新

  • douhu8851 2016-02-28 00:52
    关注

    It seems you "loose" the port (63342) when you redirect. What is the action of your form? If this is an url like "http://localhost/CodeIgniter/form", you should add the port : http://localhost:63342/CodeIgniter/form

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题