Solved

page with php include doesn't see css style sheet

Posted on 2008-10-18
13
272 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
Technology Partners: 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
if (is_singular not working 5 39
Checking https returns 301 21 61
Need guidance for special auto increment values 2 23
Increase counter and attr inside a while loop 15 37
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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