搜索不能在php文件上工作

Search doesn't work on php file

本文关键字:工作 文件 php 不能 搜索      更新时间:2023-09-26

我正在测试一些没有使用数据库的表上的基本搜索。

问题是搜索在HTML文件中工作,但未能在php文件上工作(我使用codeigniter框架)。

这是两个html文件的代码:

 <script src="js/search.js"></script>

这是我的CI php视图文件的代码:

script type="text/javascript" src="application/views/ui/js/search.js">

我在视图上的htaccess文件:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /webs/BCI/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

我的base_url函数工作在我的css文件,但它只是不会加载我的JS文件位于我的JS文件夹。是否有更多的配置需要加载一个js文件?

您必须将所有css, jsimage文件存储在public_html文件夹下。将文件命名为-

<script src="<?php echo base_url(); ?>js/search.js"></script>