search

Home  >  Q&A  >  body text

php - changing browser behavior

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?

扔个三星炸死你扔个三星炸死你2691 days ago890

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-07-05 09:58:07

    Try using websocket, long connection

    reply
    0
  • 欧阳克

    欧阳克2017-07-05 09:58:07

    Although I don’t know what you want to do, I still recommend something to you

    webscocket

    reply
    0
  • 習慣沉默

    習慣沉默2017-07-05 09:58:07

    The client web page remains unchanged, submit the form data to the server using AJAX, and then the server returns the processing results.

    reply
    0
  • 为情所困

    为情所困2017-07-05 09:58:07

    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

    reply
    0
  • Cancelreply