在没有 css 和 js 的情况下加载页面后.php网址上添加斜杠
Adding slash on url after .php loads page without css and js
正如标题所说,我在加载页面时遇到问题,例如blabla/index.php末尾有一个斜杠(blabla/index.php/)。它加载页面而不使用 css 和 js,使页面看起来像崩溃了。这发生在我拥有的每个页面中,例如blabla/projects.php/等。知道我该如何解决这个问题吗?为什么会这样?
代码是:
在脑海中.php
<DOCTYPE html>
<html>
<head>
<title>ΑPL Lifts</title>
<link rel = "stylesheet" href = "css/bootstrap.css">
<link rel = "stylesheet" href = "css/main.css">
<meta name = "viewport" content = "width = device-width, initial-scale = 1, user-scalable = no">
<meta http-equiv="content-type" content="text/html" charset = "UTF-8">
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src = "js/bootstrap.js"></script>
</head>
在另一个文件中:
<?php
include 'includes/head.php';
include 'includes/navigation.php';
include 'includes/leftContentColumn.php';
?>
<div class = "col-md-8 maincontent">
<h1 class = "main-title">Προφίλ Εταιρίας</h1><hr>
<div id = "profile">
<div id = "profileParOne" class = "col-md-11">
</div>
</div>
</div>
<?php
include 'includes/rightContentColumn.php';
include 'includes/footer.php';
?>
我认为你的css和js的路径是相对的。/我的脚本.js .你应该重写它以使用绝对路径(相对于根目录),如/js/myscript.js
好的,
我通过将 ccs 和 js 路径更改为:
<link rel = "stylesheet" href = "http://localhost/apl/css/bootstrap.css">
<link rel = "stylesheet" href = "http://localhost/apl/css/main.css">
<script src = "http://localhost/apl/js/bootstrap.js"></script>
相关文章:
- 使用加号按钮添加多个文本框,并通过PHP提交
- 如何使用PHP将javascript变量添加到mysql数据库中
- 在SVG地图上添加水的渐变,就像在谷歌地图(PHP/JS)中一样
- php&js-将电子邮件添加到输入文本中
- 通过PHP将单词添加到游戏中
- 如何创建php函数或任何脚本/jquery Javascript,使我能够获取与复选框关联的值并添加它们
- 如果没有从下拉列表中选择任何值,则允许使用php、mysql、javascript将文本框添加到mysql表中
- 通过php添加到变量won'不起作用
- PHP 添加函数
- Jquery 和 phP:添加动画
- 在html代码中点击与通过id查找|如何将值从php添加到js
- 用php添加两个MySql变量,一个日期和一个数字
- QuickBooks PHP:添加javascript插件
- 为AJAX Live Search PHP添加快捷键(键盘箭头向上/向下)支持
- 使用Javascript和php添加动态文本字段
- 将PHP添加到外部JAVASCRIPT文件
- 使用jQuery + PHP添加项目
- 我想使用angularjs,mysql和php添加自动补全功能
- 我如何将php添加到url
- 如何从 PHP 添加第二个点击操作