I am trying to redirect to same page i am on but with some variable. The code i have written here is simple to understand. In my project there are too many html lines lying between them.
<?php
$id = 11;
?>
<?php
echo '<script> window.location.href = "index.php?id=$id"</script>';
?>
It should take me to same page with like "index.php?id=11" but it loads page as "index.php?id=". What i can do to over come this ?