-2

how can i affect/change a superglobal of PHP? Cause when i enter a website i dont want to give it my IP then i want to affect HTTP['REMOTE_ADDR'] variable.

note: i know it can be done cause i have seen people who complains how people enter sites with fake IP's via changing PHP globals, but if i know wrong please explain

user3301042
  • 352
  • 2
  • 14
  • This has nothing to do with PHP and should probably be in SuperUser. But if you find a tool to edit any page's PHP let me know (; – Francisco Presencia Jun 03 '14 at 23:32
  • You mean that you want to mask your _client_ IP from servers running PHP code? You will not be able to spoof `REMOTE_ADDR` – Michael Berkowski Jun 03 '14 at 23:32
  • If you want to change PHP superglobals in PHP code you own, you may overwrite them as much as you need. Be careful doing that though -- comment it well. `$_POST['input_value'] = 'new fake value not from form';` Nothing prevents you from writing to them. – Michael Berkowski Jun 03 '14 at 23:34
  • [This is what is needed](http://stackoverflow.com/questions/5092563/how-to-fake-serverremote-addr-variable) if you really wish to spoof REMOTE_ADDR. It is no trivial task... – Michael Berkowski Jun 03 '14 at 23:36

1 Answers1

0

PHP is a server side langage. You can access superglobals by following this references (Only in PHP page).

If you are in client side (javascript), you cannot affect superglobals. Like PHP cannot access your computer variables.

Orelsanpls
  • 22,456
  • 6
  • 42
  • 69