Hướng dẫn php return html page - php trả về trang html

There are many ways to directly implement this. You will need to examine the data POSTed to your PHP script and determine which of the two HTML documents to render.


This will work but is not ideal when POSTing data - any page reload will require the data to be POSTed again. This may cause underiable effects [is your action idempotent?].

A more suitable option is to use one PHP script to determine the output to use and then redirect the browser to the appropriate content. Once the user's browser has been redirected a page refresh will cleanly reload the page without any immediate adverse effects.

Bài Viết Liên Quan

Chủ Đề