Skip to content

Latest commit

 

History

History
177 lines (127 loc) · 6.81 KB

README.md

File metadata and controls

177 lines (127 loc) · 6.81 KB

CONTENTS:

Update

1:15 AM 03/22/2023 (Indonesia)

    1. Fix bug SQLI
      // Tambahkan data video ke database
      # $conn = mysqli_connect("localhost:8080", "root", "root", "stream");
      $query = "INSERT INTO videos (name, path, expiration) VALUES ('$fileName', '$uploadPath', '$expiration')";
      mysqli_query($conn, $query);

Fix Bug In Here

    1. Fix Bug XSS
      # var_dump($conn);

      echo "Video berhasil diunggah dan akan dihapus dalam 7 hari.";
      echo "Video ada di: " . $uploadPath;

Fix Bug In Here

    1. Fix Bug Path Traversal
      // Menentukan path untuk menyimpan video
      $uploadPath = 'output/' . $fileName;

      // Pindahkan file video yang diupload ke folder uploads
      move_uploaded_file($_FILES['video']['tmp_name'], $uploadPath);

Fix Bug In Here

    1. Fix Bug Use of Hardcoded Credentials
<?php

$conn = mysqli_connect("127.0.0.1", "root", "root", "stream"); # IP, Username, Password, Databases
?>

Fix Bug In Here

if (copy($uploadPath, $streamPath)) {
          echo "File berhasil diupload: <a href='output/$fileName'>Download</a> | <a href='output/stream.php?file=$fileName' target='_blank'>Streaming</a>";

fix bug here

    1. fix Bug path traversal
      if (move_uploaded_file($_FILES['video']['tmp_name'], $uploadPath)) {
        if (copy($uploadPath, $streamPath)) {

fix bug here

    1. Fix Bug Xss
<body>
  <video controls autoplay>
    <source src="<?php echo 'streaming/' . $_GET['file']; ?>" type="video/mp4">

Fix Bug in here

Upload Video With XAMPP, Mysql, HTML & PHP

how to upload and stream video using xampp and mysql

INDONESIA

  • Pertama-tama, pastikan bahwa server MySQL sudah berjalan di XAMPP.

  • Buka command prompt atau terminal, lalu jalankan perintah berikut untuk masuk ke shell MySQL: mysql -u root -p

  • Setelah itu, ketik perintah berikut untuk membuat database baru: CREATE DATABASE stream;

  • Setelah itu, Buat table videos pada databases stream

  • Command MySQL untuk membuat table videos

CREATE TABLE videos (
    id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    path VARCHAR(255) NOT NULL,
    expiration DATE NOT NULL
);

Jika kalian malas untuk membuat databases stream beserta tabelnya, saya sudah Mengekspor tabel dari basis data "stream" yang saya buat

ada disini

jika kalian ingin mendownload repositori ini, klik ini

English

  • First of all, make sure that the MySQL server is already running on XAMPP.

  • Open a command prompt or terminal, then run the following command to enter the MySQL shell: mysql -u root -p

  • After that, type the following command to create a new database: CREATE DATABASE stream;

  • After that, create a videos table in the stream databases.

  • MySQL command to create the videos table

CREATE TABLE videos (
    id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    path VARCHAR(255) NOT NULL,
    expiration DATE NOT NULL
);

If you are too lazy to create a stream database with tables, I have exported the tables from the "stream" database that I created.

in here

if you want to download this repository, click this

CATATAN

CATATAN: UNTUK MENJALAKANNYA, DOWNLOAD REPOSITORY INI DAN MASUKAN KE DALAM FOLDER/LOKASI C:\xampp\htdocs\ SETELAH ITU BUKA XAMPP DAN NYALAKAN INI (APACHE & MYSQL)

gambar

Tekan ini Untuk mendownload XAMPP

Oh iya, untuk XAMPP ini username adalah root dan password adalah kosong

NOTES

NOTES: TO DO IT, DOWNLOAD THIS REPOSITORY AND INSERT IT INTO THE FOLDER/LOCATION C:\xampp\htdocs\ AFTER THAT OPEN XAMPP AND TURN ON THIS (APACHE & MYSQL)

gambar

Press this to download XAMPP

Oh yes, for this XAMPP username is root and password is blank

IMAGES / GAMBAR

gambar

gambar

gambar

gambar

gambar

If User Choice Download

gambar

if user choice streaming

gambar