Table of Contents

  1. Introduction
    1. What to include?
    2. php.ini
      1. auto_prepend_file
      2. auto_append_file

What to include?

By including a php file using php.ini, you can replace the headers in your html with dynamic headers.

Include a php file that contains a function to replace html with different html. You include a file from your php.ini like auto_prepend_file /web/askapache.com/config.php?


config.php example from: Effective way to update your blog's header scripts



';

$quantcast = '



';

$mybloglog = '

';

$pages	= array(); // Add pages (relative to the public site root) that should be ignored
$ip		= array(); // Add IP addresses that should be ignored, for instance you don't want to track yourself or your company's visit to your blog.

if (
	strpos($page,'frameset') !== false ||
	(!empty($ip) && in_array($_SERVER['REMOTE_ADDR'], $ip)) ||
	(!empty($pages) && in_array((isset($_SERVER['PHP_SELF']) && !empty($_SERVER['PHP_SELF']))?$_SERVER['PHP_SELF']:$_SERVER['SCRIPT_NAME'], $pages))
	)
{ return $page; }
$replace = array
	(
		'',
		''
	);
	return str_replace($replace, "n{$googleAnalytics}nn{$quantcast}nn{$mybloglog}r", $page);
}
ob_start("Config");
?>

php.ini

auto_prepend_file

Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the include() function, so include_path is used. The special value none disables auto-prepending.

auto_append_file

Specifies the name of a file that is automatically parsed after the main file. The file is included as if it was called with the include() function, so include_path is used. The special value none disables auto-appending.

Note: If the script is terminated with exit(), auto-append will not occur.

Use php.ini to replace html with anything - AskApache

Charles Torvalds
10 Mar 2007

  • Site Map WireShark GNU Non-GNU Tor Project cURL TLDP - Documentation
  • Htaccess Files Hacking Htaccess Javascript Linux Optimization PHP Security Shell Scripting WordPress
  • Base64 Image Converter Raw HTTP Header Debugger Graphical ASCII Text Generator Mac Address Vendor Lookup Who Am I – Your IP Information Request Method Security Scanner .htpasswd file Generator Compress CSS DNS Tracer
Copyright © 2025 AskApache
  • Site Map
  • Htaccess Files
  • Hacking
  • Htaccess
  • Javascript
  • Linux
  • Optimization
  • PHP
  • Security
  • Shell Scripting
  • WordPress
  • Base64 Image Converter
  • Raw HTTP Header Debugger
  • Graphical ASCII Text Generator
  • Mac Address Vendor Lookup
  • Who Am I – Your IP Information
  • Request Method Security Scanner
  • .htpasswd file Generator
  • Compress CSS
  • DNS Tracer
Exit mobile version