Home  >  Article  >  Backend Development  >  How to implement automatic jump in php

How to implement automatic jump in php

Guanhui
GuanhuiOriginal
2020-05-08 13:47:504440browse

How to implement automatic jump in php

How to implement automatic jump in php

1. Set the "Location" in the http response header through the php built-in function "header" Just point to the URL you want to jump;

header('Location: http://www.baidu.com/');
exit();

2. You can point "window.location.href" in the javascript code to the URL you want to jump.

echo "< script language=&#39;javascript&#39; type=&#39;text/javascript&#39;>"; 
echo "window.location.href=&#39;http://www.baidu.com/&#39;"; 
echo "< /script>";

The above is the detailed content of How to implement automatic jump 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