Don't understand where the image redirects me
<p>I'm trying to make a batch which takes you to a link, but this is not the problem, the problem is that I'm trying to get the link from the website and I don't know why I'm bad. I explain it better, in the website there is an image, this image takes you to the place I want. This is the image code. Forget the cookie, I only want the place which this image takes you to.</p>

<pre><code>&lt;div id="x" class="votes" style="height:30px;"&gt;
&lt;img src="images/image.png" id="y"&gt;&lt;/div&gt;
</code></pre>

<p>Going down, we have this code:</p>

<pre><code>&lt;script&gt;
("#y").click(function () {
  $.post("z.php",{id:100},function(exit){
    $("#x").html(exit);
  }
);
&lt;/script&gt;
</code></pre>

<p>Ok, the problem is that when I'm in the website, for example www.h.com/i.php?id=100 (which has the code I showed you) and I change the url to /i.php?id=100 for /z.php?id=100 (what I thought the website does) I get this error:</p>

<blockquote>
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1.</p>
</blockquote>

<p>But if you click the image.png in the web, the web does what I'm trying to do with urls... I don't know if you understand me, sorry for my English and my explanations. </p>
