更改包含的代码 [英] Change included code

查看:47
本文介绍了更改包含的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以修改我使用的代码


<?php

include(" ../ Index.php");

?>


Index.php文件包含需要修改才能工作的链接。

Index.php基本上是一个html文件使用一个链接的css文件,当它在新文件中包含它的b / b $ b时,它引用了一个错误位置的css文件。我

需要添加../&;到Index.php中的css文件引用使其工作。


谢谢,

Jon

解决方案

Jon Slaughter写道:


我可以修改我使用的代码


< ;?php

包括(" ../ Index.php");

?>


索引。 php文件包含需要修改才能工作的链接。

Index.php基本上是一个html文件,使用链接的css文件,当它的新文件中包含它的b / b $ b在错误的位置引用css文件。我

需要添加../&;到Index.php中的css文件引用使它工作。


谢谢,

Jon



确保您的链接是相对于您的网站根目录的绝对路径。

然后您在其中包含index.php并不重要。


-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================




" Jerry Stuckle" < js ******* @ attglobal.netwrote in message

新闻:D5 *********************** *******@comcast.com。 ..


Jon Slaughter写道:


>我可以修改我使用的代码吗? br />
<?php
包含(" ../ Index.php");
?>

Index.php文件包含链接需要修改才能工作。
Index.php基本上是一个html文件使用链接的css文件,当它包含在新文件中时,它引用了错误位置的css文件。我需要添加../&;到Index.php中的css文件引用,使它工作。

谢谢,
Jon



确保你的链接是一个相对于您的网站根目录的绝对路径。然后

你在哪里包含index.php并不重要。



从我想要的任何时候它实际上会有点麻烦上传到

服务器测试我将不得不更改链接。会更容易只需要

有php只需添加../&;每次我将
上传到服务器时手动执行此操作。


Jon Slaughter写道:


" Jerry Stuckle" < js ******* @ attglobal.netwrote in message

新闻:D5 *********************** *******@comcast.com。 ..


> Jon Slaughter写道:


>>我可以修改代码吗?已包括使用

<?php
include(" ../ Index.php");
?>

索引。 php文件包含需要修改才能工作的链接。
Index.php基本上是一个html文件使用链接的css文件,当它包含在新文件中时它在错误的位置引用一个css文件。我需要添加../&;到Index.php中的css文件引用使它工作。

谢谢,
Jon


确保你的链接是一个相对于你的网站根。然后
你在其中包含了index.php并不重要。



因为任何时候我想上传到<实际上会有点麻烦br />
要测试的服务器我将不得不更改链接。会更容易只需要

有php只需添加../&;每次我将
上传到服务器时手动执行此操作。



为什么会这样?当我上传到我的服务器时,我永远不必更改链接。


-

=============== ===

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


Can I modify code that I have included using

<?php
include("../Index.php");
?>

The Index.php file contains links that need to be modified to work.
Index.php is basically an html file uses a linked css file and when its
included in the new file its referencing a css file in the wrong spot. I
need to add "../" to the css file reference in Index.php to make it work.

Thanks,
Jon

解决方案

Jon Slaughter wrote:

Can I modify code that I have included using

<?php
include("../Index.php");
?>

The Index.php file contains links that need to be modified to work.
Index.php is basically an html file uses a linked css file and when its
included in the new file its referencing a css file in the wrong spot. I
need to add "../" to the css file reference in Index.php to make it work.

Thanks,
Jon

Ensure your link is an absolute path relative to your website root.
Then where you include index.php doesn''t matter.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================



"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:D5******************************@comcast.com. ..

Jon Slaughter wrote:

>Can I modify code that I have included using

<?php
include("../Index.php");
?>

The Index.php file contains links that need to be modified to work.
Index.php is basically an html file uses a linked css file and when its
included in the new file its referencing a css file in the wrong spot. I
need to add "../" to the css file reference in Index.php to make it work.

Thanks,
Jon


Ensure your link is an absolute path relative to your website root. Then
where you include index.php doesn''t matter.

It would actually be a bit more trouble since any time I want to upload to
the server to test I will have to change the link. Would be easier just to
have php just add "../" to one spot instead manually doing it every time I
upload to the server.


Jon Slaughter wrote:

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:D5******************************@comcast.com. ..

>Jon Slaughter wrote:

>>Can I modify code that I have included using

<?php
include("../Index.php");
?>

The Index.php file contains links that need to be modified to work.
Index.php is basically an html file uses a linked css file and when its
included in the new file its referencing a css file in the wrong spot. I
need to add "../" to the css file reference in Index.php to make it work.

Thanks,
Jon

Ensure your link is an absolute path relative to your website root. Then
where you include index.php doesn''t matter.


It would actually be a bit more trouble since any time I want to upload to
the server to test I will have to change the link. Would be easier just to
have php just add "../" to one spot instead manually doing it every time I
upload to the server.

And why is that? I never have to change links when I upload to my servers.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


这篇关于更改包含的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆