PHP Redirect Without Header
Last Updated : Jan 1, 2023
IN - PHP
In this tutorial we will show you the solution of PHP redirect without header, redirect is very useful in today’s time to navigate from one page to another inside a website.
So, let us understand our today’s article without using header.
Step By Step Guide On PHP Redirect Without Header :-
As, there are many ways with help of which we are able to redirect in php.
One of the most famous or say most used method is header method.
But in today’s article we are going to understand another way of redirection without using header tag. Now, let us see our new method.
- First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
- Secondly, the <html> tag is used to indicate the beginning of an HTML document.
- As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
- Here, then we create a body tag. All the content which we want to show on browser’s screen or display is always written inside this codes.
- Here, inside body as we can see that we create a basic php tag or say structure for php to write codes inside that.
- Whereas in another way we use the same attribute but in different way. For this we first use window.location and give it value and after this we use href attribute and inside this we give the value of website where we want to redirect.
- As we see there is one more attribute that is target. Here, we have to give value of the website where we want it to open like in same tab, in next or say blank tab, etc.
- At last, the <body> and <html> tags are closed with </body> and </html> respectively.
At last in conclusion, here we can say that with the help of this article we are able to understand how to redirect in php without using header.
I hope this tutorial on PHP redirect without header helps you and the steps and method mentioned above are easy to follow and implement.