Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with php includes

Featured Replies

Hi, im really stuck, im trying to use php includes to build my index.php page and then have that page formatted by the stylesheet. However im running into trouble formatting lists and basically aything thats not in the first include. Its just not working.

Here are my files

 

Index.php

 

<html>
<head>
<link rel="stylesheet" type="text/css"
href="style.css" />
</head>
<body>
<div id = "wrapper">
<?php include("tpl_header.php");
  include("lcol.php"); ?>

</div>
</body>
</html>

 

tpl_header.php

<div id = "Header">
<div class="toplinks"><a href="#">Home</a>
			  <a href="#">Contact</a>
			  <a href="#">About</a>
</div>

<div id="logo"></div>


</div>


</div>

 

 

lcol.php

 

<div id ="lcol">

<div class ="lnav">
<div class ="lnavHdr">Title</div>
<ul>
	<li><a href="#">Home</a></li>
	<li><a href="#">About</a></li>
	<li><a href="#">Articles</a></li>
	<li><a href="#">Me</a></li>
</ul>

</div>




</div>

 

 

style.css

 

#wrapper{
width: 1000px;
margin-left: 150px;
margin-right: auto;
}

#header {
width: 1000px;
float: left;




}

.toplinks {
width: 1000px;
height: 20px;
border: 1px solid black;
}

.toplinks a {
padding-left: 15px;
text-decoration: none;
font-size: 8Pt;	
float: right;

}

#logo {
width: 1000px;
height: 150px;
border: 1px solid blue;


}

#lnav{
width: 200px;
float: left;
border: 1px solid red;
}

#lnav ul {
list-style:none;
}

#lnav ul li {
border: 0px;
padding: 0px;
}

#lnav ul li a {
text-decoration: none;
font-size: 8Pt;	

}

 

 

 

Basically the only thing getting formatted is toplinks. The rest is just random and it wont even follow out the list-design: none command

Hey.

 

That should be more like:

 

#my_div = <div id="my_div">

#my_div .my_div_class = <div class="my_div_class">

 

index.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtmml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
 <title>title</title>
  <link rel="stylesheet" type="text/css" href="style.css" />
</head>
 <body>
<?php 
	include('./tpl_header.php');
      include('./lcol.php');
?>
 </body>
</html>

 

tpl_header.php

<div class="toplinks">
<a href="#">Home</a>
<a href="#">Contact</a>
<a href="#">About</a>
</div>
<div id="logo">
</div>

tpl_header.php

<div id ="lcol">
<div class="lnav">
 <div class="lnavHdr">
Title
 </div>
   <ul>
       <li><a href="#">Home</a></li>
       <li><a href="#">About</a></li>
       <li><a href="#">Articles</a></li>
       <li><a href="#">Me</a></li>
   </ul>
</div>
</div>

style.css

body {
width: 900px;
background: #f5f5f5;
text-align: center;
margin: auto;
font-family: Tahoma, Verdana, Helvetica, Sans-Serif;
padding-top: 5px;
}

.toplinks {
float: right;
width: 700px;
height: 20px;
background: white;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
}

.toplinks a {
float: right;
text-decoration: none;
font-size: 12px;
padding-left: 15px;
padding-right: 10px;
}

.toplinks a:hover {
text-decoration: underline;
}

#logo {
float: right;
width: 700px;
height: 150px;
background: white;
border: 1px solid blue;
}


#lcol {
float: left;
width: 198px;
background-color: white;
}

#lcol .lnav{
border-top: 1px solid red;
border-left: 1px solid red;
border-bottom: 1px solid red;
text-align: left;
}

#lcol .lnavHdr {
font-weight: bold;
padding-left: 5px;
}

#lcol .lnav ul {
list-style: none;
}

#lcol .lnav ul li a {
text-decoration: none;
font-size: 12px;
}

 

--

jelly

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.