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

Is it possible to submit a form with a dedicated button?

504


How is php different from other languages?

478


What is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?

533


Can we embedded directly PHP code into XHTML document? State Whether True or False?

1262


Is it easy to learn php?

510






Can you extend a final defined class?

8530


Is gender a dependent variable?

508


Explain me what is the importance of "method" attribute in a html form?

505


What is mean tnq

1080


What are the differences between mysqli_connect and mysqli_pconnect?

537


What are session variables in php?

524


How I can control asset documents without GR/IR?

1211


Is php an api?

532


Which is variable cost?

526


What is the current stable version of php?

550