Saturday, June 4, 2016

Redirect To Another Page In PHP Without Using Header

A little bit of Javascript might help you to rediect to another page.A sample code is given below:

<?php

// show some bits
printf("<html><body>");
printf("Just some bits on this page...");

// do your condition based tests
.....

if ($myConditions != $meetsExpectation)
{
printf("<script>location.href=errorpage.html</script>");
}
else
{
// show other stuffs
}
?>
Hope this leads you in the right diection.Though there are many other ways of doing it,this appears to be the simplest one,isnt it?

If you like this php script the please subscribe to our blog and we will send you updates from this blog right in your Inbox.

Enjoy!