Solved

page with php include doesn't see css style sheet

Posted on 2008-10-18
13
268 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now