gb-vorschau.php<!-- Eingaben verarbeiten --> <?php include "../../include/gb/verarbeiten.php"; ?>
<!-- Vorschau anzeigen --> <h1> Vorschau</h1> <h3> Sie haben folgenden Eintrag gemacht:</h3> <p> <span class="sprache">your input / vos données</span></p> <table border="1px" cellspacing="1" cellpadding="3"> <tr> <th>Ihr Name</th> <td width="350"><? echo $gb_name ?></td> </tr> <tr> <th>Ihre E-Mail Adresse</th> <td><? echo $gb_email ?></td> </tr> <tr> <th>Thema</th> <td><? echo $gb_thema ?></td> </tr> <tr> <th>Ihr Eintrag</th> <td><? echo $gb_eintrag ?></td> </tr> </table>
1) Kontrolle ob der Name des Absenders angegeben wurde:
<!-- Kontrollen und Meldungen -->
<?php
// Kontrolle ob Name angegeben
if ($gb_name != "" ) {
$xgb_name = true;} else {$xgb_name = false;}
// Meldung bei fehlendem Namen
if ( !$xgb_name) {
echo '<h4 style="margin-top:3em">Ihr Name fehlt</h4>
<p> <span class="sprache">please indicate your name
/ donnez votre nom s.v.p. </span></p>
<p>→ Drücken Sie bitte "Zurück", und geben Sie im
Eingabeformuar Ihren Namen an.</p>';
echo '<input type="button" value="Zurück / back / retour"
onClick="history.back()">';
}
2) Kontrolle ob ein Thema (Betreff) angegeben wurde:
// Kontrolle ob Thema angegeben wurde
if ($gb_thema != "" ) {
$xgb_thema = true;} else {$xgb_thema = false;}
// Meldung bei fehlendem Thema
if ( !$xgb_thema) {
echo '<h4 style="margin-top:3em">Das Thema (Betreff) fehlt</h4>
<p> <span class="sprache">the reference is missing
/ la référence manque</span></p>
<p>→ Drücken Sie bitte "Zurück"
und ergänzen Sie das Eingabeformular.</p>';
echo '<input type="button" value="Zurück / back / retour"
onClick="history.back()">';
}
3) Kontrolle ob im Feld der Mitteilungen ein Eintrag gemacht wurde:
// Kontrolle ob ein Eintrag (Mitteilung) gemacht wurde
if ($gb_eintrag != "") {
$xgb_eintrag = true;} else {$xgb_eintrag = false;}
// Meldung bei fehlendem Eintrag (Mitteilung)
if ( !$xgb_eintrag) {
echo '<h4 style="margin-top:3em">
Der Eintrag (Mitteilung) fehlt</h4>
<p> <span class="sprache">there is no message
/ il n′y a pas de message</span></p>
<p>→ Drücken Sie bitte "Zurück"
und ergänzen Sie das Eingabeformular.</p>';
echo '<input type="button"
value="Zurück / back / retour"
onClick="history.back()">';
}
Plausibilität der E-Mail Adresse des Absenders:
// Kontrolle ob E-Mail falsch ist
$leng = strlen( $gb_email );
$posa = strrpos( $gb_email, "@");
$posp = strrpos( $gb_email, ".");
if ( $posp > 4 && $posa > 0 && substr_count($gb_email,"@")==1 &&
$leng-$posp < 6 && $leng-$posp > 2 && $posp-$posa > 2 ) {
$xgb_email = true;}
else { if ( $leng == 0 || $Email=='optional') {
$xgb_email = true;} else { $xgb_email = false; } }
// Meldung bei fehlerhafter E-Mail Adresse
if ( !$xgb_email) {
echo '
<h4 style="margin-top:3em">Fehler in der E-Mail Adresse</h4>
<p> <span class="sprache">error in your e-mail address
/ erreur dans votre adresse mél</span></p>
<p>→ Drücken Sie bitte "Zurück"
und kontrollieren Sie im Eingabeformular
Ihre E-Mail Adresse.</p>';
echo '<input type="button" value="Zurück / back / retour"
onClick="history.back()">';
}
Kontrolle eine E-Mail Adresse angegeben wurde (ohne Rückweisung):
// Kontrolle ob im E-Mail Feld etwas steht
if ($gb_email != "") {
$ygb_email = true;} else {$ygb_email = false;}
// Meldung bei leerem E-Mail Feld
if (!$ygb_email) {
echo '
<h4>Ihre E-Mail Adresse ist nicht angegeben (Fakultativ)</h4>
<p>Ihr Eintrag kann aber auch aufgenommen werden,
wenn Ihre E-Mail Adresse
nicht angeben ist.</p>
<p> <span class="sprache">your e-mail address
is not indicated (optional)
/ votre adresse mél n′est pas
indiquée (en option)</span></p>';
}
// Änderung des Eintrages echo ' <h3> Änderung des Eintrages: </h3> <p> <span class="sprache">to modify / pour modifier</span></p> <input type="button" value="Zurück zum Eingabeformular / back to the form / retour au formulaire" onClick="history.back()">'; ?>
<!-- Verstecktes Formular einlesen --> <form action="../gaestebuch/gb-speichern.php" method="post"> <input type="hidden" name="gb_name" value="<? echo $gb_name ?>"> <input type="hidden" name="gb_email" value="<? echo $gb_email ?>"> <input type="hidden" name="gb_spam" value="<? echo $gb_spam ?>"> <input type="hidden" name="gb_thema" value="<? echo $gb_thema ?>"> <input type="hidden" name="gb_eintrag" value="<? echo $gb_eintrag ?>">
<!-- Wenn alles richtig ist: zum speichern senden -->
<?php
if ( $xgb_name && $xgb_email && $xgb_thema && $xgb_eintrag && $xgb_spam ){
echo '
<h2> Zum Senden</h2>
<h3> Drücken Sie "Senden":</h3>
<p> <span class="sprache">push the submit button
/ appuyez sur la touche envoyer</span></p>
<input type="submit" value="Senden / submit / envoyer">';
?>
</form>
<!-- Eingaben verarbeiten -->
<?php
include "../../include/gb/verarbeiten.php";
?>
<!-- Vorschau anzeigen -->
<h1> Vorschau</h1>
<h3> Sie haben folgenden Eintrag gemacht:</h3>
<p> <span class="sprache">your input
/ vos données</span></p>
<table border="1px" cellspacing="1" cellpadding="3">
<tr>
<th>Ihr Name</th>
<td width="350"><? echo $gb_name ?></td>
</tr>
<tr>
<th>Ihre E-Mail Adresse</th>
<td><? echo $gb_email ?></td>
</tr>
<tr>
<th>Thema</th>
<td><? echo $gb_thema ?></td>
</tr>
<tr>
<th>Ihr Eintrag</th>
<td><? echo $gb_eintrag ?></td>
</tr>
</table>
<!-- Kontrollen und Meldungen -->
<?php
// Kontrolle ob Name angegeben
if ($gb_name != "" ) {
$xgb_name = true;} else {$xgb_name = false;}
// Meldung bei fehlendem Namen
if ( !$xgb_name) {
echo '<h4 style="margin-top:3em">Ihr Name fehlt</h4>
<p> <span class="sprache">please indicate your name
/ donnez votre nom s.v.p. </span></p>
<p>→ Drücken Sie bitte "Zurück", und geben Sie im
Eingabeformuar Ihren Namen an.</p>';
echo '<input type="button" value="Zurück / back / retour"
onClick="history.back()">';
}
// Kontrolle ob E-Mail falsch ist
$leng = strlen( $gb_email );
$posa = strrpos( $gb_email, "@");
$posp = strrpos( $gb_email, ".");
if ( $posp > 4 && $posa > 0 && substr_count($gb_email,"@")==1 &&
$leng-$posp < 6 && $leng-$posp > 2 && $posp-$posa > 2 ) {
$xgb_email = true;}
else { if ( $leng == 0 || $Email=='optional') {
$xgb_email = true;} else { $xgb_email = false; } }
// Meldung bei fehlerhafter E-Mail Adresse
if ( !$xgb_email) {
echo '
<h4 style="margin-top:3em">Fehler in der E-Mail Adresse</h4>
<p> <span class="sprache">error in your e-mail address
/ erreur dans votre adresse mél</span></p>
<p>→ Drücken Sie bitte "Zurück"
und kontrollieren Sie im Eingabeformular
Ihre E-Mail Adresse.</p>';
echo '<input type="button" value="Zurück / back / retour"
onClick="history.back()">';
}
// Kontrolle ob Thema angegeben wurde
if ($gb_thema != "" ) {
$xgb_thema = true;} else {$xgb_thema = false;}
// Meldung bei fehlendem Thema
if ( !$xgb_thema) {
echo '<h4 style="margin-top:3em">Das Thema (Betreff) fehlt</h4>
<p> <span class="sprache">the reference is missing
/ la référence manque</span></p>
<p>→ Drücken Sie bitte "Zurück"
und ergänzen Sie das Eingabeformular.</p>';
echo '<input type="button" value="Zurück / back / retour"
onClick="history.back()">';
}
// Kontrolle ob ein Eintrag (Mitteilung) gemacht wurde
if ($gb_eintrag != "") {
$xgb_eintrag = true;} else {$xgb_eintrag = false;}
// Meldung bei fehlendem Eintrag (Mitteilung)
if ( !$xgb_eintrag) {
echo '<h4 style="margin-top:3em">
Der Eintrag (Mitteilung) fehlt</h4>
<p> <span class="sprache">there is no message
/ il n′y a pas de message</span></p>
<p>→ Drücken Sie bitte "Zurück"
und ergänzen Sie das Eingabeformular.</p>';
echo '<input type="button"
value="Zurück / back / retour"
onClick="history.back()">';
}
// Kontrolle ob im E-Mail Feld etwas steht
if ($gb_email != "") {
$ygb_email = true;} else {$ygb_email = false;}
// Meldung bei leerem E-Mail Feld
if (!$ygb_email) {
echo '
<h4>Ihre E-Mail Adresse ist nicht angegeben (Fakultativ)</h4>
<p>Ihr Eintrag kann aber auch aufgenommen werden,
wenn Ihre E-Mail Adresse
nicht angeben ist.</p>
<p> <span class="sprache">your e-mail address
is not indicated (optional)
/ votre adresse mél n′est pas
indiquée (en option)</span></p>';
}
// Änderung des Eintrages
echo '
<h3> Änderung des Eintrages:
</h3>
<p> <span class="sprache">to modify
/ pour modifier</span></p>
<input type="button"
value="Zurück zum Eingabeformular / back to the form
/ retour au formulaire" onClick="history.back()">';
?>
<!-- Verstecktes Formular einlesen -->
<form action="../gaestebuch/gb-speichern.php" method="post">
<input type="hidden" name="gb_name" value="<? echo $gb_name ?>">
<input type="hidden" name="gb_email" value="<? echo $gb_email ?>">
<input type="hidden" name="gb_spam" value="<? echo $gb_spam ?>">
<input type="hidden" name="gb_thema" value="<? echo $gb_thema ?>">
<input type="hidden" name="gb_eintrag" value="<? echo $gb_eintrag ?>">
<!-- Wenn alles richtig ist: zum speichern senden -->
<?php
<!-- Wenn alles richtig ist: zum speichern senden -->
<?php
if ( $xgb_name && $xgb_email && $xgb_thema && $xgb_eintrag && $xgb_spam ){
echo '
<h2> Zum Senden</h2>
<h3> Drücken Sie "Senden":</h3>
<p> <span class="sprache">push the submit button
/ appuyez sur la touche envoyer</span></p>
<input type="submit" value="Senden / submit / envoyer">';
}
?>
</form>
↑