server-side-includes

ASP.NET Directive Convention for Declaring Client-Side Includes

♀尐吖头ヾ 提交于 2019-12-21 06:22:51
问题 I am loading .aspx and .ascx files as StreamReader . I want each file to register it's javascript and stylesheet dependencies in some declaration like a <%@ ClientDependency path="~/Scripts/jquery-1.4.1.min.js" %> . Is there an existing convention for doing such a thing? I don't need an implementation, but I don't want to create a new syntax if there is already a way to do it. Also, what are the guidelines for custom <%@ blocks in ASP.NET? Also, please retag this question if you can think of

ASP.NET Directive Convention for Declaring Client-Side Includes

若如初见. 提交于 2019-12-21 06:21:07
问题 I am loading .aspx and .ascx files as StreamReader . I want each file to register it's javascript and stylesheet dependencies in some declaration like a <%@ ClientDependency path="~/Scripts/jquery-1.4.1.min.js" %> . Is there an existing convention for doing such a thing? I don't need an implementation, but I don't want to create a new syntax if there is already a way to do it. Also, what are the guidelines for custom <%@ blocks in ASP.NET? Also, please retag this question if you can think of

Use web.config to allow server-side includes in HTML files (IIS)

白昼怎懂夜的黑 提交于 2019-12-19 02:54:32
问题 In IIS 7.5, is it possible to use web.config alone to enable SSI processing for files that have the .html extension? Specifically, I don't want to use the default SSI extension, .shtml . Reason: I don't want to change the extensions. Doing so would lead to broken links in search engine results. Also, my motivation for doing this in web.config is because this is a shared server . 回答1: Presuming that your hoster has enabled SSI's and delegated Read/Write permissions for handler mappings then

Running PHP without extension without using mod_rewrite?

让人想犯罪 __ 提交于 2019-12-18 11:53:27
问题 Using Apache 2.2 and PHP 5, what's the best way to run PHP without the .php extension? For example, I have a script called app.php and I like to invoke it as: http://example.com/app Please notice that I still want to keep the .php extension to the file and I don't have mod_rewrite . Don't want use index.php either because it requires too many directories. I did find one way by adding this to my .htaccess , AddHandler server-parsed .php SetHandler application/x-httpd-php AddHandler application

PHP include a file at subdomain from main domain on a different server/host

自作多情 提交于 2019-12-13 06:26:32
问题 I have this php www.example.com/template.php and would like to include it in a index.php file at sub.example.com/index.php and this sub-domain is on a different server with a different host. Please advice. 回答1: You can download the file contents into a php file then include that, $url = "http://sub.example.com/index.php"; $file = file_get_contents($url); file_put_contents('index.php', $file); include index.php; I'd recommend changing the name from index.php tho, and make sure the php file isn

Change of folder path when require/ include an php file

你说的曾经没有我的故事 提交于 2019-12-13 04:45:36
问题 I am currently using an index.php to include another file , it structure like: root / index.php / new/ index.php / img/ test.jpg And I write following in root/index.php : <?php require_once("new/index.php"); ?> the problem is , all paths in it are wrong. As all paths are based on new/index.php. For example, In new/index.php my test.jpg is like <img src="img/test.jpg" /> It shows http://www.test.com/new/img/test.jpg when I directly access new/index.php But it shows http://www.test.com/img/test

Use the required / included file as base directory in PHP

六眼飞鱼酱① 提交于 2019-12-12 03:55:13
问题 I am currently using an index.php to include another file , it structure like: root / index.php / new/ index.php And I use <?php require_once("new/index.php"); ?> the problem is , all paths in it are wrong. As all paths are based on new/index.php , when i include it, all paths changes to based on index.php. Are there any way to let the outsider visit index.php but at the same time my actual code is stored in new/ folder? Thanks 回答1: Are you talking about something like <?php echo '<img src=

Passing variable to an include

爷,独闯天下 提交于 2019-12-11 08:41:48
问题 index.php <?php $title = "This is the page title"; require_once '/includes/header.php'; ?> header.php <head> <title><?= $title ?></title> </head> Output 回答1: I think short tags may not be enabled. Try: <title><?php echo $title ?></title> instead 回答2: did you enable short tags in php.ini? short link 回答3: My only thought is that you have short tags disabled in your php.ini. Try the following: <head> <title><?php echo $title; ?></title> </head> 回答4: You need to configure your PHP for short_open

asp.net 4 precompile utility and classic asp files

半世苍凉 提交于 2019-12-11 07:32:06
问题 We have a huge site that still has over 800 classic asp pages. While working on the upgrade of the site to 4.0 I cam across an issue where asp.net precompile utility aspnet_compiler throws millions of errors in those classic asp pages, especially with the include directives. (mainly constants and functions are defined in the global files not visible in the included file itself) Is there a way to tell precompile utility to ignore classic asp and inc files? Is there any other way other then

Server Side Include - php

旧时模样 提交于 2019-12-11 03:05:47
问题 I'm updating a site that is currently static html (i.e. index.html). I'd like to pull in blog posts into the page and only know of SimplePie to accomplish this. Question 1 - If I update the site from .html to .php is there a hit in SEO while the Search Engines re-index? Question 2 - Is there a way to use Server Side Includes to include a .php file of my SimplePie results, or another way to pull blog posts directly into a .html file? I'd appreciate advice. 回答1: For question 1 - no, not