How many ways I can redirect a PHP page?

Answer Posted / rajesh bhujbal

1. By using header function as below:
<?php
header('Location: http://www.example.com/');
?>
2. By useing ACTION property of form tag of page:
<form action = “POST” method = “processform.php” >
</form>

3. By using javascript as below:
1- <script>location.replace("index.php");</script>
2-<script>window.href="index.php";</script>

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a mysql connection?

737


Are php short tags acceptable to use?

740


How to remove duplicate values from array using php?

768


How to calculate the length of a string?

798


How many escape sequences are recognized in double-quoted strings in php?

751


How to process the uploaded files?

814


Is it difficult to learn php?

712


What is the best php framework 2018?

749


How to list all values of submitted fields?

727


How to access standard error stream in PHP?

785


Tell us what is the difference between session_unregister() and session_unset()?

762


How can you retrieve a cookie value?

775


Is variable name casesensitive in php?

736


What is substr in php?

738


Explain me what are the main error types in php and how do they differ?

761