Solved

page with php include doesn't see css style sheet

Posted on 2008-10-18
13
271 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cpanel file manager 8 41
how to use a switch statement with heredoc 11 33
PHP and JQuery Syntax question 4 26
PHP Echo with auto submit 8 28
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…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

860 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