How to post multiple rows?

<input type=”text” name=”nama[]”>
<input type=”text” name=”umur[]”>

in this case i use codeigniter framework

this is my controller

function post(){
$nama = $this->input->post(‘nama’);
$umur = $this->input->opst(‘umur’);

for($i = 0; $i < count($nama); $i++){
$for_insert = array(
array(
‘nama’ => $nama[$i],
‘umur’ => $umur[$i]
),
);
$this->save->all($for_insert);
}
}
this is my model

function all($for_insert)
{
$this->insert_batch($for_insert);
}

i hope this help who need this.

Advertisements

Cut MP3 File For Specific Time

how to install cutmp3?

cause i use arch linux, so first we install cutmp3 from AUR Arch Linux, so download from this link https://aur.archlinux.org/packages/cutmp3/

after download

$ tar xvf cutmp3.tar.gz
$ cd cutmp3
$ makepkg -ci

after installed, this do command for cut. example i want start from 21 second to 3:12 minutes

$ cutmp3 -i “namesong.mp3” -a 0:21 -b 03:12 “outputsongaftercut.mp3”

vice versa!

How to Check .htaccess Work or Not In Virtualhost

how to ?

create file .htaccess in root folder virtualhost

add this line in .htaccess

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^test\.html http://www.google.com/? [R=301,L]

and save.

now open your browser

open url like this http://virtualhost/test.html

if you hit the link, and redirect to google. your .htacccess is working.

enjoy.

link ref: http://www.qualitytuts.com/check-htaccess-is-working-or-not-on-server/