Solved

page with php include doesn't see css style sheet

Posted on 2008-10-18
13
273 Views
Last Modified: 2013-11-05
This PHP is all new to me. I'm trying to use PHP includes to pull text in. I tried it once from an existing page and it worked fine. I tried it and made a new page, as a test, and this one is not pulling in the CSS. Here are links to the pages:

Existing old page:
http://www.templebnaiisraelclw.org/sisterhood1.php
This is the php line on the above page:
<?php require("sisterhood.php"); ?>

This works. This is the include file:
http://www.templebnaiisraelclw.org/sisterhood.php

Now, this one doesn't work. First, here is the newly designed main page I am testing:
http://www.templebnaiisraelclw.org/test.html#

The new page is under Home -> What's new
It doesn't see the css:
http://www.templebnaiisraelclw.org/new.php/
This is the php line on this page:
<?php require("new_update.php"); ?>

This is the include file:
http://www.templebnaiisraelclw.org/new_update.php/

I just don't get what's different. Appreciate your help!

0
Comment
Question by:garfld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 13

Expert Comment

by:AielloJ
ID: 22749020
Try putting a './' in front of your include filenames.  Use './' assuming they're in the same folder as the pages including them.  Sometime the search path in the configuration of whatever is serving your page (IIS or Apache) can cause some funny interactions.  For example, change:

  <?php require("sisterhood.php"); ?>
to
<?php require("./sisterhood.php"); ?>
0
 
LVL 12

Expert Comment

by:Rok-Kralj
ID: 22749029
It is problem in you, not the code...

CSS NOT VISIBLE:
http://www.templebnaiisraelclw.org/new.php/
CSS VISIBLE:
http://www.templebnaiisraelclw.org/new.php

Just don't put extra slash in your browser bar, ok :D
0
 
LVL 12

Accepted Solution

by:
Rok-Kralj earned 250 total points
ID: 22749039
And you also have to change your menus to link without the slash at the end.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:garfld
ID: 22749064
AielloJ: tried the slash; didn't work.
0
 
LVL 2

Author Comment

by:garfld
ID: 22749068
Rok-Kralj:
And you also have to change your menus to link without the slash at the end.


It's not me doing that. The browser (firefox) is doing it automatically. Can't avoid it, can I ?
0
 
LVL 12

Expert Comment

by:Rok-Kralj
ID: 22749072
That's not true. You are doing it automatically :D

I checked HTML source code and the slash is there :)
0
 
LVL 2

Author Comment

by:garfld
ID: 22749075
Rok-Kralj:
And you also have to change your menus to link without the slash at the end.

Internet Explorer is doing it also, and doesn't see the CSS.

My point is this: it worked perfectly in example 1 (sisterhood) and the exact same thing isn't working in example 2 (new).
0
 
LVL 12

Expert Comment

by:Rok-Kralj
ID: 22749084
Look sisterhood1.php is your old page, where menus are OK.

While on your new page, your menus aren't OK... How many times do I have to repeat this?
I'm expert and I surely know what's wrong.
0
 
LVL 2

Author Comment

by:garfld
ID: 22749085
Rok-Kralj:
That's not true. You are doing it automatically :D

I checked HTML source code and the slash is there :)


I am NOT doing it. What you see is coming from the server. This is my markup (with the preceding slash lol) :

<div id="main">
<!-- begin main content -->
<p>
<?php require("./new_update.php"); ?>
</p>
<!-- end main content -->
</div>
0
 
LVL 2

Author Comment

by:garfld
ID: 22749087
While on your new page, your menus aren't OK... How many times do I have to repeat this?
I'm expert and I surely know what's wrong


LOL

Which menu exactly isn't ok?
0
 
LVL 2

Author Comment

by:garfld
ID: 22749090
wait !!! don't answer yet !!! Let me check it out !!!!
0
 
LVL 12

Expert Comment

by:Rok-Kralj
ID: 22749094
This menu:
http://www.templebnaiisraelclw.org/test.html

If you go under Home > What's new
you have pretty nice slash at the end of <a href="" attribute
0
 
LVL 2

Author Closing Comment

by:garfld
ID: 31507440
Duh. I hate when that happens. Will post another question right now!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question