douzi1350 2014-08-01 03:50
浏览 19
已采纳

如何在没有表单,链接或按钮的情况下从一个PHP页面访问变量到另一个页面?

TLDR:- What is a good way to pass contents of a variable from one PHP file to another without involving a form, link or a button.

Question:-

So there is a form in a page/file called question_edit_form.php and its action attribute is already set to another file called question.php. The variable of interest is being read-in from the user in question_edit_form.php and is then obviously being sent to question.php using $_POST.

Now, there is a third file, named renderer.php, and which is not linked to the other two files. I want to use that variable of interest in this file. So how can I access that variable which is set in question.php from inside renderer.php?

  • 写回答

4条回答 默认 最新

  • duankuiyu4618 2014-08-01 03:54
    关注

    You can store the variables in the session.

    http://www.w3schools.com/php/php_sessions.asp

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效