Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

Status
Not open for further replies.

basball

Technical User
Joined
Dec 18, 2002
Messages
192
Location
US
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in

what causes this, it has happend only once thus far. i suspect it is a connection issue with my server and the target server i'm requesting data from. using iis 5.0 and latest release of php. are there changes to my ini file that i could make to create a retry attempt without spitting up code on my php site. any help would be appreciated.
 
You could write some code to test the connection (via sockets maybe) to attempt to open the page and if closed have it fail more gracefully...

Bastien

Cat, the other other white meat
 
great idea, could you demonstrate with an example, just to get me started. thanks.
 
Code:
function is_connected()
{
	//check to see if the local machine is connected to the web
	//uses sockets to open a connection to apisonline.com
	$connected = @fsockopen("[URL unfurl="true"]www.mysite.com",[/URL] 80);
	if ($connected){
		$is_conn = true;
		fclose($connected);
	}else{
		$is_conn = false;
	}
	return $is_conn;
	
}//end is_connected function

Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top