Home > Backend Development > PHP Problem > How to implement automatic jump in php

How to implement automatic jump in php

Guanhui
Release: 2023-03-01 06:04:01
Original
4456 people have browsed it

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();
Copy after login

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>";
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template