[php] curl_setopt for $_SERVER['REMOTE_ADDR']

Newbie Spellweaver
Joined
Sep 28, 2007
Messages
64
Reaction score
0
Hey all, I have been on this all day and it's totally got me confused.

Here is a rundown of what I am trying to do:

I have a site, thats the backend of one of my sites, to increase security, I have set it so the IP of $_SERVER['REMOTE_ADDR'] must match the one I have set in the database.

With that explained, I have another site that has a file multiple directories in, that has a script that will log me in using curl_setopt(), set all sessions etc, but I hit the error page because my IP doesn't match the one given.

This page is for when I'm on the move, I can check on my cell and if I need to get into the backend for any of the alerts, I can make my way to the family house to jump on and deal with any issues.

So my question is, is there a way to have curl_setopt() fake the IP in that file so it matches?

I know there are a million other ways to do this, but I also wanted to learn about curl_setopt() so by doing this, I have learnt some new stuff and would like to finish it completely in this way.

I can't seem to find anything that would change the given HTTP values etc.

Any help will be appreciated.

Thanks in advance.

Edit To whoever made the new skin, got to admit, its sexy.
 
What you are trying to do is IP spoofing. It can be done, but not by curl_setopt, and if it could you wouldn't get a working page - since the return packets containing the data would be send to the wrong address.

You're better of either lowering your security or creating a proxy server at your home address and forward requests from there:

[cellphone] <---> [home computer - proxy] <----> [backend]

There are a few decent proxies out there, but of course setting one up does completely nullify the use of an IP check in the first place.

So does pretty much any other way to circumvent the filter.

Up to you how you want to proceed :wink:

//edit
Just a note, if you want complete security, just use SSL encryption (openSSL is pretty decent) for your connection with a private key. And of course set up a strong password :icon6:
 
Thanks for the input FragFrog, not it's back to the drawing board to decide which way I plan to do this.

Sometimes I wonder why I feel the need to complicate everything, but I guess on the plus side, I learn more from making stupid decisions on how to do something :)
 
Back