Forked from Jayme Brereton's Pen LpraPg.
A Pen by Indra Kurniawan on CodePen.
<?php | |
// $_GET to main key. | |
if (!empty($_GET['name'])) header('Location: '. '.?' .$_GET['name']); // rediriction $_GET's array. | |
if (!empty($_GET)) die("Hello, ". key($_GET) ."!"); // print end exit the process. | |
?> | |
<form method="get"><input type="text" name="name" placeholder="Enter your name..." required></form> |
Forked from Jayme Brereton's Pen LpraPg.
A Pen by Indra Kurniawan on CodePen.
<?php | |
# Dibuat pada 15 November 2015. | |
# Untuk pempelajaran WebProgramming IKSR 2015-2016. | |
# Coded by @IndraKaw. | |
// Fungsi pangkat x^n | |
function pangkat($nilai, $pangkat) { | |
$hasil = 1; | |
for ($i=1; $i <= $pangkat; $i++) { | |
$hasil=$hasil*$nilai; |
<?php | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
A very simple PHP Validation.
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
<h1>Put this file anywhere.</h1> | |
<pre>Print server Variable: | |
<?php print_r($_SERVER); ?></pre> | |
<pre>Print base dir of this file: | |
<?php | |
$protocol = 'http://'; | |
$host = $_SERVER['HTTP_HOST']; | |
$file = $_SERVER['SCRIPT_NAME']; | |
// $baseDir = $protocol.$host.str_replace(basename($file), "", $file); |
<?php | |
/** | |
* Git Helper | |
* | |
* This file contains set of functions that returns git's metadata. | |
* It doesn't perform git operation; read then pharse only. | |
* | |
* LIMITATION: this function only read local object (branch, tag). | |
* You have to fetch remote object first (eg. `git fetch --all`). | |
* Best use on shared web hosting and enviorment with exploitable |
#!/usr/bin/env ruby | |
# You have to install "vagrant-vbguest" to get it works | |
# $ vagrant plugin install vagrant-vbguest | |
VAGRANTFILE_API_VERSION = '2' | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "debian/stretch64" | |
config.vm.network "private_network", ip: "192.168.33.230" |