Trying to get started on hopefully a simple php project

I would like to create a small php website where I can display a database on a webpage (for example, title, director, actors and etc.) for movies. I would like to be able to login and add and delete entries. There is no need for a multi user login at this time, so I am keeping it simple. I want to code this from the ground up in HTML5, php and perhaps some javascript, but if possible, I will keep away from javascript for this project. Are there any good simple or minimal examples out there that I can look at for something like this. Or are there any simple code snippets out there that I can get this up in just a few pages?

The PHP side is decently simple (given that you use proper password hashing) but the database part can be a bit tricky, as a good DB setup makes your life much much easier for the rest of the application.

There is no need for a multi user login at this time, so I am keeping it simple.

For a proper login system it doesn’t matter, if it’s a single user or not. for learning purposes go for a multi-user system, as that’s what you always have to deal with later. (you already have a database, it would be a waste to not use it for the login system)

The database can be simple with all the information on one table - film, actor etc. but it is not efficient.

What you would want is one database with multiple tables for example a movie table, an actor table and the a table linking the actor to the movie. This can start to get quite complicated but it is the best way. You need less data as you only need to have one record for a film, and one for the actor. You can then link any actor to any film.

A site called hotscripts.com used to be good for finding code but I have not used it for a while. You might be able to find something similar to what you want there and modify it. Although I find it can be hard working with other peoples code!

ok, thanks for the help. So far I got some example snippets done from w3schools. I used php procedural to set everything up. Except for a login system. After looking around, I agree to go with a multi-user to learn the right way. The Database is very simple, there is not much information. I am looking to make some forms so I can input and update data. As for the user database, I was thinking it to be separate from the main database. So back to the login system again. I am not sure how to start the login system. After some more searching, I know I need something called an Administrators Backend, so when someone goes to the main page, they see the database and when I go to for example /admin, I get a admin interface login page. The HTML5 coding is simple, so I have no problems, I also have a better interaction between html and php, but I simply don’t know how to organize the project logically.

This is what I think I need. 1 database (movies) another 1 database (users), main page from which the user will go through the database, administrator backend (where I login).

Also, these are things for me to look at after searching more: sessions, forms (input).

I definitely will be going through hotscripts.com - I had known about that, but the source list is huge.

don’t use separate databases. separate tables in the same database are sufficient and much easier to access.

That does not become a possible security issue?

Although at the moment every line you write is inevitably a possible security issue, this particular case is not. Keep all your tables in a single database.

As of the particular tables, assuming you don’t have any in your database yet, I would advise to make your first example as simple as possible - just a single table with movies and no user.

Trust me, even with one table it would be a very complicated task for you. And you better to struggle with this alone, not with a lot of problems to solve at once.

Once you get some experience with one table you may start with others.

Great, thats what I have now, so I’ getting ready to proceed to the next step.

I am afraid you don’t.

As far as I can tell, you don’t have your table any operational as you don’t have any form yet. So your task now is to write PHP codes to

  • list table entries
  • show an empty form to add a new enrty
  • insert new data into a table
  • show a form filled with one row’s data in order to update it
  • update the existing row with information from the form

that’s a lot of work alone

Upon finishing it you may want to post it here in order to get a review and some critical issues fixed.

3 Likes

Exactly what you said, I will do next.

So I said. Do this next and only then start with users, logins, multiple tables and other stuff suggested here.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.