Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

Capital Tutorials Christian Cosmos Proof That God Exists Deceptive Logic 

Change Language

Who's online

There are currently 0 users and 13 guests online.

Something like iFrames?

All right, I'm curious if PHP can do (and I'm pretty sure it can) something so that it takes HTML saved as another file and puts it into a PHP script... so like, I have one file called:

htmlheader.html

And three more files:

headerinput.php
headerinput2.php
headerinput3.php

Would it be possible for all three .php files to read the HTML file and insert the HTML code into the PHP script to be read as an 'echo' function? So instead of having to change the header on all three PHP pages (or hundreds if I manage to create that many) I could just change the HTML file and all the other pages would read from that?


Submitted by Ataru on July 18, 2008 - 1:58pm.
printer friendly version

Yep. This is probably one

Yep. This is probably one of my most used pieces of code:

<?php include('htmlheader.html'); ?>

You might also want to read more about php includes.


Using PHP Includes to save time

Maspick (One of the Authors of C2D) wrote a couple posts on this very subject.

You Can CMS Without One and You Can CMS Without One Two

This one thing alone is what got me into PHP.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati