Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

fazategarb/crud-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♾️ CRUD with Security Function ♾️

This project demonstrates basic CRUD (Create, Read, Update, Delete) operations in a simple website and applications with security management in session.

💫 Tabel of Content

📝 About the Project

This application provides a basic structure to perform CRUD operations for managing data.

  • Create: Add new data

  • Read: View data

  • Update: Modify existing data

  • Delete: Remove data

And using session protocol to protect the connections

🎯 Requirements

Make sure you have the following here:

  • Program Languages (e.g, PHP, mySQL)
  • Code Editor (e.g, Visual Studio Code, Sublime Text)
  • Web Server (e.g, XAMPP)
  • Web Browser (e.g, Google Chrome, Firefox, Edge)
  • Database (default: phpMyAdmins)

🪄 Tutorials

Follow the following command in here:

Configure XAMPP and MySQLi

  1. Open your XAMPP (suggest: Run in Administrator)

xampp

  1. Start the Apache and MySQL options

  2. In MySQL option, click the Admin to access phpMyAdmins pages

phpMyAdmins

  1. Browse Database and Create Database

  2. Create Table login and profil

-- Table Login
CREATE TABLE 'login' (
    'id' INT(11) NOT NULL, --primary key --auto_increment
    'username' VARCHAR(50) NOT NULL,
    'password' VARCHAR(100) NOT NULL
)
-- Table profil
CREATE TABLE 'profil' (
    'id' INT(11) NOT NULL, -- primary key --auto _increment
    'nama' VARCHAR(100) NOT NULL,
    'email' VARCHAR(100) NOT NULL,
    'nomor' VARCHAR(20) NOT NULL,
    'asal' VARCHAR(50) NOT NULL
)
  1. Insert Table login with admin user
INSERT INTO 'login' ('id', 'username', 'password') 
VALUES ('1', '{your_username}', '{your_password}')
  • opsional to insert table profile:
INSERT INTO 'profil' ('id', 'nama', 'email', 'nomor', 'asal') 
VALUES ('1', '{yourname}', '{your_email}', '{nomor}', '{asal}')
  1. Download ZIP this repo. and extract into C://xampp/htdoc/{paste_here}. you can speciality to edit files from your Code Editor.

  2. I mentions in db.php you might need to update.

<?php
// if you have hostname, username, password.
// you can change that to your code here

$hostname = "localhost"; 
$username = "root";
$password = "";
$dbname = "{yourDatabaseName}";

$conn = new mysqli($hostname, $username, $password, $dbname);

// Check the error
if ($conn->connect_error){
    die("Connection error: ". $conn->connect_error);
}
  1. Congrats and enjoy. keep learning!!

🏃‍♂️ Usage

To run this project, Open your web browser and type: localhost/{your_path_directory}

  • Login Pages login.php

loginpage

  • Create tambah.php

createpage

  • Read index.php

readpage

  • Update edit.php

updatepage

  • Delete hapus.php

deletepage

About

Crud PHP Definition

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors