Application scenarios:
During the WeChat authorized login process, user confirmation is required, so this requirement is derived;
The reason why the corresponding logic is not placed on the front end is that this part of the logic is a partial functional business, so it is placed on the back end to facilitate unified management.
Solution:
When echoing javascript scripts through php, one thing that needs attention here is the buffer.
The buffer should have three parts, namely php, webserver, and web browser. Real-time output can be achieved through program code or configuration files. Relatively speaking, the backend is controllable, but the buffering mechanisms of different browsers in the frontend are different. Not delved into here. My solution was to allow non-real time output.
One of the requirements for allowing non-real-time output is that the program should not jump after processing the pop-up window. As follows:
<span style="color: #000000;">php </span><span style="color: #0000ff;">echo</span> "<script> if(confirm( '请选择跳转页面,是跳转到yes.html 否跳转到no.html? ')) location.href='yes.html';else location.href='no.html'; </script>"<span style="color: #000000;">; </span><span style="color: #008000;">//</span><span style="color: #008000;">以下hearder部分,是不可以加入的。 //header('location:http://www.baidu.com'); </span> ?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
