The client is a simple form, the file name is send.php
<form action="http://vps_ip/phplearn/do.php" method="post">
用户名: <input type="text" name="userName" size="12"/>
密码: <input type="text" name="PS" size="12"/>
<input type="submit" value="登录">
</form>
Server-side program, file name do.php
<?php
$userName = $_POST["userName"];
$PS = $_POST["PS"];
echo "the name is: ".$userName;
echo "<br>key word is: ".$PS;
?>
Now open two web pages respectively
Client
Service-Terminal
After clicking on the client's login, the client's page will change to
Now, I want to do this: after the client clicks to log in, the client's web page remains unchanged, but the server's web page changes. Can this be done?
Try using websocket, long connection
Although I don’t know what you want to do, I still recommend something to you
The client web page remains unchanged, submit the form data to the server using AJAX, and then the server returns the processing results.
This is similar to instant messaging. The client sends the account password and the other end (server) obtains the sent information. (I don’t know if this is what you want)
If this is the case, it is best to use a long connection. You can try the webscocket or workman mentioned by the two above