I want to download a page from the web, it's allowed to do when you are using a simple browser like Firefox, but when I use "file_get_contents" the server refuses and replies that it understands the command but don't allow such downloads.
So what to do? I think I saw in some scripts (on Perl) a way to make your script like a real browse...
I have a PHP script that does the following:
Uses file_get_contents() to get content of html file
Echos a JSON object
The issue is that the value obtained from file_get_contents is multi line. It needs to be all on one line in order to be in correct JSON format.
For example
PHP File:
$some_json_value = file_get_contents("some_htm...
I'm using PHP to send an email with an attachment. The attachment could be any of several different file types (pdf, txt, doc, swf, etc).
First, the script gets the file using "file_get_contents".
Later, the script echoes in the header:
Content-Type: <?php echo $the_content_type; ?>; name="<?php echo $the_file_name; ?>"
How to I set...
I am trying to use file_get_contents.I have made sure that allow_url_fopen is enabled in php.ini. As of now it is telling me:
[function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized
All I'm doing is the following, which I can access through browser without a problem.
$url=('http://site/@api...
I've used a simple file_get_contents function but that didn't get the actual contents (output) of that..
I could not figure the error!!!
Code:
<?php
// $url = $_GET['url'];
// $flv_http_path = urlencode($url);
$flv_http_path = 'http://r12.bhartibb-maa1.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%...