powerrajesh
12-03-2003, 04:36 PM
Hi,
I wanted to code to add header/footer banner dynamically like free web hosting people.
So, i wrote .htacces and a simple php file to this task. Even though i am successful with this, i have doubt, whether this is correct way adding banners.
I am pasting the code here. Experts please help me. Tell me the validity of this code.
If anyone using this code, please tell me whether you are happy with the code.
.htaccess
=======
RewriteEngine on
RewriteRule ^(.*)\.html$ /t.php
t.php
===
<?
$filename=$DOCUMENT_ROOT.$REQUEST_URI;
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
echo "<DIV ALIGN='CENTER'>banner</DIV>";
?>
My question is whether this code is correct? Will it kill the CPU? or is this a normal method of using .htaccess and php?
Regards,
<Liaison Note: Signatures must be setup in your profile>
I wanted to code to add header/footer banner dynamically like free web hosting people.
So, i wrote .htacces and a simple php file to this task. Even though i am successful with this, i have doubt, whether this is correct way adding banners.
I am pasting the code here. Experts please help me. Tell me the validity of this code.
If anyone using this code, please tell me whether you are happy with the code.
.htaccess
=======
RewriteEngine on
RewriteRule ^(.*)\.html$ /t.php
t.php
===
<?
$filename=$DOCUMENT_ROOT.$REQUEST_URI;
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
echo "<DIV ALIGN='CENTER'>banner</DIV>";
?>
My question is whether this code is correct? Will it kill the CPU? or is this a normal method of using .htaccess and php?
Regards,
<Liaison Note: Signatures must be setup in your profile>
