简体   繁体   English

如何在 2 个 php 页面之间发送实时信息?

[英]How can i send real time information between 2 php pages?

i know nothing about php, i'm a javascript student but i wanted know how this script works.我对 php 一无所知,我是一名 javascript 学生,但我想知道这个脚本是如何工作的。

Assuming i have 2 pages, one is the main script and the other sends the info so the main page works in real time with that info, you click a button in the main script, it will open a second page and the main script will open a kind of "listener", that page will have a counter and will send the counter info every second, if the second page is closed, then the main page will close too假设我有 2 个页面,一个是主脚本,另一个发送信息,因此主页面与该信息实时工作,您单击主脚本中的一个按钮,它将打开第二页,主脚本将打开一种“监听器”,该页面将有一个计数器,并且每秒发送一次计数器信息,如果第二个页面关闭,则主页也将关闭

I only want to know what is the best way of sending info like this, thanks我只想知道发送此类信息的最佳方式是什么,谢谢

i know nothing about php, i'm a javascript student but i wanted know how this script works.我对 php 一无所知,我是一名 javascript 学生,但我想知道这个脚本是如何工作的。

Assuming i have 2 pages, one is the main script and the other sends the info so the main page works in real time with that info, you click a button in the main script, it will open a second page and the main script will open a kind of "listener", that page will have a counter and will send the counter info every second, if the second page is closed, then the main page will close too假设我有 2 个页面,一个是主脚本,另一个发送信息,因此主页面与该信息实时工作,您单击主脚本中的一个按钮,它将打开第二页,主脚本将打开一种“监听器”,该页面将有一个计数器,并且每秒发送一次计数器信息,如果第二个页面关闭,则主页也将关闭

I only want to know what is the best way of sending info like this, thanks我只想知道发送此类信息的最佳方式是什么,谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM