Sendende und empfangende Datei | So sieht die absendende Datei aus | |
Geben Sie ihre Daten ein | ||
So sieht die empfangende Datei aus | ||
| ||
Quellcode | ||
<html> <head> <script type="text/javascript"> function Werteliste (querystring) { if (querystring == '') return; var wertestring = querystring.slice(1); var paare = wertestring.split("&"); var paar, name, wert; for (var i = 0; i < paare.length; i++) { paar = paare[i].split("="); name = paar[0]; wert = paar[1]; name = unescape(name).replace("+", " "); wert = unescape(wert).replace("+", " "); this[name] = wert; } } var liste = new Werteliste(location.search); </script> <style type="text/css"> #td {font-size:1em; color:#008080; font-weight:bold; background-color:lightblue;font-family: "Sigmar One"; width:200px;} th {font-size:1em; color:#008080; font-weight:bold; background-color:lightblue;font-family: "Sigmar One"; width:200px;} tr {font-size:1em; color:black; background-color:white;font-family: Verdana, Geneva, Tahoma, sans-serif;} #table {background-color:white} </style> </head> <body style="margin: 0px 0 0 0; "> <table align="center" id="table" class="auto-style26" style="width: auto" cellpadding="0" cellspacing="0"> <form name="formular" action="" onsubmit="sichern(); return false;"> <tr><td class="auto-style23"><label for="vorname">Vorname: </label></p></td> <td class="auto-style23"><input type="text" name="Vorname" id="vorname" size="25"></p></td></tr> <tr><td class="auto-style23"><label for="nachname">Nachname: </label></p></td> <td class="auto-style23"><input type="text" name="Nachname" id="nachname" size="25"></p></td></tr> <tr><td class="auto-style23"><label for="wohnort">Wohnort: </label></p></td> <td class="auto-style23"><input type="text" name="Wohnort" id="wohnort" size="25"></p></td></tr> <tr><td class="auto-style23"><label for="email">Email: </label></p></td> <td class="auto-style23"><input type="text" name="Email" id="email" size="25"></p></td></tr> </table><br/> <p><input type="submit" value="Senden"></p> </form> <script type="text/javascript"> function sichern () { storage.set("vorname", document.forms.formular.elements.vorname.value); storage.set("nachname", document.forms.formular.elements.nachname.value); storage.set("wohnort", document.forms.formular.elements.wohnort.value); storage.set("email", document.forms.formular.elements.email.value); location.href = " "; } </script> <script> var storage = new function () { var dataContainer = {}; function linearize () { var string = "", name, value; for (name in dataContainer) { value = encodeURIComponent(dataContainer[name]); name = encodeURIComponent(name); string += name + "=" + value + "&";} if (string != "") { string = string.substring(0, string.length - 1);} return string;} function read () { if (window.name == '' || window.name.indexOf("=") == -1) { return; } var pairs = window.name.split("&"); var pair, name, value; for (var i = 0; i < pairs.length; i++) { if (pairs[i] == "") { continue; } pair = pairs[i].split("="); name = decodeURIComponent(pair[0]); value = decodeURIComponent(pair[1]); dataContainer[name] = value;} } function write () { window.name = linearize();} this.set = function (name, value) { dataContainer[name] = value; write();}; this.get = function (name) { var returnValue = dataContainer[name]; return returnValue; }; this.getAll = function () { return dataContainer; }; this.remove = function (name) { if (typeof(dataContainer[name]) != undefined) { delete dataContainer[name]; } write();}; this.removeAll = function () { dataContainer = {}; write(); }; read();}; </script> </body> </html> |