Selamat Datang
blog ini sekedar kumpulan" yang tidak bisa ku ingat seluruhnya,
makanya dibuat dlm tulisan.
produk
Friday, September 26, 2008
Wednesday, September 17, 2008
Monday, September 15, 2008
php spesific your include folder
/*
spesific your include folder
author bageer83@yahoo.co.id
20080913
using for minimalize broken include or include from other places
@$incpath=name your spesific folder
@$file=name file on your spesific folder
map folder
root
includefile
header.php
foother.php
mod
aa.php
incbaru
baru.php
this.php
lain.php
*/
function myInclude($file,$incpath=""){
$incpath="includefile/".$incpath."/";
$true_inc_reff=1;
ini_set("include_path",$incpath);
if(file_exists($incpath.$file)&&(!ereg("http://",$incpath))){
include($file);
}else{
$file=str_replace(".php","",$file);
echo "Sorry \"".$file."\" : not exist"."<br>";
}
$true_inc_reff=0;
}
myInclude("header.php"); /*path of haeder.php : includefile/header.php*/
myInclude("mod/aa.php"); /*path of aa.php : includefile/mod/aa.php*/
myInclude("lain.php","../");/*path of lain.php : lain.php*/
myInclude("baru.php","../incbaru");/*path of lain.php : incbaru/baru.php*/
myInclude($_REQUEST['c'].".php",$_REQUEST['s']); /*?s=mod&c=aa : includefile/mod/aa.php*/
myInclude($_REQUEST['c'].".php",$_REQUEST['s']); /*?s=http://localhost/&c=test will failed*/
myInclude("http://localhost/index.php",""); /*will failed*/
myInclude("index.php","http://localhost/"); /*will failed*/
myInclude("foother.php"); /*path of haeder.php : includefile/header.php*/
#aa.php
/*
first time, checking refferer include
if($true_inc_reff==0){die("failed reff");}
*/
?>
bg83
Friday, September 12, 2008
hitung hari pake pg
function hithari($date){
global $dbconn;
$sql="select TIMESTAMP '$date'-CURRENT_DATE";
$rs=pg_query($dbconn,$sql);
$row=pg_fetch_array($rs);
$d=str_replace("days","",$row[0]);
$d=str_replace("day","",$d);
$d=trim($d);
return $d;
}
pake php langsung gmna ya????
bg83