Changing Htm to PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mme
Forum Newbie
Posts: 6
Joined: Thu Sep 08, 2005 12:16 am
Location: Somewhere

Changing Htm to PHP

Post by mme »

Hi my current website is in htm and each time I update it i have to refresh it so i was wondering if there was some way to convert them into php so it will reload itsself each time :wink:

how :?:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

reload itself each time? reload the page in your browser?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Are you talking about not caching the page? Your web server probably has an option to do that, and yes you can change the extensions if you want to, just rename the files..
mme
Forum Newbie
Posts: 6
Joined: Thu Sep 08, 2005 12:16 am
Location: Somewhere

Post by mme »

Yea so the page reloads each time it is viewed :lol:
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Save your page as php and use header to indicate to reload each time.

Code: Select all

<?php
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
?>
<html>
.
.
.
</html>
User avatar
malcg
Forum Newbie
Posts: 3
Joined: Tue Sep 06, 2005 12:15 pm
Location: London, UK

Page not Cached

Post by malcg »

Use this code before any output is sent to browser:

Code: Select all

header("cache-control: no-store, no-cache, must-revalidate");
	header("expires: " . gmdate("YmdTHis") . "GMT");
This will force NO CACHING of page in any cache between server and browser

I have a PREPEND file that is output with all .php files automatically, viz:
Amend php.ini to state:

Code: Select all

auto_prepend_file            = Prepend.php
where Prepend.php contains above code

BTW I also out my copyright notice at the bottom of each file with an append

Regards

Malcolm
http://av-managaing-consultants.com
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Re: Changing Htm to PHP

Post by patrikG »

mme wrote:Hi my current website is in htm and each time I update it i have to refresh it so i was wondering if there was some way to convert them into php so it will reload itsself each time :wink:

how :?:
Two things:

1) Welcome to the forum
2) Know your problem, ask precise questions and you will have precise answers: http://www.catb.org/~esr/faqs/smart-questions.html
mme
Forum Newbie
Posts: 6
Joined: Thu Sep 08, 2005 12:16 am
Location: Somewhere

Re: Page not Cached

Post by mme »

malcg wrote:Use this code before any output is sent to browser:

Code: Select all

header("cache-control: no-store, no-cache, must-revalidate");
	header("expires: " . gmdate("YmdTHis") . "GMT");
This will force NO CACHING of page in any cache between server and browser

I have a PREPEND file that is output with all .php files automatically, viz:
Amend php.ini to state:

Code: Select all

auto_prepend_file            = Prepend.php
where Prepend.php contains above code

BTW I also out my copyright notice at the bottom of each file with an append

Regards

Malcolm
http://av-managaing-consultants.com
Would you please give me an example? :wink:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you may want to know that sending no-cache will make your site run slower and require you to use more bandwidth allotment far far faster.
mme
Forum Newbie
Posts: 6
Joined: Thu Sep 08, 2005 12:16 am
Location: Somewhere

Post by mme »

I don't have a bandwitch limit :lol:
Post Reply