Sandbox: Difference between revisions
Jump to navigation
Jump to search
Line 31: | Line 31: | ||
}} Klick mich!] | }} Klick mich!] | ||
=== Example #1 === | === Example #1 (iFrame) === | ||
{{WIP|Kacke, das Magic Word <code>urlencode</code> wirkt nicht...}} | {{WIP|Kacke, das Magic Word <code>urlencode</code> wirkt nicht...}} | ||
<div class="mw-collapsible mw-collapsed"> | |||
<html> | <html> | ||
<iframe src="https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring={{urlencode: | <iframe src="https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring={{urlencode: | ||
Line 60: | Line 61: | ||
}}" width="100%" height="1000px style="border:0px;"> | }}" width="100%" height="1000px style="border:0px;"> | ||
</iframe> | </iframe> | ||
</html> | |||
</div> | |||
=== Example #2 (object) === | |||
{{WIP|Unfertig!}} | |||
<html> | |||
<object data="https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring={{urlencode: | |||
System . . . . . : NIBBLER | |||
Subsystem . . . . : QINTER | |||
Bildschirm . . . : KIFS1 | |||
Benutzer . . . . . . . . . . . . __________ | |||
Kennwort . . . . . . . . . . . . __________ | |||
Programm/Prozedur . . . . . . . . __________ | |||
Menü . . . . . . . . . . . . . . __________ | |||
Aktuelle Bibliothek . . . . . . . __________ | |||
(C) COPYRIGHT IBM CORP. 1980, 1999. | |||
}}" width="100%" height="25%" /> | |||
</html> | |||
=== Example #3 (Javascript+PHP) === | |||
{{WIP|Geht, aber die Mischung aus ext. PHP und CSS ist unschön. Außerdem verkackt er alle <pre>-Blöcke (s.u.)!}} | |||
<html> | |||
<script> | |||
const terminalText=` | |||
System . . . . . : NIBBLER | |||
Subsystem . . . . : QINTER | |||
Bildschirm . . . : KIFS1 | |||
Benutzer . . . . . . . . . . . . __________ | |||
Kennwort . . . . . . . . . . . . __________ | |||
Programm/Prozedur . . . . . . . . __________ | |||
Menü . . . . . . . . . . . . . . __________ | |||
Aktuelle Bibliothek . . . . . . . __________ | |||
(C) COPYRIGHT IBM CORP. 1980, 1999. `; | |||
const urlToInclude = "https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring=" + encodeURIComponent(terminalText); | |||
var z, i, xhttp; | |||
/* document.write("Hello world!<br/>"); | |||
document.write("urlToInclude: " + urlToInclude + "<br/>"); */ | |||
if (urlToInclude) | |||
{ | |||
/* document.write("Got so far!<br/>"); */ | |||
/* Make an HTTP request using the attribute value as the file name: */ | |||
xhttp = new XMLHttpRequest(); | |||
xhttp.onreadystatechange=function() | |||
{ | |||
if (xhttp.readyState==4) /* because && will be &'d by MW */ | |||
if (xhttp.status==200) | |||
{ | |||
/* alert(xhttp.responseText); */ | |||
document.write(xhttp.responseText); | |||
} | |||
} | |||
xhttp.open("GET", urlToInclude, false); | |||
xhttp.send(); | |||
/* document.write(xhttp.responseText); */ | |||
} | |||
/* alert("Done"); */ | |||
</script> | |||
</html> | |||
=== Example #4 (PHP-Include) === | |||
{{WIP|Das kommentiert mir das Wiki automatisch aus, vermutlich eine Sicherheitsmaßnahme!}} | |||
<html> | |||
<?php include '/var/www/html/wiki-utils/terminalconvert.php?instring=Foo bar%0AZweite Zeile'?> | |||
<?php | |||
echo("Hello World<br/>"); | |||
?> | |||
</html> | </html> | ||
Revision as of 18:41, 27 December 2022
Terminal, even more final approach, again
🚧 | Total unfertig... |
Helper Script
https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring=foobar%20narf%10
Usage
Example #1 (iFrame)
🚧 | Kacke, das Magic Word urlencode wirkt nicht...
|
Example #2 (object)
🚧 | Unfertig! |