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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.