coly
05-15-2014, 11:11 AM
hi,
I've build a PHP form that creates .txt files with a certain syntax, as you can see here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="de">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/charCount.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#message1").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message2").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message3").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message4").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message5").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message6").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message7").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
});
</script>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<!-- TERMINE ANLEGEN FORMULAR -->
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">
<form name="formular" id="formular" method="POST">
<h1>Termin anlegen</h1>
<!-- DATEINAME -->
<div>
<label>
<h3>Dateiname:</h3>
<input type="text" name="title" class="zeile">
</label>
</div>
<!-- ZEILE1 -->
<div>
<label>
<h3>Zeile1:</h3>
<input type="text" name="zeile1" class="zeile" id="message1" maxlength="26">
</label>
</div>
<!-- ZEILE2 -->
<div>
<label>
<h3>Zeile2:</h3>
<input type="text" name="zeile2" class="zeile" id="message2" maxlength="26">
</label>
</div>
<!-- ZEILE3 -->
<div>
<label>
<h3>Zeile3:</h3>
<input type="text" name="zeile3" class="zeile" id="message3" maxlength="26">
</label>
</div>
<!-- ZEILE4 -->
<div>
<label>
<h3>Zeile4:</h3>
<input type="text" name="zeile4" class="zeile" id="message4" maxlength="26">
</label>
</div>
<!-- ZEILE5 -->
<div>
<label>
<h3>Zeile5:</h3>
<input type="text" name="zeile5" class="zeile" id="message5" maxlength="26">
</label>
</div>
<!-- ZEILE6 -->
<div>
<label>
<h3>Zeile6:</h3>
<input type="text" name="zeile6" class="zeile" id="message6" maxlength="26">
</label>
</div>
<!-- ZEILE7 -->
<div>
<label>
<h3>Zeile7:</h3>
<input type="text" name="zeile7" class="zeile" id="message7" maxlength="26">
</label>
</div>
<br>
<!-- SPEICHERN -->
<div>
<input type="submit" value="Speichern" onclick="alert('Termin wird angelegt, bitte warten bis die Seite neu geladen wurde.');">
</div>
</form>
</div>
</div>
</body>
</html>
In the next step, I listed all .txt files so that they can be deleted again, here:
<html lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">
<!-- TERMINE LÖSCHEN FORMULAR -->
<form id="formular" method="POST">
<h1>Termine löschen</h1>
<h2>Es wurde(n) <?php echo --$i-1 ?> Termin(e) gefunden. Die Datei "_gsdata_" dient zur Überprüfung und kann daher nicht gelöscht werden.</h2>
<table>
<thead>
<tr>
<th>Datei</th><th>löschen</th>
</tr>
</thead>
<tbody>
<?php echo $tablerows ?>
</tbody>
</table><br>
<input type="submit" value="Löschen" onclick="return confirm('Die ausgewählten Termine werden gelöscht! Sind Sie sicher?');">
</form>
</div>
</div>
</body>
</html>
What I am trying to do now, is making it possible to edit those .txt files after they are created. So that I next to my delete-checkbox, I have an edit-button, that opens the .txt file within the PHP form again, and if saved, it should overwrite the existing .txt file. Problem is, I don't have a clue how to do that.
I've build a PHP form that creates .txt files with a certain syntax, as you can see here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="de">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/charCount.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#message1").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message2").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message3").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message4").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message5").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message6").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
$("#message7").charCount({
allowed: 26,
warning: 5,
counterText: 'Verfügbare Zeichen: '
});
});
</script>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<!-- TERMINE ANLEGEN FORMULAR -->
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">
<form name="formular" id="formular" method="POST">
<h1>Termin anlegen</h1>
<!-- DATEINAME -->
<div>
<label>
<h3>Dateiname:</h3>
<input type="text" name="title" class="zeile">
</label>
</div>
<!-- ZEILE1 -->
<div>
<label>
<h3>Zeile1:</h3>
<input type="text" name="zeile1" class="zeile" id="message1" maxlength="26">
</label>
</div>
<!-- ZEILE2 -->
<div>
<label>
<h3>Zeile2:</h3>
<input type="text" name="zeile2" class="zeile" id="message2" maxlength="26">
</label>
</div>
<!-- ZEILE3 -->
<div>
<label>
<h3>Zeile3:</h3>
<input type="text" name="zeile3" class="zeile" id="message3" maxlength="26">
</label>
</div>
<!-- ZEILE4 -->
<div>
<label>
<h3>Zeile4:</h3>
<input type="text" name="zeile4" class="zeile" id="message4" maxlength="26">
</label>
</div>
<!-- ZEILE5 -->
<div>
<label>
<h3>Zeile5:</h3>
<input type="text" name="zeile5" class="zeile" id="message5" maxlength="26">
</label>
</div>
<!-- ZEILE6 -->
<div>
<label>
<h3>Zeile6:</h3>
<input type="text" name="zeile6" class="zeile" id="message6" maxlength="26">
</label>
</div>
<!-- ZEILE7 -->
<div>
<label>
<h3>Zeile7:</h3>
<input type="text" name="zeile7" class="zeile" id="message7" maxlength="26">
</label>
</div>
<br>
<!-- SPEICHERN -->
<div>
<input type="submit" value="Speichern" onclick="alert('Termin wird angelegt, bitte warten bis die Seite neu geladen wurde.');">
</div>
</form>
</div>
</div>
</body>
</html>
In the next step, I listed all .txt files so that they can be deleted again, here:
<html lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">
<!-- TERMINE LÖSCHEN FORMULAR -->
<form id="formular" method="POST">
<h1>Termine löschen</h1>
<h2>Es wurde(n) <?php echo --$i-1 ?> Termin(e) gefunden. Die Datei "_gsdata_" dient zur Überprüfung und kann daher nicht gelöscht werden.</h2>
<table>
<thead>
<tr>
<th>Datei</th><th>löschen</th>
</tr>
</thead>
<tbody>
<?php echo $tablerows ?>
</tbody>
</table><br>
<input type="submit" value="Löschen" onclick="return confirm('Die ausgewählten Termine werden gelöscht! Sind Sie sicher?');">
</form>
</div>
</div>
</body>
</html>
What I am trying to do now, is making it possible to edit those .txt files after they are created. So that I next to my delete-checkbox, I have an edit-button, that opens the .txt file within the PHP form again, and if saved, it should overwrite the existing .txt file. Problem is, I don't have a clue how to do that.