Web Page Redirect

What are the three ways of redirecting a web page logincheck.php to logged.php using
1. HTML
2. JavaScript
3. PHP

Questions by tallman07

Showing Answers 1 - 2 of 2 Answers

kedarPhp

  • Sep 2nd, 2010
 

At the starting of the logincheck.php page you can add the javascript code as follow

Code
  1. <script language='javascript''login.php''login.php''login.php';

  2. </script>

  3. <?php

  4. exit();  //write the exit to exit the current php page execution

  5. ?>

  Was this answer useful?  Yes

1. HTML: You cant redirect a page using HTML

2. JavaScript: window.location = "logged.php" OR window.location.href = "logged.php" OR location.href = "logged.php"
Just so you know if you want to redirect an iframe or a frame in your page then you need to get that Object and redirect.

3. header("Location: logged.php"); exit(); //It is a good practice to call exit() right after redirect so the rest of the code dont get executed

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions