Jump to content

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.

 

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.