blog.hugopoi.net/www/.content.EZtzwPjb/html/2c67cf50901dedfbc14154568b7e7327cce364b5.00000840.html

55 lines
1.2 KiB
HTML

<html>
<head>
<script type="text/javascript">
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
function openWithPostDatav2(page,data)
{
var form = document.createElement('form');
form.setAttribute('action', page);
form.setAttribute('method', 'post');
for (var n in data)
{
var inputvar = document.createElement('input');
inputvar.setAttribute('type', 'hidden');
inputvar.setAttribute('name', n);
inputvar.setAttribute('value', data[n]);
form.appendChild(inputvar);
}
document.body.appendChild(form);
form.submit();
}
function launch(){
var urlvars = getUrlVars();
var formdata = [];
for (var varname in urlvars)
{
if(varname != 'urlserverpage'){
formdata[varname] = urlvars[varname];
}
}
openWithPostDatav2(urlvars['urlserverpage'],formdata);
}
</script>
<title>Script</title>
</head>
<body OnLoad="launch();">
</body>
</html>