dongzz4545 2014-01-09 14:55
浏览 128
已采纳

ASP页面在后台调用PHP页面

I have a Classic ASP site that uses "crontab" to invoke a process every hour.

"1.php" (Linux) is run hourly (via crontab) and invokes "2.php" (Windows) which invokes (via curl) "3.asp" (Windows) which creates and invokes (via ASP's Server.Transfer) "4.php" (Windows) which invokes a REST API.

Everything works great until the Server.Transfer to "4.php" -- it doesn't!

There are no "echo" (Linux) or "Response.Write" (Windows) statements. Processing involves database and file system access.

I know that I had to use "curl" (or "wget") to invoke a page from a "cron" job because it isn't running within a browser.

I thought I could use Server.Transfer (not Response.Redirect) within ASP. Apparently, Server.Transfer can only be used to transfer to another ASP page.

Might someone suggest a solution? Thank you in advance.

  • 写回答

1条回答 默认 最新

  • douyu3145 2014-01-09 15:16
    关注

    You could try a server http request

    Dim objXML
    Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
    objXML.Open "GET", "http://fullurlto/4.php", false 
    objXML.Send
    Response.Write objXML.responseText
    Set objXML = nothing
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?