dongnue4923 2018-01-30 15:42
浏览 21

在PHP脚本和服务器端之间传递数据包含在Apache上[重复]

Given is a Unix environment with Apache 2.4.29 and PHP 7.1.13 running as an Apache module.

I have a .shtml file which performs SSI virtual includes of other resources. Two of them are PHP scripts. The first scripts performs some action, and the second scripts outputs data. I cannot change this structure. Now I want to pass data from script1 to script2. My first guess was to use PHP with apache_setenv in script1 and apache_getenv in script2. Unfortunately script2 cannot see the new environment entries created in script1. Then I tried apache_note(), which gives the same negative effect.

I am wondering if PHP is working well with such an SSI environment. Using <!--#set var="variable" value="value"--> in .shtml files makes variable variable available for all following include virtual calls. But PHP denies this, at least in my setup. Any suggestions? Thanks in advance!

</div>
  • 写回答

1条回答 默认 最新

  • dqeznd1697 2018-01-30 15:46
    关注

    SSI environment

    There's no such thing as "SSI environment". It's just a httpd feature.

    Now I want to pass data from script1 to script2

    If both talk to remote http client you can try to use session for this. If not, then you can always save temporary file in script1 (i.e. JSON, or serialized data) and read in script2.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计