Solved

page with php include doesn't see css style sheet

Posted on 2008-10-18
13
270 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
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

831 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