![]() |
VOOZH | about |
In this article, we are going to learn concepts of database, how to make a simple game using PHP and MySQL, how can we implement a database in which we send secret messages for a particular user, how to arrange tables in the database and Also we learn some security issues that how can we save our web apps from these security issues.
Domain: Web application using PHP and MySQL database.
Features:
It is a simple game in which users send secret messages for a particular user by using a link. Through this game we learn a lot of things like how to sign up and login to a user by creating a session and destroying session, How can we store data of users and secret messages in the database for a particular user who has created a link for his name.
Tools and Technologies:
Front-End:
Back-End:
Tools:
Project Implementation: Make an empty Folder and create files According to this File structure
Assets folder: First, let us start from the assets folder. So we create this folder because of assets that we use in a project like images, videos, global CSS, and js file which is attached to all files in our project. we also create an index.php file for all folders because if someone is trying to access this folder then he sees only an index page not our directory
if index.php file is not created then anyone can see our file structure of the whole project
Utils Folder - make filename as protectXss.php - This file is Basically used to protect our web App from Cross-Site Scripting attacks.
Partials Folder and make files according to file structure as shown:
Inside the partials folder make a folder named as modals to place all modals in it
Source Code
Root Folder: Make files according to this structure.
Filename - index.php
Create index.php which is the main page of the web app. In this page, we are creating a form that takes the name of the user as input to start the game.
We are creating this file for seeing messages that are come from other users and providing username and password to the signup user. Along with the username and password a link is also provided so that the signup user shares it with others and others send him anonymous messages.
We are creating this file for URL which we provided to our sign up users so that they share that URL with their friends and directing friends to this file using that URL
To logout users and destroying sessions.
Database: Start XAMP Server
Go to browser and type in the addressbar
Go to phpmyadmin and create a new database named as "anonymousdb"
Make tables according to this below structures shown
To make a column unique click on "more" near "drop" and select "unique"