Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hey - 

ich arbeite gerade in der Schule an einem Projekt. Ich habe eine Seite erstellt, in der ein Formular ausgefüllt wird, dessen Daten dann in der DB landen. Soweit so gut, nun habe ich jedes Formular (es soll mehr als eine abfrage geben) als einzelne .php Datei erstellt und möchte erreichen, dass an der Seite wo das aktuelle Formular ausgefüllt wurde, nach dem ausfüllen davon das nächste lädt. Wie funktioniert das? Ich kann leider im Internet keine Lösung finden - vmtl google ich falsch 🙃

 

Hier ein kleiner Teil zum Verständnis - 

Formular ist so eingebunden  <?php include("html/include/formulars/formular.php"); ?>

nach Ausführung des submit Buttons im Formular, soll  <?php include("html/include/formulars/formular2.php"); ?> an selber Stelle geladen werden. Dann 3 - dann 4 etc.

 

Vielen Dank schonmal im Vorraus 🙂

 

Moin,

nach der Verarbeitung des Formulars kannst du einen redirect auf die URL des nächsten Formulars anstoßen.

<?php
// ...

header('location:https://example.com/formular2.php');
exit;

Das wäre der einfachste Weg, wenn die Formulare unter eigenen URLs erreichbar sind.

 

Wenn alles über eine einzige URL läuft, kannst du das so machen wie du es beschrieben hast. Anhand der Parameter im Request erst erkennen welches Formular gerade verarbeitet wurde und dann entsprechend das nächste Formular includen.

Z.B. gibst du in den einzelnen Formularen eine Kennung per hidden Feld an den Request.

<form method="post" action="https://example.com/formular.php" >
  <label for="name">Name</label>
  <input type="text" name="name" id="name">
  <input type="hidden" name="formularId" value="1" />
  <input type="submit" />
</form>

Und am Ende der Verarbeitung in PHP:

<?php 
// ...
$formularId = (int) $_POST['formularId'] ?? 0;
if ($formularId === 0) {
    include '.....formular1.php';
}
if ($formularId === 1) {
    include '.....formular2.php';
}
if ($formularId === 2) {
    include '.....formular3.php';
}

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.