473,511 Members | 15,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP request failed! HTTP/1.0 400

67 New Member
Hi,
Ehen i use file_get_contents functions or fopen to access a webpage on the net. i get the folowing error


Warning: file_get_contents(http://ndtv.com) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Invalid header received from browser

This is the same error with fopen too. But if i access the local files it works good,

Help Needed to access the rempte file....

Looking forward for reply..

Thanks in advance
Sep 18 '07 #1
3 4486
newlearner
67 New Member
Hi,
Ehen i use file_get_contents functions or fopen to access a webpage on the net. i get the folowing error


Warning: file_get_contents(http://ndtv.com) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Invalid header received from browser

This is the same error with fopen too. But if i access the local files it works good,

Help Needed to access the rempte file....

Looking forward for reply..

Thanks in advance


im totally Stumped Pls Some body Hlp Me out!!

I Dont no Where im Wrong!
Sep 19 '07 #2
kovik
1,044 Recognized Expert Top Contributor
You are getting a 400 response.

Expand|Select|Wrap|Line Numbers
  1. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
Have you tried adding a "www" to the URL?
Sep 19 '07 #3
newlearner
67 New Member
You are getting a 400 response.

Expand|Select|Wrap|Line Numbers
  1. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
Have you tried adding a "www" to the URL?
Yes
my code is


$url = 'http://www.bbc.com';
$page = file_get_contents($url);
echo "Type of ".gettype($page);
Sep 20 '07 #4

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

Similar topics

1
4155
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
0
1431
by: matt | last post by:
Hi There we have a new asp.net site that is getting a lot of hits. I have set this up on its own server with its own database server. We have a search system built into the site which is timing...
0
4526
by: Armin Braunstein | last post by:
Hi! I have a curious problem in my C# ASP .Net application (Visual Studio 2002, .Net Framework 1.0 SP3 (previously SP2 with the same error - following), Crystal Reports (shipped with Visual...
2
4064
by: RobertHillEDS | last post by:
While using the Soap generated ASP code, I would like to dump the raw contents of the request and response objects using Response.AppendToLog. I have tried using variations of the following code,...
5
5557
by: Janning Vygen | last post by:
Hi, tonight my database got corruppted. before it worked fine. since two days i do the following tasks every night psql -c 'CLUSTER;' $DBNAME psql -c 'VACUUM FULL ANALYZE;' $DBNAME ...
1
2847
by: Tom Purdom | last post by:
Hi All, I am developing a Outlook interop plugin which performs task time allocation. However when i attempt to fire my custom event to notify that an allocation has been generated the security...
2
20811
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. ...
149
4134
by: jacob navia | last post by:
As a consequence of a heavy discussion in another thread, I wrote this program: #include <stdlib.h> int main(void) { char *p=calloc(65521,65552); if (p) printf("BUG!!!!\n"); }
3
12035
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
5
6113
by: chromis | last post by:
Hi there, I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
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
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7085
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
7512
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...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.