PDA

View Full Version : Link to Form Post for Sensitive Data in URL's


SlySecretSpy
07-12-2004, 11:39 PM
Here is a simple script that I created to protect sensitive information that I wanted to post to forms through a single link.

<a href="#" onClick="javascript:urlprotect(<'processing page filename>','variablename=value&variablename2=value&variablenam3=value');">Text To Display</a>

function urlprotect(page,values)
{
formelem = document.createElement('form');
formelem.setAttribute("method","post");
formelem.setAttribute("action",page);
formelem.setAttribute("id","urlprotect");
queryarray = values.split("&");
var i = 0;
while (i<queryarray.length)
{
attrib = queryarray[i].split("=");
inputelm = document.createElement('input');
inputelm.setAttribute("name",attrib[0]);
inputelm.setAttribute("value",attrib[1]);
inputelm.setAttribute("type","hidden");
formelem.appendChild(inputelm);
i++;
}
document.body.appendChild(formelem);
document.getElementById("urlprotect").submit();
}


http://www.portalaska.com/hide.php