Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "HEAD", "https://work's domain (I am not sure if im allowed to put it here or not. I apologize for any inconvenience)/Images/FSR/" & f1 & "/" & f2 & "/" & fsnm & ".htm", False
xmlhttp.send
Select Case Cint(xmlhttp.status)
Case 200, 202, 302
Set xmlhttp = Nothing
我有一个ASP文件,我正在尝试将其转换为PHP。除一部分外,整个文件已转换。上面的代码。我到处搜索并尝试了所有方法,但尚未找到解决此问题的方法或解决方案。任何帮助将不胜感激。
edit:这是我到目前为止的内容。
// $xmlhttp->open("HEAD", "https://.../Images/FSR/".$f1."/".$f2."/".$fsnm.".htm", false);
// $xmlhttp->send;
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://.../Images/FSR/' . $f1 . '/' . $f2 . '/' . $fsnm . '.htm',
CURLOPT_POST => 1
));
$response = curl_exec($ch);
curl_close($ch);
// OR $xmlhttp->status? OR neither??
switch(intval($xmlhttp->http_response_code()))
{
case 200:
case 202:
case 302:
$xmlhttp = NULL;
redirects to another page
break;
default:
$xmlhttp = NULL;
echo "Image not created, it may not be available yet.";
}