I have an HTML page that captures the user signature as SVG. I convert it to a page in .png and put it in the image container.
How can I use this to go to the database? I know how to do this using: <input type="file" /> , but I don't know how to pass the <img /> element to PHP.
This changes my SVG to PNG
$("#save").click(function(){ var datapair = sigdiv.jSignature("getData", "svg"); var i = new Image(); i.src = "data:" + datapair[0] + "," + datapair[1]; $(i).appendTo($("#outputSvg")); var canvas = document.getElementById("canvas"); canvg(canvas, datapair[1]); var img = canvas.toDataURL("image/png"); $("#outputRaster").append("<img src='"+img+"'/>"); });
How to take the <img /> that I generate in <div id='outputRaster'> and pass it to my PHP? I know how to put it in a database, itβs just getting an image from my view level to my PHP page, which is used only to access data.
Any help or advice would be greatly appreciated!
source share