Home  >  Article  >  Backend Development  >  How to use post to jump to the page in php

How to use post to jump to the page in php

coldplay.xixi
coldplay.xixiOriginal
2020-09-30 09:51:424338browse

php method to use post to jump to the page: first define the post processing page url; then get the url of the current page and parse the url; then get the parameter part in the url and parse the querycan parameter into the array variable; finally Loop to splice the form items, construct the form and jump.

How to use post to jump to the page in php

How to use POST to jump to the page:

Everyone knows that PHP can use header('Location') Implement get request jump.

php can use curl to simulate post requests.

But I can’t find a ready-made PHP implementation of post jump.

Then the question is, if there is such a need, how to realize it?

Here today, I will share with you a PHP post jump method using form js.

index.php(initiate jump page)

 $value ){
     $formItemString .= "" ;
}
 
//构造表单并跳转
$content =<<
{ $formItemString }


EOF;
 
exit ( $content );

action.php(jump target page)

If you want to learn more about programming, please contact us Pay attention to the php training column!

The above is the detailed content of How to use post to jump to the page in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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