Jump to content


Photo

? about php Include


  • Please log in to reply
3 replies to this topic

#1 Firestorm

Firestorm
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 February 2004 - 04:22 PM

I have tried in many different ways to use the php include it seems to not work 90% of the time and the 10 % does not work right.

ok so I have tried to use CSS and have add layers into the Doc. when I preview it it always comes up blank unless I tell the layer to have color then I can see the color...

In this example I am using CSS if someone could give me some advice I would be greatful...



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR...TD/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="PICS-Label" content='(pics-1.1
"http://www.classify.....org/safesurf/" l gen true for
"http://www.mako4css.com/" r (ss~~000 1))' />

<title>Teen Missions Int'l</title>
<!-- to open up an external stylesheet, copy the styles, and only the
styles, into a blank document, starting from here-->
<style type="text/css">


BODY {
background-color : #FFFFFF;
color : #000088;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0px;
}

.Navigation {
position:absolute;
top: 184px;
left: 5px;
width: 198px;
height: auto;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
line-height : 110%;
background-color: #0000FF;
} /*have the navigation elements better separated*/
.Inhalt {
position:absolute;
background: #FFFFFF;
color: #000088;
margin-left: 210px;
margin-right: 20px;
padding: 5px;
font-family : Verdana, Eyechart, Geneva, Arial, Helvetica, sans-serif;
width: 460px;
border: 0.1px solid #FFFFFF;
top: 184px;
left: 23px;
height: 19px;
border-color: #003399;
background-color: #CC66FF;
}
.heading {
position:absolute;
background: #FFFFFF;
color: #000088;
left: 5px;
width: 523px;
padding: 5px;
font-family : Verdana, Eyechart, Geneva, Arial, Helvetica, sans-serif;
width: auto;
border: 0.1px solid #FFFFFF;
top: 0px;
height: 158px;
background-color: #FF0000;
}
.box {/*this is a box where the bottom-navigation*/
/* and the copyright will be placed*/
background: #FFFFFF;
color : #000099;
font-family : Arial, Tahoma, Verdana, Helvetica, sans-serif;
font-size: 12px;
padding : 2px;
margin: 2px;
border-color : #48D1CC;
border-style : groove;
border-width : 2px;/* the border property in longhand*/
}

.oldbrowser {display: none;}


</style>
<!-- and ending here. Do NOT copy the <style type="text/css"> and end-style
declaration -->

<script src="/Mako.js" type="text/javascript"></script>
</head>
<body>


<p class="oldbrowser">This web site is about Cascading Style Sheets as a
means to separate the <strong>presentation</strong> from the
<strong>structural markup</strong> of a web site, and it will help you
answer some of those frequently asked <a
href="/CSSFAQ.htm"><strong>Questions</strong></a>,
explains some of the <a href="/Basics.htm"><strong>Basics</strong></a>
of CSS, gives you tips and tricks for tackling
the problems with <a href="/Issues.htm"><strong>Netscape
4</strong></a>, offers you a tutorial about
<a href="/Tutorial.htm"><strong>Positioning</strong></a> with CSS
(CSS-P, web design
without tables). There is also a page with interesting <a
href="/Links.htm"><strong>Links</strong></a>.
<br />
<strong>This page uses CSS to present the content in the best possible
manner. If you can see this
message, then CSS (or JavaScript) is not enabled in your browser, and the
page will not appear as the
designer intended.</strong></p>

<div class="heading">
<?php include('home/titlebar.html'); ?>
</div>
<div class="Navigation">
<?php include('home/sidebar.html'); ?>
</div>
<div class="Inhalt">
<?php include('/home1/mainpage.html'); ?>
</div>


</body></html>


#2 Cerebrum

Cerebrum
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationUK

Posted 03 March 2004 - 02:02 PM

Hi

Try a require instead, so your code becomes:

<div class="heading">
<?php require('home/titlebar.html'); ?>
</div>

or maybe "require_once" as this wil do much teh same with the only difference being that if the code from a file has already been included, it will not be included again.

hope this helps you out Firestorm

Cerebrum

#3 Firestorm

Firestorm
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 03 March 2004 - 07:07 PM

thanks Cerebrum it has gotten me a step further because now I have both a titlebar and a sidebar but they over lap about 150 px down the page I have tried a few time to attach a css with no luck to get it to attach or is there another way to get the bars to move with out CSS the code I have right now is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="Styles.css" type="text/css">
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.heading {
position: absolute;
height: auto;
width: auto;
left: 5px;
top: 5px;
right: 705px;
bottom: 155px;
}
-->
</style>
</head>

<body>
<div class="heading">
<?php require_once('home/titlebar.html');?>
</div>
<?php require(<div class=".header <a href="/Blair1.php">This is the head of
the Doc</a></div>">); ?>
<div class="Navigation">
<a href="/Blair1.php">ABCDE</a></div>

<div class="Inhalt"> I want to send this to the trash</div>
</body>
</html>
thanks
Firestorm

#4 Cerebrum

Cerebrum
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationUK

Posted 05 March 2004 - 10:55 AM

Hi Firestorm,

You can change the position using in line styles, heres an example :

<div style="position:absolute; left:400px; top:30px;"></div>

also im not sure if this matters but try to take the quatations of the stylesheet link, so your code becomes:

<link rel=stylesheet href="Styles.css" type="text/css">

Cerebrum





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users