Hallo Leute,
Ich habe eine HTML-Seite mit einer Form in dieser Struktur:
Spoiler anzeigen
Und bei action wird im Moment ein anderes PHP-Script aufgerufen, welches SQL-Abfragen und Einträge vornimmt. Wenn dabei ein Fehler entsteht soll ein Text in der Form ausgegeben werden. Wie könnte ich das realisieren ? Den Fehler in die Session schreiben ? Den PHP-Code direkt in action="...." ? Oder Den PHP-Code direkt am Anfang der HTML-Seite, aber dann wird der Code immer ausgeführt und der Text ist oben in der Seite. Wenn ich das PHP in die Form mach', geht es übrigens nicht mehr richtig.
Danke schon mal im Vorraus
Ich habe eine HTML-Seite mit einer Form in dieser Struktur:
HTML-Quellcode
-
- <form class="register" action="scripts/registrate.php" method="post">
- <span class="regtext">Nutzername:</span>
- <input class="reginput" name="username" placeholder="Sein Nutzername">
- ...
- <button type="submit" class="submit" onclick="return confirm('Wollen Sie wirklichen diesen Benutzer registrieren ?')">Registrieren</button>
- </form>
Und bei action wird im Moment ein anderes PHP-Script aufgerufen, welches SQL-Abfragen und Einträge vornimmt. Wenn dabei ein Fehler entsteht soll ein Text in der Form ausgegeben werden. Wie könnte ich das realisieren ? Den Fehler in die Session schreiben ? Den PHP-Code direkt in action="...." ? Oder Den PHP-Code direkt am Anfang der HTML-Seite, aber dann wird der Code immer ausgeführt und der Text ist oben in der Seite. Wenn ich das PHP in die Form mach', geht es übrigens nicht mehr richtig.
Danke schon mal im Vorraus
Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von „xd-franky-5“ ()