Skip to content

Instantly share code, notes, and snippets.

View malikkurosaki's full-sized avatar
💭
flutter on fire

malik kurosaki malikkurosaki

💭
flutter on fire
View GitHub Profile
@malikkurosaki
malikkurosaki / show-table.php
Created February 13, 2018 03:52
show all table name from database
<?php
requere("../core/connaect.php"); // connetion of database "host,user,pass,db" wrap as $con;
$query = "SHOW TABLES FROM mydb"; // the query
$result = mysqli_query($con,$query); // check is database have table
if($result){
echo "ok";
$rows = mysqli_fetch_all($result); // fetch all
print_r($rows); //output name of tables
@malikkurosaki
malikkurosaki / create-table.php
Created February 13, 2018 04:12
mysqli create table if not axists
<?php
require("../core/connect.php");
$fwrirte = "CREATE TABLE IF NOT EXISTS mytable(name VARCHAR(100) NOT NULL)";
$result = mysqli_query($con,$fwrirte);
if($result){
echo "<br>table dibuat";
}else{
echo $con->error;
}
@malikkurosaki
malikkurosaki / check-table.php
Created February 13, 2018 04:58
check if table name exist or not exist
<?php
require("../core/connect.php");
$query = "SELECT * FROM tablename";
$result = mysqli_query($con,$query);
if($result){
echo "table name is exist";
}else{
echo "table name is not exist";
}
@malikkurosaki
malikkurosaki / editor.php
Created February 17, 2018 10:41
create super simple text editor use content editeble and javascript
<div id='edit' >edit jjjjjjjj kkkjmlmlkmlkml klknklnkn<div id="saya">saya</div> <div id="apa">apanya</div></div>
<button id="rubah">rubah</button>
<div id="result">ini hasil</div>
<script>
var edit = document.getElementById("edit");
var rubah = document.getElementById("rubah");
var result = document.getElementById("result");
edit.contentEditable = "true";
@malikkurosaki
malikkurosaki / get_id.html
Created February 18, 2018 01:18
get id of element when on click
<div di="container">
<div id="a">this is a</d>
<div id="b">this is b</d>
<div id="c">this is c</d>
<div id="d">this is d</d>
<div id="e">this is e</d>
<div id="f">this is f</d>
<div id="g">this is g</d>
<div id="h">this is h</d>
<div id="i">this is i</d>
@malikkurosaki
malikkurosaki / fix-ssl-error.php
Created March 7, 2018 05:23
howto upload youtube direcly from derver
<?php
//is ssl get error just fix it and replace with this code
namespace GuzzleHttp\Handler;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Promise\RejectedPromise;
use GuzzleHttp\Psr7;
@malikkurosaki
malikkurosaki / download.php
Created March 7, 2018 10:11
download youtube video to server
<?php
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed)\/))([^\?&\"'>]+)/","https://www.youtube.com/watch?v=W8drxRl1fiY",$gtlk);
//echo $gtlk[1];
$fg = file_get_contents("https://www.youtube.com/get_video_info?video_id=".$gtlk[1]."&cpn=CouQulsSRICzWn5E&eurl&el=adunit");
$xp = explode(",",$fg);
parse_str($xp[0],$rst);
$url = $rst['url_encoded_fmt_stream_map'];
parse_str($url,$hasil);
echo $judul = $rst['title']; //get title
echo "<br><hr>";
@malikkurosaki
malikkurosaki / download.php
Created March 11, 2018 03:06
get video id and search video id to get video source link of youtube video
<?php
/*
name : download youtube video
author : malik kurosaki
contact : wa 081338929722
description : after get id (video from yotube url) direct to get link of video source than save it to serveer
use file_put_contents
*/
if(isset($_GET['dl'])){
@malikkurosaki
malikkurosaki / index.php
Created March 11, 2018 03:08
interface youtube search for creative common , type video max result and key search
<?php
session_start();
/*
name : lazy yutube
author : malik kurosaki
licency : public opensource
description : aplikasi ini saya buat karena saya pemalas dan menunggu para pemalas pemalas yang lain untuk membuat aplikasi lainnya
untuk menunjang dan mempermudah bagi kegiatan pemalas pemalas lainnya
silahkan join jika memang anda seorang pemalas
@malikkurosaki
malikkurosaki / upload.php
Created March 11, 2018 03:09
direct upload from server to youtube channel use youtube api v3
<?php
include_once "auth.php";
if(isset($_GET['u'])){
$vTitle = $_GET['u'];
$tTitle = str_replace("/"," ",$vTitle);
$t1 = $_GET['t1'];
$t2 = $_GET['t2'];
$dcs = $_GET['dcs'];
if ($client->getAccessToken()) {