⊗ppPmRdFSS 411 of 447 menu

Success Messages on Form Submission in PHP

Let's now make it so that after the redirect to the page, a message about the successful save is displayed. We will use flash messages for this:

<?php session_start(); if (!empty($_POST)) { // save to database $_SESSION['flash'] = 'form successfully saved'; header('Location: form.php'); die(); } if (isset($_SESSION['flash'])) { echo $_SESSION['flash']; unset($_SESSION['flash']); } ?>

Modify the previous task so that a message about the successful form submission is displayed on the screen.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline