473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to use use file_get_contents() with the requester's IP?

HaLo2FrEeEk
404 256MB
I want to get a remote webpage using file_get_contents(), but I want to get the file using the IP of the person running the script, not the server's IP. Right now the file will be retrieved just fine but it uses my server's IP to do so. Requesting the page generates a unique key that is associated with the IP address, but I want my users to be able to download urls that I parse from the webpage (they contain the unique key). The only way I can think to do this is the somehow make the request as though it were from the running user's IP address. Is something like this possible, perhaps using a stream context? I tried but I just don't know enough about contexts, and Google / php.net is not helping.
Jan 18 '11 #1
4 5165
JKing
1,206 Expert 1GB
What you are asking for sounds like IP spoofing to me.
Jan 18 '11 #2
HaLo2FrEeEk
404 256MB
You could think of it like that, but it's not.

It's a Youtube downloader. You put in the video ID and it gets the download URLs for all available resolutions. The URLs contain a key unique to the requesting IP. Since my server is doing the request, the key is matched to my server's IP. If I could have my server make the request but do so as though the request were coming from the running user's IP, then the IP would be matched to the user's IP and thus they would be able to download it directly.
Jan 18 '11 #3
JKing
1,206 Expert 1GB
If I could have my server make the request but do so as though the request were coming from the running user's IP
That's pretty much the definition of spoofing to me. I understand you have no malicious intent but I don't think this is the right way to achieve what you are trying to do.

What is the site you are trying to interface with? Do they have an API? Have you contacted them?
Jan 18 '11 #4
HaLo2FrEeEk
404 256MB
I said it was a Youtube downloader. I fetch and parse the contents of:

www.youtube.com/get_video_info?video_id=[ID]

Youtube generates a unique key for every request made and the key is only valid for the IP it was generated for.

I suppose I could use fpassthru or readfile to facilitate the download through my server, so my server would basically be a proxy, but I'd like to avoid that.
Jan 18 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: hokieghal99 | last post by:
While trying to learn more about Python's standard modules, I noticed that there are *a lot* of Mac only modules... more so than Unix and Windows specific modules combined. Is there a reason for...
2
by: Kai Grossjohann | last post by:
The following HTML file invoker.html creates a modal dialog: <html><head> <script language="JavaScript"> function popup() { window.showModalDialog("main.html", null,...
5
by: bapolis | last post by:
Hi, I read the mod_python documentation on the Django site but I'm getting this error: EnvironmentError: Could not import DJANGO_SETTINGS_MODULE 'accesshiphop.settings' (is it on sys.path?):...
4
by: Jon Slaughter | last post by:
I'm using eval to excute some mixed php and html code but I cannot debug it. I am essentially using filegetcontents to load up a php/html file and then inserting it into another php/html file and...
1
by: Shawn29316 | last post by:
Hi, I've used a form to capture the requesters date range specifications for a set of queries forever and never cared that it took the short date entered by the requester and changed it to a...
1
by: Ken Fine | last post by:
I have been investigating programmatically downloading FLV content from various sites ("video scraping"??) Many interactive GUI tools do this, such as the Orbit downloader. At the heart of them...
5
by: Stepheno | last post by:
Hi, I am a recently converted Iseries (AS/400) RPG programmer trying to learn HTML/CSS/JavsScript all at the same time (not fun). My problem deals mostly with CSS. I will be reveiving a table,...
0
by: Laura Hood | last post by:
Availability for a brave new world With the advent of Software as a Service (SaaS) more businesses are relying on the ability to access their business data through web based applications. In...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.