国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial php怎么實現(xiàn)主動發(fā)送消息到終端

php怎么實現(xiàn)主動發(fā)送消息到終端

Jun 13, 2016 pm 12:02 PM
http nbsp php server socket

php如何實現(xiàn)主動發(fā)送消息到終端
現(xiàn)在有一個這樣的應用場景,有一個php做后臺的信息發(fā)布系統(tǒng)控制端,用來控制戶外的信息發(fā)布終端(廣告機,戶外顯示屏等),當客戶在瀏覽器頁面上點擊重啟,開關機時或做其他操作,我如何將這個信息主動發(fā)送給終端呀?
看了一些推送的辦法,還是云里霧里,很多還是要終端先發(fā)送請求才可以,哪位大俠能指點一下嗎?
------解決方案--------------------

引用:
終端就是廣告機,戶外屏這些東西。
如果用http無法做到的話,倒是可以考慮用socket的,在php上用socket來主動發(fā)送信息要如何做呀?


引用:

客戶在瀏覽器頁面上點擊重啟,開關機時或做其他操作,我如何將這個信息主動發(fā)送給終端呀?
這具體要看你的顯示屏類型了,如果可以用SOCKET連接的,就用SOCKET連接


對,這個就看你的"廣告機,戶外屏"這些是如何和你的php?server聯(lián)系的.

php里有socket庫,?不過其它方式也很多,不一定需要


------解決方案--------------------
換成我的話我肯定不會用php做,如果非要的話?php可以做為一個前臺,再寫一個服務器端來接收php的輸入數(shù)據(jù)進行控制?;蛘咧苯娱_發(fā)服務器端和客戶端,拋開php.

也許php是固定的,你也可以在前端和你的后端(廣告機上)都架設php來傳遞數(shù)據(jù)?呵呵,廣告機其實也是個win操作系統(tǒng).簡單些直接post?get?之后處理?這就簡單多了吧...將事件處理成bat文件來調用...


引用:
7樓有什么好的建議嗎

引用:

問題的關鍵是搞這個項目的就只會半調子的php.你們吹乜...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is PHP and What is it Used For? What is PHP and What is it Used For? Jul 16, 2025 am 03:45 AM

PHPisaserver-sidescriptinglanguageusedforwebdevelopment,especiallyfordynamicwebsitesandCMSplatformslikeWordPress.Itrunsontheserver,processesdata,interactswithdatabases,andsendsHTMLtobrowsers.Commonusesincludeuserauthentication,e-commerceplatforms,for

Your First PHP Script: A Practical Introduction Your First PHP Script: A Practical Introduction Jul 16, 2025 am 03:42 AM

How to start writing your first PHP script? First, set up the local development environment, install XAMPP/MAMP/LAMP, and use a text editor to understand the server's running principle. Secondly, create a file called hello.php, enter the basic code and run the test. Third, learn to use PHP and HTML to achieve dynamic content output. Finally, pay attention to common errors such as missing semicolons, citation issues, and file extension errors, and enable error reports for debugging.

How Do You Handle File Operations (Reading/Writing) in PHP? How Do You Handle File Operations (Reading/Writing) in PHP? Jul 16, 2025 am 03:48 AM

TohandlefileoperationsinPHP,useappropriatefunctionsandmodes.1.Toreadafile,usefile_get_contents()forsmallfilesorfgets()inaloopforline-by-lineprocessing.2.Towritetoafile,usefile_put_contents()forsimplewritesorappendingwiththeFILE_APPENDflag,orfwrite()w

PHP 8 Installation Guide PHP 8 Installation Guide Jul 16, 2025 am 03:41 AM

The steps to install PHP8 on Ubuntu are: 1. Update the software package list; 2. Install PHP8 and basic components; 3. Check the version to confirm that the installation is successful; 4. Install additional modules as needed. Windows users can download and decompress the ZIP package, then modify the configuration file, enable extensions, and add the path to environment variables. macOS users recommend using Homebrew to install, and perform steps such as adding tap, installing PHP8, setting the default version and verifying the version. Although the installation methods are different under different systems, the process is clear, so you can choose the right method according to the purpose.

python if else example python if else example Jul 15, 2025 am 02:55 AM

The key to writing Python's ifelse statements is to understand the logical structure and details. 1. The infrastructure is to execute a piece of code if conditions are established, otherwise the else part is executed, else is optional; 2. Multi-condition judgment is implemented with elif, and it is executed sequentially and stopped once it is met; 3. Nested if is used for further subdivision judgment, it is recommended not to exceed two layers; 4. A ternary expression can be used to replace simple ifelse in a simple scenario. Only by paying attention to indentation, conditional order and logical integrity can we write clear and stable judgment codes.

PHP remove whitespace from string PHP remove whitespace from string Jul 15, 2025 am 02:51 AM

There are three main ways to remove spaces in PHP strings. First, use the trim() function to remove whitespace characters at both ends of the string, such as spaces, tabs, line breaks, etc.; if only the beginning or end spaces need to be removed, use ltrim() or rtrim() respectively. Secondly, using str_replace('','',$str) can delete all space characters in the string, but will not affect other types of whitespace, such as tabs or newlines. Finally, if you need to completely clear all whitespace characters including spaces, tabs, and line breaks, it is recommended to use preg_replace('/\s /','',$str) to achieve more flexible cleaning through regular expressions. Choose the right one according to the specific needs

PHP Variable Scope Explained PHP Variable Scope Explained Jul 17, 2025 am 04:16 AM

Common problems and solutions for PHP variable scope include: 1. The global variable cannot be accessed within the function, and it needs to be passed in using the global keyword or parameter; 2. The static variable is declared with static, and it is only initialized once and the value is maintained between multiple calls; 3. Hyperglobal variables such as $_GET and $_POST can be used directly in any scope, but you need to pay attention to safe filtering; 4. Anonymous functions need to introduce parent scope variables through the use keyword, and when modifying external variables, you need to pass a reference. Mastering these rules can help avoid errors and improve code stability.

Advanced PHP Multiline Comment Techniques Advanced PHP Multiline Comment Techniques Jul 17, 2025 am 04:14 AM

UsemultilinecommentsinPHPforfunction/classdocumentation,codedebugging,andfileheaderswhileavoidingcommonpitfalls.First,documentfunctionsandclasseswith/*...*/toexplainpurpose,parameters,andreturnvalues,aidingreadabilityandenablingIDEintegration.Second,

See all articles