0

I want to automatically add this line to the beginning of every file that is included and form part of the new file

I already have htaccess and have tried adding php_value auto_prepend_file AddCount.php ...

RewriteEngine on
RewriteBase /
RewriteRule ^(.*) index.php
php_value auto_prepend_file AddCount.php

which i have made up from similar posts, but get INTERNAL SERVER ERROR

i have seen its possible to add a file to each page load with htaccess

so e.g. file ...

<div><?=$NewCount;?></div>

becomes

<? $this=incCount($Count); ?>
<div><?=$this;?></div>

Sorry first question, apologies if all wrong, could not find answer

Naxia
  • 9
  • 4
  • May be helpful:- https://stackoverflow.com/a/2945191/4248328 (seems like you have to provide path of the file along with it's name) – Alive to die - Anant Jun 28 '19 at 04:32
  • 1
    Please post the contents of your web server error log. Try to use some other variable name instead of $this. $this is used to refer to the current object (https://www.php.net/manual/en/language.oop5.basic.php) – Nadir Latif Jun 28 '19 at 04:43
  • OKay, @NadirLatif i changed it to $NewCount, but still error, what do you mean by contents of web server log? – Naxia Jun 28 '19 at 04:52
  • 1
    Well the error details are usually saved to a file. If you post the contents of this file, it will make it easier to find out the error. This file is usually called error_log – Nadir Latif Jun 28 '19 at 04:54
  • Soryy @NadirLatif i dont seem to have a file call ed that – Naxia Jun 28 '19 at 05:02
  • 1
    Well check the virtual host configuration for your domain. It should mention the error log file. If you cannot find the error log file then add the following lines to the top of your Php page: error_reporting(E_ALL);init_set("display_errors", 1); This lines should cause a detailed error message to show – Nadir Latif Jun 28 '19 at 05:05
  • Call to undefined function init_set() – Naxia Jun 28 '19 at 05:50
  • Well the function is named `ini_set`, not `init_set`. Something you could have rather easily found out yourself. https://stackoverflow.com/questions/9717296/call-to-undefined-function-init-set – 04FS Jun 28 '19 at 06:47

0 Answers0