Jump to content

[SOLVED] modify header string your browser sends?


ocpaul20

Recommended Posts

I want to modify the header string my browser sends, (or my php program run from my local PC ) so that I can detect that it is me visiting my website. My IP gets changed everytime I logon to my ISP so I cannot check the IP address to detect if it is me.

 

Can anyone give me a hint or pointers how I can do this please?

I can write the php to look at the USER AGENT string that arrives at the website, but I have no idea about the modifying the headers part.

 

Thanks for any help.

Paul

ok, I'll have a look thanks.

 

However, it must be possible to do this using PHP because the search robot programs have a particular signature - thats how you know it is Googlebot visiting your website etc 'cos it says so in the log file.

it does have everything to do with what I originally asked - or maybe I am assuming wrongly that I should use the header function to change the value of a header string?

 

What I am trying to do is to write a PHP program which will run on my website ONLY if the request comes from me - my php program running on my PC. So, for example, maybe I want to run a utility program, and I dont want others to be able to run it. I realise I can do this in a different way, but I have other ideas for this  as well if I can get it going.

 

I have tried to alter the user-agent string (because technically a php program running on my PC is NOT firefox browser) and I have written 2 mickey mouse programs as follows:

prog1
header("User-Agent: aaaaaaa");
header("Content-type: text/html");
header('Location: prog2.php'); exit;


prog2
echo getallheaders();
exit;

 

and I would expect to see a user-agent of 'aaaaa' rather than 'Mozilla/5.0 ' but this still does not show 'aaaaa'.

 

What I am looking for is a string I can test for in prog2, that I can know the request came from me.

 

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.