initial
This commit is contained in:
commit
37b7eb3818
6 changed files with 348 additions and 0 deletions
85
php/erika.php
Normal file
85
php/erika.php
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="5; url=index.php" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Schreib auf die Erika</title>
|
||||
<meta name="description" content="Simple Webseite, um auf Erika zu tippen.">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div id="logo"><img src="logo.png">Erika-Tippmaschine</div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="./">Heim</a>
|
||||
<!-- <li><a href="https://html-css-js.com/">HTML</a>
|
||||
<li><a href="https://html-css-js.com/css/code/">CSS</a>
|
||||
<li><a href="https://htmlcheatsheet.com/js/">JS</a> -->
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<section>
|
||||
<?php
|
||||
include 'const.php';
|
||||
$text = $_POST['texta'];
|
||||
$len = strlen(utf8_decode($text));
|
||||
if ( $len > TEXT_MAXLEN )
|
||||
{
|
||||
$meldung = "Text ist zu lang und wurde eingekürzt";
|
||||
$text = substr($text, 0, TEXT_MAXLEN);
|
||||
}
|
||||
|
||||
echo "Text: ".$len." von erlaubten ".TEXT_MAXLEN." Zeichen.";
|
||||
|
||||
$nlkorrekt = preg_replace('~\R~u', "\r\n", $text);
|
||||
$suchmuster = '/[^-a-zA-Z0-9äüöÄÜÖß ,;\.:()%&$§"!+*#\'\?\/\n\r]/';
|
||||
$ersetzung = '(?)';
|
||||
$neuertext = preg_filter($suchmuster, $ersetzung, $nlkorrekt);
|
||||
|
||||
//Ersetze vier+mehr \n durch \n---\n
|
||||
$newlinebereinigt = preg_replace('/(\R){3,}/m', "\r\n---\r\n", $neuertext );
|
||||
|
||||
$umgebrochen = wordwrap($newlinebereinigt, TEXT_MAXLINE);
|
||||
|
||||
//echo $neuertext;
|
||||
//echo "<br/>Der Text:<br/>";
|
||||
//echo $newlinebereinigt;
|
||||
echo "<br/>";
|
||||
// $arg = escapeshellarg($newlinebereinigt);
|
||||
//echo "<br/> arg: ".$arg;
|
||||
|
||||
$res = system(ERIKA_CMD.$arg);
|
||||
echo "<br/>";
|
||||
?>
|
||||
|
||||
<strong>Befehl wurde ausgeführt: <?php echo $res ?></strong>.
|
||||
</section>
|
||||
<section id="pageContent">
|
||||
<main role="main">
|
||||
<h1>Erika schreibt</h1>
|
||||
<article>
|
||||
<p>Wenn alles gut war, ist jetzt der Text zu sehen:
|
||||
</p>
|
||||
<br/>
|
||||
<pre><?php echo $umgebrochen ?></pre>
|
||||
</article>
|
||||
<h1>Zurück</h1>
|
||||
<article>
|
||||
Hier geht's wieder <a href="./" >zurück</a>. Normalerweise aber automatisch.
|
||||
</article>
|
||||
|
||||
</main>
|
||||
</section>
|
||||
<footer>
|
||||
<p>© Robert Köpferl für ChCh und Klub Solitär | Vorlage: <a href="https://html5-templates.com/" target="_blank" rel="nofollow">HTML5 Templates</a></p>
|
||||
<address>
|
||||
Kontakt: <a href="mailto:presse@klub-solitaer.de">E-Mail an Klub Solitär</a>
|
||||
</address>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue