onice 发表于 2011-5-13 15:47:29

在CI程序里面整合一个购物车的问题,

因为系统是要交给别人继续整合,所以只能用别人给的购物车类。

所以不能用CI自己的购物车,
我把购物车类放在网站根目录,
然后form里面的cation设置为
action="<?php echo base_url()?>cart/index.php?action=add"

提交的时候,CI的路由会把后面的路径解析为类和方法,
但是这个类和方法不存在,所以失败了
不知道要怎么样去让CI不把购物车类的地址解析。

onice 发表于 2011-5-13 16:31:19

在线等,急急急急!

onice 发表于 2011-5-13 16:36:43

如何传递一个真实的文件夹路径

jeongee 发表于 2011-5-13 16:46:39

回复 onice 的帖子

你开rewite了吧,要在htaccess文件里把这个目录排除掉

onice 发表于 2011-5-13 16:48:17

本帖最后由 onice 于 2011-5-13 16:50 编辑

回复 jeongee 的帖子

RewriteCond $1 !^(cart)
我在htaccess写了这么一句以后
点击提交按钮的时候跳转到了
http://127.0.0.1/cart/
这个地址

其他的访问都没有问题,最后在继承购物车的时候才出现这个问题的。
我去掉了index.php

jeongee 发表于 2011-5-13 16:52:44

本帖最后由 jeongee 于 2011-5-13 16:53 编辑

回复 onice 的帖子

晕,至少应该是这样吧,index。php也要排除啊
RewriteEngine on   
RewriteCond $1 !^(index\.php|cart)
RewriteRule ^(.*)$ /index.php/$1

onice 发表于 2011-5-13 16:54:57

回复 jeongee 的帖子

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots)
RewriteCond $1 !^(template)
RewriteCond $1 !^(cart)

RewriteRule ^(.*)$ index.php/$1


目前我的是这样的,我的网站目录不再www下面。写成
RewriteCond $1 !^(index\.php|cart)

以后问题仍然是跳转到 127.0.0.1/cart/

jeongee 发表于 2011-5-13 16:57:23

回复 onice 的帖子

RewriteEngine on
RewriteBase /目录名字
RewriteCond $1 !^(index\.php|images|robots)
RewriteCond $1 !^(template)
RewriteCond $1 !^(cart)

RewriteRule ^(.*)$ index.php/$1

onice 发表于 2011-5-13 17:01:41

回复 jeongee 的帖子



RewriteEngine on
RewriteBase /fanzz
RewriteCond $1 !^(index\.php|images|robots)
RewriteCond $1 !^(template)
RewriteCond $1 !^(index\.php|cart)

RewriteRule ^(.*)$ index.php/$1


我的网站目录为 fanzz

提交以后还是跳转到 127.0.0.1/cart/

form我是这样写的
<form enctype="multipart/form-data" method="post" action="<?php echo base_url()?>cart/index.php?action=add">
页面效果为
<form enctype="multipart/form-data" method="post" action="http://127.0.0.1/fanzz/cart/index.php?action=add">
          

jeongee 发表于 2011-5-13 17:02:59

本帖最后由 jeongee 于 2011-5-13 17:03 编辑

回复 onice 的帖子

RewriteEngine on
RewriteBase /fanzz
RewriteCond $1 !^(index\.php|images|robots|template|cart)
RewriteRule ^(.*)$ index.php/$1
页: [1] 2
查看完整版本: 在CI程序里面整合一个购物车的问题,