问题标签 [shtml]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
253 浏览

php - I have PHP code that needs to be referenced in every single shtml page, is the below possible?

Hey everyone... I'm not too familiar with PHP... but I have PHP code that basically "includes" a file if a condition exists. This PHP code is going to be pretty lengthy and I was wondering if it was possible to create a .php file, and just INCLUDE THAT in my shtml files? What the below is doing is placing the correct navigation bar in the shtml file by running a series of if/else statements in PHP. If the REQUEST_URI (the current page) is xxxxx.shtml, then include THIS navigation bar file, etc. This is working perfectly, but as you can imagine for a site that has hundreds of pages, I would have to place each page in this below "conditional server side includes"- and the disadvantage to this is if some menu items get rearranged in the navigation bars, I want to be able to just edit ONE PHP file rather than every single shtml file that includes the below script. I HAVE NO IDEA how to include the below PHP into it's own file. I assume I need to leave out the as that's specific to HTML. But aside from that, is it just as easy as copying and pasting the above into it's own PHP file?

Currently, here's what I have in every one of my shtml files (it WILL get bigger, this is to just start out):

I want to be able to create an individual .php file that contains the above code, and instead of putting the ABOVE in my shtml pages, I would just put something like "include xxxx.php". Is this possible?

0 投票
3 回答
302 浏览

html - HTML 图像标签

我被要求解决 shtml 文件的问题,问题是这样的:

有人要求编辑 shtml 文件以添加新的单选按钮。她下载了文件,添加了一些内容并将其上传到网络服务器。令我震惊的img src="images/Front_Page_22.jpg是,现在指向file:///C|\path1\path2\images\Front_Page_22.jpg

(请注意 C- 后的管道)

附加信息:下载的页面包含相对路径。,一切都是 img src="images/Front_Page_22.jpg img src=../xyz/images/SomeFile.jpg

我的理解是她通过不触摸图像标签做了正确的事情,因为它们将在服务器上解析并指向服务器上的目录..

我不知道这些相对路径是如何转换为本地路径的!

我可用的附加信息:Person1 在她的本地系统上进行了更改,并在进行更改后,告诉网站管理员上传文件

网络管理员将文件上传到Unix服务器(大学的网络服务器在unix机器上)-我不知道她是使用dreamweaver还是sftp上传文件-我认为这应该不是问题

谢谢

0 投票
4 回答
2261 浏览

php - 当数据库中缺少项目时,PHP 或 htaccess 使动态 url 页面变为 404

典型场景:

  1. 数据库项目显示在页面中http://...?item_id=467
  2. 用户某天删除 了该项目
  3. Google 或用户尝试访问http://...?item_id=467
  4. PHP 挖掘 DB 并看到项目不再存在,所以现在 PHP 必须通过 404 标题和页面告诉 Google/用户该项目不存在。

根据这个答案,我理解没有办法通过 PHP 重定向到 404 Apache 页面,除非在代码中发送 404 标头 + 读取并将默认 404 页面的所有内容发送到客户端。

问题:我已经有一个Apache 解析的自定义404.shtml页面,所以我想简单地使用那个页面。但是,如果我通过 PHP 读取 shtml 页面,则 Apache 将不再对其进行解析

那你建议我怎么做?

是否有一些技巧我也可以用 htaccess 来使用?

谢谢,

0 投票
1 回答
159 浏览

php - 在 404 时处理请求的 URL

我不得不将 CMS 移动到子文件夹中。结果,保存在搜索引擎中的 URL 指向断开的链接。

我为解决这个问题所做的就是用 PHP 将一个页面编码为 404 页面,该页面获取断开的链接,修复它,然后即时重定向到真实页面.. 或者,它只会指向索引页面。

但是,不幸的是,我很难将其设置为 Apache 服务器中的默认 404 页面。它只是不会,我尝试了一些 .haccess 技巧,但他们继续重定向而不将请求的 URL 发送到 (404.php) 进行修复..

我试图将代码包含在 404.shtml 中,但它无法正常工作。

我只想知道请求的 URL,以便我可以处理它..

任何想法?

0 投票
1 回答
183 浏览

ide - Komodo Edit 不支持 shtml 代码提示?

我已经搜索了很多有关此功能的信息,但似乎 Komodo 编辑不支持任何 shtml 智能感知。

我不敢相信,因为我终于找到了一个很棒的 HTML/CSS/JavaScript/jQuery 编辑器,但不支持 SHTML!我以为我终于找到了 Dreamweaver 的替代品,但没有 SHTML 代码提示,这对我来说是个大问题。问题是我经常使用提到的技术,但我也经常使用 SHTML。我用谷歌搜索了很多,但我什至没有找到关于这个问题的帖子!我不敢相信这怎么可能。

你知道如何为 Komode Edit 启用 SHTML 智能感知吗?甚至可能吗?

非常感谢

0 投票
2 回答
11467 浏览

html - 将页脚换行扩展到页面宽度

我在内容换行之外做了一个页脚换行(其他所有内容都在其中)。我想让页脚换行扩展以填充页面的宽度,我希望它固定在底部。这是代码:

页脚包裹{

}

页脚 {

}

该网站是 item9andthemadhatters.com,如果您需要任何其他代码或信息,请告诉我。谢谢!!

更新:

html { 填充:0; 高度:100%;宽度:100%;}

正文{边距:-1px 0 0 0; 背景颜色:#FFF;字体系列:calibri;背景图像:url(图像/item9HeaderSideFiller.gif);背景重复:重复-x;填充:0;高度:100%;宽度:100%;}

裹 {

像素;

页脚包裹{

}

页脚 {

}

}

0 投票
1 回答
168 浏览

asp-classic - 如何实现服务器端包含导航链接

我有 4 个 html 页面。其中 1 个具有通用 UI,需要在所有其他页面上可用。
在导航页面中,有 3 个链接指向其他 3 个页面。我用 include 在这三个文件中都有这个公共文件。
我不知道如何处理链接点击事件并相应地更改页面。
谁能帮我实现这一目标?


提前致谢。维杰

0 投票
1 回答
298 浏览

php - 在 SHTML 页面中生成随机数

我需要将随机数附加到 SHTML 页面中的查询字符串。在 PHP 中生成值很简单:

但是当 SHTML 页面使用这样的语法时,你如何使用它呢?

有人知道 SHTML 页面的语法手册吗?谢谢。

0 投票
3 回答
275 浏览

php - 将 shtml 页面更改为 php

我有一个带有 shtml 扩展名的页面的网站,主要是为了让菜单导航栏与 SSI 正确显示。我现在正在添加一个带有 php 的页面,为了让这个页面正常工作,我给它一个 php 扩展名,这会导致菜单不再显示。我还坦率地发现,对于大多数使用我的网站的人来说,shtml 扩展是一个奇怪的扩展。如果可能,我想为所有页面更改为 php 扩展名,但是如果我不再使用 shtml 扩展名,如何重新格式化我的 SSI 以正确显示?

当前感兴趣的代码是<!--#include virtual="/Navbar.shtml" -->

0 投票
2 回答
124 浏览

php - 是否可以在保证工作的 PHP 文件中设置重定向?

我想调用/包含一个 PHP 脚本,该脚本将强制重定向到另一个页面。(其他页面将包含验证码,如果输入正确,将重新定向返回)。

我需要尽可能可靠的 PHP 重定向代码,所以没有人可以逃避/避免它。如果重定向失败,则将显示页面的其余部分,这不是我想要的。