Re: changing the global variables (_SERVER[HTTP_USER_AGENT])

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Register Globals will take all the keys/values in
$_SERVER/$_POST/$_GET/$_COOKIES and turn each one into a variable in
your script.

It is equivalent to:
extract($_POST);
extract($_GET);
extract($_COOKIE);
.
.
.

The "GPC" settings in php.ini determine the order of the above
statements, in case *both* POST and GET have 'x' defined, for example.


$_SERVER['USER_AGENT'] or whatever it is, is nothing more than the
User-agent: header sent by your tool.

You can put whatever you want in that header.

What the server decides to *do* because of what you put in there is
another matter.

Some sites don't want to be indexed or otherwise visited by automated
scripts.

Follow the "robot guidelines" [Google for it] or expect to have severe
issues with your webhost/carrier shutting down your account, no
refund, no appeal, because other hosts are complaining about you...

It's also inconceivable that wget, curl, and similar tools cannot do
whatever customization you need.  Those tools exist expressly for that
purpose -- to be customized to automate the retrieval of data.  So,
almost-for-sure, you have not correctly identified your needs and
assessed the tools available, and you're wasting a lot of your time
inventing the wheel.

On Tue, October 3, 2006 1:59 pm, Balaji A wrote:
> Thanks Richard.
> I am returned progarmmer for PHP..I am little confused about register
> globals and Server variables.
>
> Your understanding is corect...I want to masquerade the client
> requests....
> I need to customize the tool thats why I am not ging for public
> tools..
>
> anyway thanks for the info.. :-)
>
>
> On 10/3/06, Richard Lynch <ceo@xxxxxxxxx> wrote:
>>
>> On Tue, October 3, 2006 12:43 pm, Balaji A wrote:
>> > Hi,
>> > in php.ini I have changed the register_global to "On".
>> >
>> > Is it possible to change the global variable
>> _SERVER[HTTP_USER_AGENT]?
>> >
>> > Thanks in advance..
>>
>> Errrr.
>>
>> You're not making sense...
>>
>> You want my browser to LIE to your server about what browser it is?
>> Opera will let you do that.
>>
>> You want to not believe I'm not using the browser I say I'm using,
>> by
>> changing the string it sends you to identify itself?
>> Just ignore what I send.
>>
>> You are trying to masquerede as some other browser, but don't want
>> to
>> let us know because you think it's some big Security thing, or
>> you're
>> scraping things you think somebody cares about or...?
>> I hesitate to help you, but the bottom line is that there are
>> *dozens*
>> of tools to web scrape and masquerede as any browser you want, so
>> even
>> if you're as, errrr, naive, as this post indicates, you're going to
>> find them within a week.
>>
>>
>> None of this has ANYTHING to do with register_globals, so you
>> clearly
>> are not understanding the User-agent: header, or register_globals,
>> or
>> both.  Probably both, to be honest...
>>
>> re-read the register_globals page on php.net
>>
>> And for the User-agent, Opera, wget, Firefox with LiveHTTPHeaders,
>> and
>> dozens of other tools let you alter that.
>>
>> But ain't no way you can make *MY* browser not send you the
>> User-agent
>> it wants to send.  It's *MY* browser, on *MY* computer, thank you
>> very
>> much.
>>
>> --
>> Some people have a "gift" link here.
>> Know what I want?
>> I want you to buy a CD from some starving artist.
>> http://cdbaby.com/browse/from/lynch
>> Yeah, I get a buck. So?
>>
>>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux