php – I am not sure, how to write redirect pages , in Php .. can someone give me illustration

Hi this is very easy to do.

Example Code:
<?php
session_start(); // so that we can access session variables

function FunJavaScriptRedirection($url)  // Function developed for redirect in php using javascript
{?>
<script type=”text/javascript”>
<!–
window.location = “<?=$url?>”
//–>
</script>
<?}

if($_SESSION[‘login’]==’yes’) // if $_SESSION[‘login’] is having valye=’yes’
{
echo  “success full”;
FunJavaScriptRedirection(“main.php”) ;
}else
{
echo “please login”;
FunJavaScriptRedirection(“login.php”)
}

?>

10 Comments »

  1. amitmondal said

    Nice tutorial….thanks for this post…..
    Please visit this link for learn more script.
    http://amitmondal.wordpress.com/

  2. Thank you for the auspicious writeup. It in fact used to be a enjoyment account it. Glance complicated to more brought agreeable from you! By the way, how could we keep in touch?

  3. Shawna said

    If you find it a bit maddening to follow the daily fluctuations of the scale even though you are eating properly,
    pick three days of the week on which you will always weigh yourself (for example, Monday, Wednesday,
    and Friday). It’s old news that tracking food intake could lead to losing a few
    pounds [2]. Do not be tempted to lose weight
    as quickly as you can, because a crash diet will have you
    eating less than a thousand calories a day slowing down your metabolism.

  4. Jerry said

    3 lb (525g) Ripe Bananas 6oz (175g) Brown Sugar
    40z (100g) Sultanas 2 Eggs 8oz (225g) Self
    Raising Flour. For instance, it is an excellent idea
    to prepare the birthday cake of a golf lover
    in the shape of a golf ball in a golf course. It is best
    to use good quality filtered coffee in this recipe.

  5. If you find it a bit maddening to follow
    the daily fluctuations of the scale even though you are eating properly,
    pick three days of the week on which you will always weigh yourself
    (for example, Monday, Wednesday, and Friday). Vinson had
    participants keep their normal diet and exercise routines (or lack thereof) and merely added
    the green coffee. Then leave it a while until your tummy lets you know that
    you’re hungry again before opting for a healthy snack.

  6. phyto sc said

    Hello, the whole thing is going perfectly here and ofcourse every one is sharing information, that’s truly fine,
    keep up writing.

  7. This post will help the internet visitors for building up new
    blog or even a weblog from start to end.

  8. What i don’t realize is if truth be told how you are no longer
    actually much more well-appreciated than you may be right now.
    You’re so intelligent. You understand therefore
    considerably relating to this matter, produced me personally
    imagine it from a lot of numerous angles.
    Its like women and men don’t seem to be involved except it is something
    to accomplish with Woman gaga! Your own stuffs excellent.
    At all times deal with it up!

  9. Attractive section of content. I simply stumbled
    upon your weblog and in accession capital to say that I acquire actually enjoyed account your weblog posts.

    Anyway I will be subscribing in your feeds and even I fulfillment you get entry to persistently fast.

  10. click here said

    Some genuinely interesting points you have written.Assisted
    me a lot, just what I was searching for :D.

RSS feed for comments on this post · TrackBack URI

Leave a reply to phyto sc Cancel reply