php – 使用CodeIgniter http:// :: 1 / codeigniter / in html sourcecode在表单操作中显示IP地址

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – 使用CodeIgniter http:// :: 1 / codeigniter / in html sourcecode在表单操作中显示IP地址脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我在Xampp上安装了CI脚本.目前我正在处理表单,当我点击htML上的提交时,它什么都不做.

我试过了

echo form_oPEn('verifylogin');
echo form_open();

它在代码显示

<form action="http://::1/codeignITer/verifyLOGin">
<form action="http://::1/codeigniter/">

分别.

我不明白这个“http:// :: 1 /”是什么,如何摆脱它?

如果ip地址显示在表单action或url中

> http:// :: 1 / yourPRoject /
> http://127.0.0.1/yourproject/

机会将基本网址留空

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,| WITH a trailing slash:
|
|   http://example.COM/
|
| WARNING: You MUST set this value!
|
| If it is not set,then CodeIgniter will try guess the protocol and path
| your installation,but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available,or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains,remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/

$config['base_url'] = '';

现在,在最新版本的codeIgniter中,不建议您将base_url留空.

> $config [‘base_url’] =’http:// localhost / yourproject /’;
> $config [‘base_url’] =’http://www.example.com/’;

并且总是好的结束url与/

您可能需要在此处为​​您的表单创建路线

application > config > routes.PHP

CodeIgniter 3:Routing

CodeIgniter 2:Routing

更新:

当您创建文件时,您必须在文件名和类上具有第一个字母大写.

有时候会发生这样的情况,所有这些都可能在本地主机环境中工作较少,但是当您访问实时服务器时,会发生错误或不提交表单正确等.

示例:从Controllers这也适用于Models

这是有效的

文件名:Verifylogin.PHP

<?PHP

class Verifylogin extends CI_Controller {

    public function __construct() {
       parent::__construct();
    }

    public function index() {

    }

}

这是有效的

文件名:Verify_login.PHP

<?PHP

class Verify_login extends CI_Controller {

    public function __construct() {
       parent::__construct();
    }

    public function index() {

    }

}

这是无效的

文件名:verifylogin.PHP

class verifylogin extends CI_Controller {

    public function __construct() {
       parent::__construct();
    }

    public function index() {

    }

}

这是无效的

文件名:Verify_Login.PHP

class Verify_Login extends CI_Controller {

    public function __construct() {
       parent::__construct();
    }

    public function index() {

    }

}

Codeigniter Doc’s

脚本宝典总结

以上是脚本宝典为你收集整理的php – 使用CodeIgniter http:// :: 1 / codeigniter / in html sourcecode在表单操作中显示IP地址全部内容,希望文章能够帮你解决php – 使用CodeIgniter http:// :: 1 / codeigniter / in html sourcecode在表单操作中显示IP地址所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。