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 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)