At work, I was given a file with which to connect to the proxy which I can do from there but I have no idea how to do it from home. I tried going "under the hood" and setting up a proxy with a random www address but that didn't work, probably since I have no idea of what a proxy is. Also, I wasn't able to find any good tutorials on this online that explain in language a beginner could understand.

I'm on windows by the way, and here's the code from that file

<?php
function get_file($uri) {
 // get file via proxy
 
    $context = stream_context_create(
    array('http'=>
        array('proxy'=>'www.someurl.com',
              'header'=>'Cache-Control: no-cache'
             )
     ));  
    $contents = file_get_contents($uri,false,$context);
    return $contents;
};
?>

Recommended Answers

All 3 Replies

does that server have internet access and a webserver setup on it
im a bit confused by your request bottom line are you trying to access a file from home ?

I have a server set up on it yeah, from which I connect to the mysql database, test out php files on it and so on.

That wikipedia link explanation of proxy servers was good but I don't know what a beginner can get from the second link. I've looked at one or two other tutorials and there's just code there without explanation or while setting up there's some url which needs to be typed, but where is that gotten from/why is it being used isn't mentioned...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.