Jump to content

PHP and HTML


Archadian

Recommended Posts

Can you give a very small specific example?

 

Are you referring to like using an include file?

 

If so you could create a file with the .html extension and then just put this code on each page where you wanted it...

 

<?php
//include page with all formatting
require_once "../../format.html";
?>

Link to comment
https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651312
Share on other sites

include('templatefile.html')

or, I like the idea of having one index page and when they click on a link, it creates a URL variable and then u use that variable to decide what content to include. like

www.domain.com/?Page=Aboutus.php

then, have

$Page = "index.php"

if(isset($_GET['Page'])) { $Page = $_GET['Page']; }

include($Page)

 

Also, CSS is really handy for templates.

 

EDIT****** YOU WILL WANT MORE THAN THAT SCRIPT, SORRY... don't use what I just said. Someone can do some pretty bad stuff to your site if you use that...

but you can use similar techniques with a few more lines of code and be safe.

again sorry.

Link to comment
https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651316
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.