[xyz-ips snippet=”php”]
<?php
// تحقق مما إذا تم إرسال النموذج
if (isset($_POST[‘note’])) {
// احصل على الملاحظة
$note = $_POST[‘note’];
// أضف الملاحظة إلى القائمة
$notes[] = $note;
// احفظ الملاحظات
file_put_contents(‘notes.txt’, json_encode($notes));
}
// احصل على الملاحظات المحفوظة
$notes = json_decode(file_get_contents(‘notes.txt’));
// اعرض الملاحظات
foreach ($notes as $note) {
echo ‘<li>’ . $note . ‘</li>’;
}
?>