Hello, i'm currently building my own xHTML/CSS portfolio site and i'm looking to add a blogging page to it which will be in line with the same design etc. How can I do it?
Page 1 of 1
Adding a php page to a xHTML site...
#2
Posted 29 January 2012 - 06:14 PM
notxalckram, on 29 January 2012 - 05:38 PM, said:
Hello, i'm currently building my own xHTML/CSS portfolio site and i'm looking to add a blogging page to it which will be in line with the same design etc. How can I do it?
going by the heading a php page with xhtml, if your blog page was php and u wanted to use the same layout as your xhtml, all u would do is either have all your php in an seperate file and reference it in, or have all your php inside its tags at the top of your page and the xhtml at the bottom of the page
hope that helps or puts u in the right dirrection
#3
Posted 10 February 2012 - 10:11 AM
I'm no php coder however I now tend to make all my pages (even static) using a .php extension. This allows for better relocation for 301 at a later date and it allows for including files as Collie says. The basics I use are as follows;
This is the path to the files on the server. When I want to include say a universal navigation I build it in a test page and once happy with it I grab all the code and export it to a new file, calling it summit like header.php ... as below;
Then in all my pages I simply call it in ...
No doubt there is an official php name for this method (or a better way) but as I said before I'm not a php developer.
<?php $server_path="/home/default/sitename/user/htdocs"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
This is the path to the files on the server. When I want to include say a universal navigation I build it in a test page and once happy with it I grab all the code and export it to a new file, calling it summit like header.php ... as below;
<div id="nav"><a href="#"><img src="/layout/stock.png" alt="New & Used Camper Vans for Sale" /></a><a href="#"><img src="/layout/volkswagen-T5.png" alt="Volkswagen T5 Camper Vans" /></a><a href="#"><img src="/layout/volkswagen-T4.png" alt="Volkswagen T4 Camper Vans" /></a><a href="#"><img src="/layout/classifieds.png" alt="VW Camper Classified Adverts" /></a><a href="#"><img src="/layout/testimonials.png" alt="Customer Testimonials" /></a><a href="#"><img src="/layout/about.png" alt="About" /></a><a href="#"><img src="/layout/directions.png" alt="Directions" /></a><a href="#"><img src="/layout/contact.png" alt="Contact" /></a><a href="#"><img src="/layout/home.png" alt="Home" style="border-right-width: 0px;" /></a></div>
Then in all my pages I simply call it in ...
<body> <div id="wrap"> <? include $server_path."/includes/header.php"; ?> </div> </body>
No doubt there is an official php name for this method (or a better way) but as I said before I'm not a php developer.
Share this topic:
Page 1 of 1
Help














