Get Paid to Participate - up to $1 per post!     Twitter     Facebook     Google+
Hosting Discussion
 

forgot password?



Reply


Old
  Post #1 (permalink)   05-04-2009, 06:30 AM
HD Guru
 
siforek's Avatar
 
Join Date: Mar 2009
Location: Salt Lake City, UT
Posts: 663

Status: siforek is offline
I've never done this and google doesn't want to tell me how so..

How would I go about forcing html(specifically javascript) onto any page located within a specific directory?
__________________
| | Fiber Elephant | | Virtuozzo & Reseller Hosting
█ | Never oversold, always managed & on the SoftLayer network!
█ | Call us toll free 24/7! | 1-888-92-FIBER
 
 
 


Old
  Post #2 (permalink)   05-04-2009, 07:11 AM
HD Guru
 
siforek's Avatar
 
Join Date: Mar 2009
Location: Salt Lake City, UT
Posts: 663

Status: siforek is offline
I figured it out, .htaccess:
Code:
AddHandler headered .htm
AddHandler headered .html
Action headered /path/file.php
file.php:
PHP Code:
<?php
echo "whatever you want";
readfile($_SERVER["PATH_TRANSLATED"]);
?>
This works great for html files, but I'm still looking for a similar solution for php files that use include for header, footer, etc.. Any help is appreciated.
__________________
| | Fiber Elephant | | Virtuozzo & Reseller Hosting
█ | Never oversold, always managed & on the SoftLayer network!
█ | Call us toll free 24/7! | 1-888-92-FIBER
 
 
 


Old
  Post #3 (permalink)   05-04-2009, 07:31 AM
HD Guru
 
siforek's Avatar
 
Join Date: Mar 2009
Location: Salt Lake City, UT
Posts: 663

Status: siforek is offline
Got it, .htaccess:
Code:
php_value auto_append_file /path/file.php
__________________
| | Fiber Elephant | | Virtuozzo & Reseller Hosting
█ | Never oversold, always managed & on the SoftLayer network!
█ | Call us toll free 24/7! | 1-888-92-FIBER
 
 
 


Old
  Post #4 (permalink)   05-04-2009, 08:00 AM
CSN-UK | Charlie
 
csn-uk's Avatar
 
Join Date: Mar 2009
Location: Swindon (UK)
Posts: 470
Send a message via MSN to csn-uk

Status: csn-uk is offline
wasent entirly sure what you where trying to do, but nice to see you found a soultion
__________________
CSN-UK | Shared Hosting | Dedicated | VPS | Custom Packages Avalible On Request | Quality SSL Certificates from COMODO CA
CSN-UK.net | Server Status | Client Area | Live Support
 
 
 


Old
  Post #5 (permalink)   05-04-2009, 09:14 AM
HD Guru
 
siforek's Avatar
 
Join Date: Mar 2009
Location: Salt Lake City, UT
Posts: 663

Status: siforek is offline
Quote:
Originally Posted by csn-uk View Post
wasent entirly sure what you where trying to do, but nice to see you found a soultion
I needed to force a "site by TJ Phippen" on any page within http://www.tjphippen.com/projects as I didn't like manually including it. Technically I didn't "need" to, but like many things I now use, I did it just to learn.
__________________
| | Fiber Elephant | | Virtuozzo & Reseller Hosting
█ | Never oversold, always managed & on the SoftLayer network!
█ | Call us toll free 24/7! | 1-888-92-FIBER
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: