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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cURL and remote timestamp issues.

Status
Not open for further replies.

kasuals

Programmer
Apr 28, 2002
100
US
I'm returning a -1 on timestamp, I'll save us the time by placing the code:

Code:
$modded = last_mod("localhost/submitted.php");

function last_mod($remote_file) {
	$ch = curl_init();
	$ret = curl_setopt($ch, CURLOPT_URL, $remote_file);
	$ret = curl_setopt($ch, CURLOPT_HEADER, 1);
	$ret = curl_setopt($ch, CURLOPT_NOBODY, 1);
	$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$ret = curl_setopt($ch, CURLINFO_FILETIME, 1);

	$ret = curl_exec($ch);

	if(empty($ret)) {
		die(curl_error($ch));
		curl_close($ch);
	} else {
		$info = curl_getinfo($ch);
		$file = $info['filetime'];
		curl_close($ch);
		return $file;
	}
}

Any ideas on why that would return a -1?

- "Delightfully confusing..." raves The New York Times

-kas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top