0
is it possible in php java scrip and jquery that we give a condition and redirect page to another pages on depending on those condition like
if($id==1)
{
    header(location:page1.php);
}
else
{
header(location:page2.php);
}
the value of id comes from database.
something like that using jc jquery enything please help its argent.
2
Contributors
2
Replies
8
Views
4 Years
Discussion Span
Last Post by AARTI SHRIVAS
1

It is possible, In jquery

exg:

<script type="text/javascript">
$(function(){
<?php
    if($id==1)
    {
?>
        window.location="page1.php";
<?php
    }
    else
    {
?>
        window.location="page2.php";
<?php    
    }
    ?>
});
</script>

Edited by Bachu

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.