Web Design Forum: Adding a php page to a xHTML site... - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Adding a php page to a xHTML site...

#1 User is offline   notxalckram 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 14
  • Joined: 04-October 10
  • Reputation: 0

Posted 29 January 2012 - 05:38 PM

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?
0

#2 User is online   collie 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 77
  • Joined: 08-June 11
  • Reputation: 1
  • Gender:Male
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 29 January 2012 - 06:14 PM

View Postnotxalckram, 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
0

#3 User is offline   NoClass 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 79
  • Joined: 07-February 12
  • Reputation: 6
  • Gender:Not Telling
  • Location:Surrey
  • Experience:Nothing
  • Area of Expertise:Web Designer

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;

<?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 &amp; 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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users