Relative Content

Tag Archive for phphtmlmysql

Original Record Isn’t Reloading After Update

I have a customers page with an edit button. I can click the edit button, it loads the customers_edit.php page and I can edit the customer. When I click save, it grabs the customerID as the updateID and attempts to reload the customer_edit page with the updateID in the address bar but it gives me a “is currently unable to handle this request. HTTP ERROR 500” page. The address in the address bar is correct and if I simply click in the bar and hit enter, it loads the desired customer page. When I manually load the edit page, the edits have saved. What might I be missing here to get the page to re-load after updates on it’s own?

How to fix CSRF token validation while login: PHP and MySQL

I have built a login system for teachers and students that redirects them to the appropriate page after successful login. The user enters their username, password, and selects their account type. They can also check a “Remember Me” option to stay logged in, with the session saved for 30 days.

add 2 dates into days/weeks using php html

Good day! I have a code that needs to add 2 dates from a table and display the total(in days and weeks) on the same php table as well. How can I execute it? i have this code but it doesnt seem to do anything with the dates. my sql name of the column dates are ‘date_started’ and ‘date_completed’

edit page for dynamic menu/multi level menu (php, html)

i have created a dynamic menu page with categories, sub-categories and items that can be a part of any categories (the sub-categories can go till n-levels) these are saved in 2 tables one category [columns- id(for id of that category or sub-category), name (the category name) and parent_id(foreign key to id referencing the parent of that category in the same table, main categories are marked “NULL” for this field)] and item [columns- id , name, category_id (foreign key to id in category table)]. what i want is to create an edit page for this dynamic menu with options to edit (the name is there are typos), delete (for deleting either category or item), and add (to add category or item to anyone for the fields) and the main category (the ones whose parent_id are marked null) can be added to a category to name them a sub-category. what should be the layout and the basic idea for this to work I cant think how to address this all, i have codes )or all these functions but I dont know how to address or mark what field (category, sub-category or item) on which i want to perform these functions

How do I disable a button in a table row if the Id of the row is present in another table (PHP, SQL)

I have a mock library website for practice with a page displaying books. If a member is logged in another column adds a button to borrow the book. I want the button to be disabled/greyed if the book is already borrowed.
The ‘loan’ table includes the loanID, bookID, and memberID etc, and I want to make a statement that if the row bookID (current row in table) is present in loan table (e.g. bookID 4 is also in the loan table) then the borrow button is disabled. I have been stuck on this for a while now and I really would like some help, sorry for confusing wording.

Php variable within html input

I wrote a large registration system in html/php/mysql many years ago. I had to upgrade a lot of code when php was upgraded. I have been having issues with passing php variables in html input. A registration form is mostly painted, then just stops when it hits the statements. I will extract the salient pieces here: