Single Page Password Protection problem
Posted: Tue Aug 26, 2025 3:22 pm
I'm using CRUD to edit a CSV file on https://donjohnson24.co.uk/availdogs.php
and would like to password protect just this page
However when the page is loaded I get the message
Notice: session_start(): A session had already been started - ignoring in /home/updwk6ykpahr/public_html/availdogs.php on line 7
at the top of the screen
If I ignore this and enter the appropriate password, the required page opens, but with the error message still at the top
If I close the page, and re-open it (on the same PC) the password entry screen does not appear and the page opens immediately
I assume this is because the page itself is php not html, and the password function is using php as well
If I use javascript instead of php, the page that opens after entering the password (without any error message) looks like this ??
csv_filename = 'Availz.csv'; $csv_edit->csv_delimiter = ','; $csv_edit->csv_enclosure = '"'; $csv_edit->csv_escape = "\\"; $csv_edit->csv_fields = ['0' => ['title' => 'Title', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '1' => ['title' => 'Start Date', 'placeholder' => 'Start Date', 'type' => 'editbox', 'required' => true, 'listview' => true, 'maxlength' => ''], '2' => ['title' => 'Start Time', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '3' => ['title' => 'End Date', 'placeholder' => 'End Date', 'type' => 'editbox', 'required' => true, 'listview' => true, 'maxlength' => '20'], '4' => ['title' => 'End Time', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '5' => ['title' => 'Colour', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '6' => ['title' => 'URL', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => '']]; $csv_edit->items_per_page = 10; $csv_edit->labels['add_record'] = 'Add Record'; $csv_edit->labels['reset_search'] = 'Reset search'; $csv_edit->labels['search'] = 'Search'; $csv_edit->labels['cancel'] = 'Cancel'; $csv_edit->labels['save'] = 'Save'; $csv_edit->labels['saved'] = 'Saved'; $csv_edit->labels['delete'] = 'Delete'; $csv_edit->labels['edit'] = 'Edit'; $csv_edit->labels['copy'] = 'Copy'; $csv_edit->labels['action'] = 'Action'; $csv_edit->labels['deleted'] = 'Deleted'; $csv_edit->labels['previous'] = 'Previous'; $csv_edit->labels['next'] = 'Next'; $csv_edit->labels['ok'] = 'OK'; $csv_edit->labels['no_results'] = 'No result'; $csv_edit->labels['error_validate'] = 'Please complete required fields => '; $csv_edit->Render(); ?>
The password is Scramble at the moment
Can I amend something to solve this?
BTW I'm keeping the Forum busy with this latest little task, and I do appreciate any help
and would like to password protect just this page
However when the page is loaded I get the message
Notice: session_start(): A session had already been started - ignoring in /home/updwk6ykpahr/public_html/availdogs.php on line 7
at the top of the screen
If I ignore this and enter the appropriate password, the required page opens, but with the error message still at the top
If I close the page, and re-open it (on the same PC) the password entry screen does not appear and the page opens immediately
I assume this is because the page itself is php not html, and the password function is using php as well
If I use javascript instead of php, the page that opens after entering the password (without any error message) looks like this ??
csv_filename = 'Availz.csv'; $csv_edit->csv_delimiter = ','; $csv_edit->csv_enclosure = '"'; $csv_edit->csv_escape = "\\"; $csv_edit->csv_fields = ['0' => ['title' => 'Title', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '1' => ['title' => 'Start Date', 'placeholder' => 'Start Date', 'type' => 'editbox', 'required' => true, 'listview' => true, 'maxlength' => ''], '2' => ['title' => 'Start Time', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '3' => ['title' => 'End Date', 'placeholder' => 'End Date', 'type' => 'editbox', 'required' => true, 'listview' => true, 'maxlength' => '20'], '4' => ['title' => 'End Time', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '5' => ['title' => 'Colour', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => ''], '6' => ['title' => 'URL', 'placeholder' => '', 'type' => 'editbox', 'required' => false, 'listview' => true, 'maxlength' => '']]; $csv_edit->items_per_page = 10; $csv_edit->labels['add_record'] = 'Add Record'; $csv_edit->labels['reset_search'] = 'Reset search'; $csv_edit->labels['search'] = 'Search'; $csv_edit->labels['cancel'] = 'Cancel'; $csv_edit->labels['save'] = 'Save'; $csv_edit->labels['saved'] = 'Saved'; $csv_edit->labels['delete'] = 'Delete'; $csv_edit->labels['edit'] = 'Edit'; $csv_edit->labels['copy'] = 'Copy'; $csv_edit->labels['action'] = 'Action'; $csv_edit->labels['deleted'] = 'Deleted'; $csv_edit->labels['previous'] = 'Previous'; $csv_edit->labels['next'] = 'Next'; $csv_edit->labels['ok'] = 'OK'; $csv_edit->labels['no_results'] = 'No result'; $csv_edit->labels['error_validate'] = 'Please complete required fields => '; $csv_edit->Render(); ?>
The password is Scramble at the moment
Can I amend something to solve this?
BTW I'm keeping the Forum busy with this latest little task, and I do appreciate any help