title: Ajax Get request using anchor to send requests - not sending variable
body: <p>I have this php code that retrieves information from the database depending on what image ID is present. It works fine, now I'm trying to turn this into an ajax request so it loads onto the one page. I'm struggling to send the variable through, the ajax request seems to work fine in that it is sending to the page and retrieving the information but it's not sending the variable through so the information returned is blank.</p>
  
  <p>I've been following tutorial and trying to adapt it for my needs and starting to fall apart with it towards the end.</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Here's my html:</p>
  
  <pre><code>//these anchors are meant to send the value attribute through the ajax using showEp()
  //I believe it's here that the request is falling down.
  &lt;a href="#" value="&lt;?php echo $ep['ep_id'];?&gt;" onclick="showEp(this.value)"&gt;&lt;img src="images/Database/releases/&lt;?php 
      if(isset($ep['ep_img'])){
          echo $ep['ep_img'];
      } else {
          echo 'no_EP.png';
      }
      ?&gt; " height="125" width="125"/&gt;&lt;/a&gt;
  &lt;div id="ep"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Here's my javascript:</p>
  
  <pre><code>function showEp(str)
  {
  if (str=="")
    {
    document.getElementById("ep").innerHTML="";
    return;
    } 
  if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
  else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
      document.getElementById("ep").innerHTML=xmlhttp.responseText;
      }
    }
  xmlhttp.open("GET","showep.php?ep_id="+str,true);
  xmlhttp.send();
  }
  return false; // to disable the link from following it's href.
  </code></pre>