Jump to content

PHP screws up my CSS. Or something.


macfall

Recommended Posts

For the sake of convenience, I'm going to go ahead and link to the site that I'm building:

 

http://fledgepress.com

 

The CSS file I use for my layout loads fine on the main page of my site. But all of the "stories" links (on the nav bar on the left) lead to pages that, apparently, don't load the CSS file.

 

Here is the code for the relevant navigation links (included as a part of the file "nav_ads.php" as referenced below):

 

<div id="nav">
    <ul class="level1">
<li><a href="http://fledgepress.com">Home</a></li>
<li><a href="/about.php">Who We Are</a></li>
<li class="submenu"><a href="/stories.php">Stories</a>
    <ul class="level2">
	<li class="submenu"><a href="/book.php?story=1&chapter=">The Burning Rock Ranch</a>
	    <ul class="level3">
		<li><a href="/book.php?story=1&chapter=1">First chapter</a></li>
		<li><a href="/book.php?story=1&chapter=0">Latest chapter</a></li>
		<li><a href="/book.php?story=1&chapter=">Chapter list</a></li>
	    </ul>
	</li>
        <li class="submenu"><a href="/book.php?story=2&chapter=">Novant Children</a>
	    <ul class="level3">
		<li><a href="/book.php?story=2&chapter=1">First chapter</a></li>
		<li><a href="/book.php?story=2&chapter=0">Latest chapter</a></li>
		<li><a href="/book.php?story=2&chapter=">Chapter list</a></li>
	    </ul>
	</li>
        <li class="submenu"><a href="/stories/vigilance.php">Vigilance</a>
	    <ul class="level3">
		<li><a href="/book.php?story=3&chapter=1">First chapter</a></li>
		<li><a href="/book.php?story=3&chapter=0">Latest chapter</a></li>
		<li><a href="/book.php?story=3&chapter=">Chapter list</a></li>
	    </ul>
	</li>
            </ul>
</li>

 

And here is the content of "book.php" to which all the "Stories" links lead.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
    <title>Fledge Press Online Reader</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <link rel="stylesheet" type="text/css" href="/cds_styles.css">  
    <style type="text/css">
#synopsis {margin: 1em; padding: 5px;}
#synopsis h1{margin: 0; padding: 0.25em 0.33em;
    background: rgb(4%,4%,4%) url(morn-fade.jpg) 100% -1.25em no-repeat;
    color: #CCC; font: small-caps bold 2em/1em Arial, Helvetica, sans-serif;
    text-align: right; font-size: 30pt;}
#storyText {overflow: auto; height: 36em; font: Helvetica;}
#navbuttons {margin: 1em; padding: 5px;}
#navbuttons h1{margin: 0; padding: 0.25em 0.33em;
    background: rgb(4%,4%,4%) url(morn-fade.jpg) 100% -1.25em no-repeat;
    color: #CCC; font: small-caps bold 2em/1em Arial, Helvetica, sans-serif;
    text-align: center; font-size: 30pt;}
    </style>
</head>

<body>

<?php include("http://fledgepress.com/nav_ads.php"); ?>

<div id="main">

    <?php
$story = $_GET['story'];
	switch ($story) {
		case "1":
			include "title_01.php";
		break;
		case "2":
			include "title_02.php";
		break;
		case "3":
			include "title_03.php";
		break;
		default:
			include "title_00.php";
    		break;
    		}
    ?>
    <div id="storyText">
 <?php
$chapter = $_GET['chapter'];
switch ($story) {
	case "1":
		switch ($chapter) {
		case "0":
	   	include "burningrockranch_latest.php";
		break;
		case "1":
	 		include "burningrockranch_01.php";
		break;
		case "2": 
	 		include "burningrockranch_02.php";
		break;
		default:
	 		include "burningrockranch_toc.php";
		break;
		}
	break;
	case "2":
		switch ($chapter) {
		case "0":
			include "novantchildren_latest.php";
		break;
		case "1":
			include "novantchildren_01.php";
		break;
		case "2";
			include "novantchildren_02.php";
		break;
		default:
			include "novantchildren_toc.php";
		break;
		}
	case "3":
		switch ($chapter) {
		case "0":
			include "vigilance_latest.php";
		break;
		case "1":
			include "vigilance_01.php";
		break;
		case "2":
			include "vigilance_02.php";
		break;
		default:
			include "vigilance_toc.php";
		break;
		}
	default:
		echo "An error has occured!";
	}
?>
</div>

<?php include("http://fledgepress.com/navbar.php"); ?>

</div>

<?php include("http://fledgepress.com/bottom.php"); ?>

</body>

</html>

 

I suspect that the problem is with my include statements, but I'm not sure. I'm also aware that there are other problems with the site (lots!) and I'll gladly accept any help on those, but for now I'm going after the most obvious problem of the layout.

Link to comment
https://forums.phpfreaks.com/topic/226976-php-screws-up-my-css-or-something/
Share on other sites

That would be something like "home/public_html/fledgepress/[filename].php", right?

 

I edited so they all say

include("[filename].php");

. I'm still having the same problem.

 

I am a noob among noobs at this, and not a natural techie. I failed QBasic TWICE in high school and JavaScript in college. So you can expect a lot of very, very stupid questions from me.

Oops, edited my comment into my old post.

 

Okay so I fixed them all so they just have the filename. Same problem. The site doesn't output a PHP error until it gets to my navbar at the bottom, which has to do with pagination and probably has to do with me not knowing how to code it properly.

A man walks into a doctor and says 'doctor, my head feels weird. What's wrong?'.

 

The doctor says 'I'm a doctor man, not a magician. I can't tell you anything without more information than that.'

 

A coder comes onto a website and says 'The pagination code at the bottom of the page. Doesn't work; don't know why.' Can you guess what the members of the site say?

 

Also, you should start a new thread for a new topic.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.