dongye3917 2019-08-10 20:23
浏览 60
已采纳

在本地主机上工作时,表单上的双重链接

~

I have tried to create a form and submit the data using a method from a CI controller, but when I press submit the link just doubles as follows:

http://localhost/1xtask/index.php/auth/localhost/1xTask/auth/login

I am using Xampp. I have double checked the CI config file and the HTACCESS.

Config file relevant data:

$config['base_url'] = 'localhost/1xTask/';

$config['index_page'] = '';

HTACCESS file:

 RewriteEngine on
 RewriteCond $1 !^(index\.php|resources|robots\.txt)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Still, I can't get it to work properly :(

Form action looks like this in browser: <form action="localhost/1xTask/auth/login" method="post" accept-charset="utf-8">

I use <?php echo form_open('auth/login'); ?> and <?php echo form_close(); ?> to create the form

Thank you in advance!

  • 写回答

1条回答 默认 最新

  • dongqiu3709 2019-08-10 20:44
    关注

    I am not really sure but I think you have to add an HTTP protocol to your
    $config['base_url'] = 'http://localhost/1xTask/'; and that might resolve your issue.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么