How many ways I can redirect a PHP page?

Answers were Sorted based on User's Feedback



How many ways I can redirect a PHP page?..

Answer / deep narain singh

You Can Redirect PHP Page by folloeing method:
1- <script>location.replace("index.php");</script>
2-<script>window.href="index.php";</script>
3-header("Location:index.php");

Is This Answer Correct ?    20 Yes 2 No

How many ways I can redirect a PHP page?..

Answer / nikunj

By HEADER() func. of PHP you can redirect PHP page.

By useing ACTION property of form tag of page, you can
redirect page.

By useing javascript, you can redirect page

Is This Answer Correct ?    16 Yes 2 No

How many ways I can redirect a PHP page?..

Answer / atul mahajan

We can also redirect a page using the following code

echo "<meta http-equiv='Refresh' content='0; url=test.php'>";
exit;

Is This Answer Correct ?    12 Yes 2 No

How many ways I can redirect a PHP page?..

Answer / sudheer

3 ways to submit our form
1.form attribete(action)
ex:<form name="frm" method="POST/GET" action="sample.php">
2.through header functions
ex:header("sample.php");
3.through javascript
ex:echo "<!--<script
type='text/javascript'>window.location='sample.php'</script>-->";

Is This Answer Correct ?    9 Yes 1 No

How many ways I can redirect a PHP page?..

Answer / rakesh kumar nautiyal

Page redirect
Description
If you want a PHP redirect script that redirects visitors
from a page to a specific URL then this is it. It sends the
user from one web page to a different web page address. It
is a good alternative to using the meta tag http-equiv
option.

The code

<?php/** * Place in a blank PHP page */// Change to the URL
you want to redirect to$URL="http://www.page.com";header
("Location: $URL");?>

Is This Answer Correct ?    10 Yes 4 No

How many ways I can redirect a PHP page?..

Answer / kesavan


header('location:next.php');
you can use <meta> to redirect

Is This Answer Correct ?    7 Yes 3 No

How many ways I can redirect a PHP page?..

Answer / laxmikant

1- <script>location.replace("index.php");</script>
2-<script>window.href="index.php";</script>
3-header("Location:index.php");
4-<meta http-equiv="refresh" content="5; url=newurl.html">

Is This Answer Correct ?    4 Yes 2 No

How many ways I can redirect a PHP page?..

Answer / 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

How many ways I can redirect a PHP page?..

Answer / rani

By using header
<?php
header('Location: http://www.example.com/');
?>

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More PHP Interview Questions

When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?

0 Answers  


What is factory pattern in php?

0 Answers  


How would you declare a function that receives one parameter name hello?

0 Answers  


How do we get the current session id?

0 Answers  


Tell me is it possible to submit a form with a dedicated button?

0 Answers  






can any one find and tell the difference between dot net and php which one is best ? which one we get more salary? which one is stable and which one is best for freshers and also better in future and carrer ? which one we wil get more salary sir ? please send ur valuable suggestions to kiranpulsar2007@gmail.com

3 Answers  


is php is the best for this situation

2 Answers  


How to download file in php?

0 Answers  


What is a string in r?

0 Answers  


How do you define a constant?

0 Answers  


Is php still in demand?

0 Answers  


What is die in php?

0 Answers  


Categories