osCommerce 链接到的类别进入错误页面

发布于 2024-10-22 02:47:25 字数 719 浏览 2 评论 0原文

我正在修改一个用 osCommerce 制作的网站(我没有制作这个网站),我必须修改的内容之一是主页的外观。我的问题是我修改了 index.php 文件,并且所有更改看起来都很好。

但是,当我单击使用此函数用 PHP 编写的链接时:(

<?php echo tep_href_link(FILENAME_DEFAULT,'cPath=24&sort=2a') ?>

/includes/filenames.php 中,我有 define('FILENAME_DEFAULT', 'index.php');。)

发生的情况是,它显示了正确的结果,但在不同的页面中,采用旧的设计。我不明白它,因为该链接应该将我带到我修改过的同一个 index.php ,但显然它会将我带到其他地方。

我不知道它显示的是哪个页面,我唯一看到的是 PHP 函数编写的链接:

(my_catalog_folder)/escaparate-c-24.html?sort=2a&osCsid=p7fp55t489nv042p0ip4mp7si1

我猜 tep_href_link() 正在写这个,但我不知道哪个页面用于显示结果。

任何线索将不胜感激!

I'm modifying a website made with osCommerce (I didn't make this website), and one of the things I have to modify is the look of the home page. My problem is that I have modified the index.php file, and all the changes look fine.

However, when I click a link that has been written in PHP with this function:

<?php echo tep_href_link(FILENAME_DEFAULT,'cPath=24&sort=2a') ?>

(In /includes/filenames.php I have define('FILENAME_DEFAULT', 'index.php');.)

What happens is that it shows the correct results, but in a different page, with the old design. I don't understand it, because that link should take me to the same index.php that I modified, but obviously it's taking me somewhere else.

I don't know what page is it showing, the only thing I see is the link written by the PHP function:

(my_catalog_folder)/escaparate-c-24.html?sort=2a&osCsid=p7fp55t489nv042p0ip4mp7si1

I guess that the tep_href_link() is writing that, but I don't know what page is using to show the results.

Any clues would be much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

饭团 2024-10-29 02:47:25

如果商店安装了 SEO URL 模块,这是预期的行为。

查看 .htaccess 文件,您应该会发现这一行:

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

对某个类别的任何和所有请求都将被重写为更友好的 URL 字符串,如您注意到的那样。

至于旧设计的使用,请使用 $_SERVER["PHP_SELF"];$ 中的 echo 仔细检查正在调用的实际文件_SERVER["SCRIPT_NAME"]; 并确保文件名和路径正确。

将其放入像 includes/application_top.php 这样的文件中,放在最后几行之前(或者结束 ?> 如果您仍然有的话):

echo $_SERVER["SCRIPT_NAME"];

这也可能是由于页面的缓存。检查是否还安装了缓存模块。

This is expected behaviour if the store has the SEO URLs module installed.

Look in the .htaccess file and you should spot this line:

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

Any and all requests for a category will be rewritten in a friendlier URL string like the one you noted.

As to the use of the older design, double-check the real file being called with an echo out of the $_SERVER["PHP_SELF"]; or $_SERVER["SCRIPT_NAME"]; and make sure the filename and path is correct.

Drop that into a file like includes/application_top.php before the final lines (or the closing ?> if you still have that there):

echo $_SERVER["SCRIPT_NAME"];

It may also be due to caching of the pages. Check to see if there a cache module installed as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文