Save Canvas image (Post the data string to PHP)
<p>I'm looking to learn Javascript and have been wanting to for a while, I got a little tutorial on how to create a HTML5 Canvas drawing application, I'm trying to modify it so I can save the image to my MySQL database. So far, the code below simply redirects to my PHP file and does have the code I'd like, but it's a little big so I was wondering if there was a way to reduce that or possibly even _POST it to the PHP script.</p>

<pre><code>    saveAsPNG : function(oCanvas, bReturnImg, iWidth, iHeight) {
        if (!bHasDataURL) {
            return false;
        }
        var oScaledCanvas = scaleCanvas(oCanvas, iWidth, iHeight);
        var strData = oScaledCanvas.toDataURL("image/png");
        window.location.href = "http://localhost/save_server/?image=" + strData;
        if (bReturnImg) {
            return makeImageObject(strData);
        } else {
            saveFile(strData.replace("image/png", strDownloadMime));
        }
        return true;
    },
</code></pre>

<p>I'm using window.location.href  to send the data. Any help would be appreciated. The URL which it currently gives is...</p>

<p>localhost/save_server/?image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4EAAAIUCAYAAACkdimIAAAgAElEQVR4Xu3XQQEAAAgCMelf2iA3GzD8sHMECBAgQIAAAQIECB... You know what? It is so big, I'm not even going to post it here.</p>

<p>Thanks for any help in advance!</p>
