javascript - PHP call to header() function is not working -


this question has answer here:

i trying change page using php after set session variable. calling function code

 echo "<a href='index.php?id=";            echo $row['id'];           echo "'><img src='images/pic_1.jpg' 

the function called , variable set page never redirects

    <?php         function getid() {  echo $_get['id'];  session_start();  header("location: home.php");  $_session['id'] = $_get['id'];    }      if (isset($_get['id'])) {      getid();    }              ?>    

i have tried both using exact url , file name none work. how have both page redirect , $_session['id'] variable work?

response headers have sent before response body in http. code contains echo statement (which starts sending body) before call header(), sending headers cannot work.


Comments

Popular posts from this blog

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -