Reply to Re: Change included code

Your name:

Reply:


Posted by Jerry Stuckle on 04/19/07 13:42

Jon Slaughter wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:yfWdncgNMNFQbrvbnZ2dnUVZ_rCsnZ2d@comcast.com...
>> Jon Slaughter wrote:
>>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>> news:MumdnVsZlqGEe7vbnZ2dnUVZ_uLinZ2d@comcast.com...
>>>> Jon Slaughter wrote:
>>>>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>>> news:D5-dnQ6alNLrQrvbnZ2dnUVZ_jednZ2d@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.
>>>>
>>>
>>> Um, because the directory structure differs on my server than my
>>> computer? My server uses public_html to hold html files while my computer
>>> doesn't. I suppose I could go mess with the apache config file and change
>>> it though but it still doesn't solve my problem complete. I still need to
>>> inject html files into containers in the html/php code.
>>>
>> So? Mine differs also - my test system is Windows and most of my hosts
>> are Unix. And my directory here is much different than the one on the
>> server. I just set up Apache to handle it. Much easier than trying to
>> screw around with files like you are.
>>
>>> e.g. when I do
>>>
>>> <?php include ('SomeFile.php') ?>
>>>
>> <?php include ($_SERVER['DOCUMENT_ROOT'] . '/SomeFile.php'); ?>
>>
>> Use the features of the language.
>>
>
> To bad this doesn't work. You don't seem to understand the issue. The
> problem is that using the style sheet is not included properly.
>
> e.g., in the main html file I have
>
> <LINK REL=StyleSheet HREF="styles/main.css" TYPE="text/css">
>
> But when I include the main file the styles/main.css is referenced from the
> directory of that file... but there is not styles/main.css from in that
> directory of that file unless it happens to be the root.
>
> Got any more bright ideas?
>
>
>

Like I said - use

<LINK REL=StyleSheet HREF="/styles/main.css" TYPE="text/css">

And get your test environment straightened out.

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация