title: How to send variable value using php in header?
body: <p>I am trying to send user_id in url which id i get after login conform.Following are the code
   extract($_POST);</p>
  
  <pre><code>    $result = $dbg-&gt;prepare("SELECT `p_id`,`email` FROM `complit_register_provider` WHERE `email`=:hjhjhjh AND `password`=:psspsps") ;
                        $result-&gt;bindParam(':hjhjhjh', $login_mail);
                        $result-&gt;bindParam(':psspsps', $login_password);
                        $result-&gt;execute();
                        $rows = $result-&gt;fetch(PDO::FETCH_ASSOC);
                        $row=$result-&gt;rowCount();
               if($rows){
                   $result=$result-&gt;fetch(PDO::FETCH_ASSOC);
                   $_SESSION['Uname']=$rows['email'];
                   $_SESSION['Utype']="provider";
                  $_SESSION['Uid']=$rows['p_id'];
          $user_id=$_SESSION['Uid'];
  
  header('Location: http://127.0.0.1/pages/user_index/provider/user_profile/show_own_profile.php?Show=$user_id');
               }
  </code></pre>
  
  <p>But it's not working. The url showing like.</p>
  
  <p><a href="http://127.0.0.1/pages/user_index/provider/user_profile/show_own_profile.php?Show=" rel="nofollow">http://127.0.0.1/pages/user_index/provider/user_profile/show_own_profile.php?Show=</a>$user_id,
  It should show for example like
  <a href="http://127.0.0.1/pages/user_index/provider/user_profile/show_own_profile.php?Show=9" rel="nofollow">http://127.0.0.1/pages/user_index/provider/user_profile/show_own_profile.php?Show=9</a>
  How can i do this?</p>