Jump to content

execute my php code before every php call


techloop

Recommended Posts

Hi all,

 

I have a simple code that override some env vars but i need it to run before any other php code on every php execution.

I would like to avoid any change of all php code (even if its only to include the include command).

 

Any one knows of such way ?

 

I dont mind overriding this vars on php configuration file but i dont have any control of it as its should work on even the most strict web hosting (that still allow env vars manipulation)

 

Any alternatives ?

 

Thanks,

 

TL

OK, so i might have been misunderstood.

 

The problem that i faced with is as follow:

 

1.There is a hardware that manipulates some of HTTP core information such as the client's IP address.

  I know that this hardware is not unique and there are even cloud base services that do this.

2. the real information (the real IP of the client on my example) is stored on the HTTP header

3. i need to override some $ENVs (e.g. $_ENV["REMOTE_ADDR"] and $_SERVER["REMOTE_ADDR"])

4. because those vars are "re-generated" on each php execution i would like that my code that "fix" the information to be executed before any other code.

 

I hope that this clear my problem  and that someone will guide me of the right way to overcome it

 

Thanks

 

TL

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.