title: How to pass values from one page to other page by javascript and get the passed value in the other page using php?
body: <p>I want to pass a value from one page to other page when the user clicks on a link. </p>
  
  <p>For example </p>
  
  <pre><code>&lt;a href="javascript:void(0)" onclick="window.parent.loadFrame('bloodbankFacilities/specialtyDataTable.php',this.innerHTML);"&gt;Blood Bank Facilities &lt;/a&gt;
  </code></pre>
  
  <p>above is the the link i have to redirect the user to specialityDataTable.php</p>
  
  <p>I want to pass a text value to specialityDataTable.php when the user clicks the link and get the value in specialityDataTable.php by using php GET method and echo it.</p>
  
  <p>I was doing this before, but i forgot how to do it :( .</p>
  
  <pre><code>function loadFrame(url,anchorText){
              //alert(url);
              if(document.getElementById(url)){               
                  if(hasClassName(document.getElementById(url),"selectedTabHead")){
                      return false;
                  }
                  else{
                      changeTab(url,document.getElementById(url));
                      return false;
                  }
              }
  
              iframeId = "ifr_"+url;
  
  
              var iframeElem = getElementsByClass("bodyFrame");
  
              for(var i=0;i&lt;iframeElem.length;i++){
                iframeElem[i].style.display = 'none';                
              }
  
              if(!document.getElementById(iframeId)){
                  var elt = document.createElement("iframe");
                  elt.setAttribute("class","bodyFrame");
                  elt.setAttribute("id",iframeId);
                  elt.setAttribute("onload","iframeReload();");
                  document.getElementById('content').appendChild(elt);
              }
              document.getElementById("loadr").style.display = 'block';     
                  document.getElementById(iframeId).style.display = 'block'
                  document.getElementById(iframeId).src = url;            
  
              var elements = getElementsByClass("tabHead",document.getElementById("tabStrip"));
  
              for(var i=0;i&lt;elements.length;i++){
                  if(hasClassName(elements[i],"selectedTabHead")){
                      removeClassName(elements[i],"selectedTabHead");
                  }
              }
              var elt = document.createElement("span");
              elt.setAttribute("class","tabHead selectedTabHead");
              elt.setAttribute("id",url);
              elt.innerHTML = "&lt;a href='javascript:void(0);'  onclick=changeTab('"+url+"',this.parentNode)&gt;"+anchorText+"&lt;/a&gt; &lt;b onclick='removeTab(this.parentNode.id)'&gt;x&lt;/b&gt;";
  
              if(elements.length == 0){
                  document.getElementById("tabStrip").appendChild(elt);
              }
              else{                
                  document.getElementById("tabStrip").insertBefore(elt,elements[0]);
              }
              var tabCookie =  document.getElementById("tabStrip").innerHTML;
              setCookie("&lt;?php echo $_SESSION['userId'] ?&gt;",tabCookie);
              setWidth();
              //autoHeight();
          };
  
  
          function loadFullScreen(url){
              url = "&lt;?php echo ROOT_PATH; ?&gt;"+"full.php?q="+url;
              jsPopUp(url,800,1000);
  
          }
  
  
          function changeTab(url,obj){
             // document.getElementById("loadr").style.display = 'block';            
              parentnode = document.getElementById("tabStrip");
              var elements = getElementsByClass("tabHead",parentnode);
  
              for(var i=0;i&lt;elements.length;i++){
                  if(hasClassName(elements[i],"selectedTabHead")){
                      removeClassName(elements[i],"selectedTabHead");
                  }
              }
  
              addClassName(obj,"selectedTabHead");
  
             // document.getElementById("bodyFrame").src = url;
              iframeId = "ifr_"+url;
  
  
              var iframeElem = getElementsByClass("bodyFrame");
  
              for(var i=0;i&lt;iframeElem.length;i++){
                iframeElem[i].style.display = 'none';                
              }
              //alert(document.getElementById(iframeId));
              if(!document.getElementById(iframeId)){
                  var elt = document.createElement("iframe");
                  elt.setAttribute("class","bodyFrame");
                  elt.setAttribute("id",iframeId);
                  elt.setAttribute("onload","iframeReload();");
                  document.getElementById('content').appendChild(elt);
  
              }
  
                  document.getElementById(iframeId).style.display = 'block'
  
  
          };
  </code></pre>