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:504279browse

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='javascript' type='text/javascript'>"; 
echo "window.location.href='http://www.baidu.com/'"; 
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