<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Web Development and Design Tutorials - dremi.info » PHP</title>
	
	<link>http://www.dremi.info</link>
	<description>Web development tutorials, including Photoshop tutorials, jQuery tutorials, PHP tutorials, JAVA tutorials, JavaScript tutorials, PSD to HTML tutorials, CSS tutorials and more. Learn how to code and design like a pro.</description>
	<lastBuildDate>Sat, 05 May 2012 15:36:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/tutorial-php" /><feedburner:info uri="tutorial-php" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:copyright>Copyright dremi.info - Semua efek, teknik, dan demonstrasi pembelajaran yang dijelaskan dalam tutorial dapat digunakan siapapun, dimanapun, dan untuk kepentingan apapun. Anda tidak diperbolehkan untuk mengkopi keseluruhan konten tutorial untuk kepentingan apapun, dalam bentuk apapun, sekalipun diterjemahkan ke dalam bahasa apapun. </media:copyright><media:thumbnail url="http://www.dremi.info/images/our-logo80.jpg" /><media:keywords>photoshop,tutorials,tutorial,php,mysql,jquery,jsp,psd,html,css,web,development,login,thickbox,lightbox,shopping,cart</media:keywords><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Education/Educational Technology</media:category><itunes:author>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</itunes:author><itunes:explicit>no</itunes:explicit><itunes:image href="http://www.dremi.info/images/our-logo80.jpg" /><itunes:keywords>photoshop,tutorials,tutorial,php,mysql,jquery,jsp,psd,html,css,web,development,login,thickbox,lightbox,shopping,cart</itunes:keywords><itunes:subtitle>Tutorial PHP - dremi.info</itunes:subtitle><itunes:summary>Tutorial Web Development dremi.info, gudangnya tutorial web advance dan basic untuk web designer dan programmer. Termasuk tutorial photoshop, PHP, jQuery, MySQL, ASP.NET, JAVA, JavaScript, JSP, CSS, PSD ke HTML, dan lainnya. Belajar bagaimana mendesain dan coding layaknya seorang professional.</itunes:summary><itunes:category text="Education"><itunes:category text="Educational Technology" /></itunes:category><item>
		<title>Installation Demo of WebSen System v.1.0.anna</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/KWt3ny2bWR8/installation-demo-of-websen-system-v-1-0-anna.html</link>
		<comments>http://www.dremi.info/articles/installation-demo-of-websen-system-v-1-0-anna.html#comments</comments>
		<pubDate>Thu, 22 Mar 2012 22:52:34 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Websen System]]></category>
		<category><![CDATA[absensi barcode]]></category>
		<category><![CDATA[aplikasi absensi web]]></category>
		<category><![CDATA[face scanner]]></category>
		<category><![CDATA[finger print]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=1418</guid>
		<description><![CDATA[Share on Facebook]]></description>
			<content:encoded><![CDATA[<p><iframe width="420" height="315" src="http://www.youtube.com/embed/QEKODqrTcFc" frameborder="0" allowfullscreen></iframe></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/installation-demo-of-websen-system-v-1-0-anna.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/installation-demo-of-websen-system-v-1-0-anna.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=1418&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/ze-yOiy4CCajODTbB6LMTkbjjWE/0/da"><img src="http://feedads.g.doubleclick.net/~a/ze-yOiy4CCajODTbB6LMTkbjjWE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ze-yOiy4CCajODTbB6LMTkbjjWE/1/da"><img src="http://feedads.g.doubleclick.net/~a/ze-yOiy4CCajODTbB6LMTkbjjWE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/KWt3ny2bWR8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/articles/installation-demo-of-websen-system-v-1-0-anna.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dremi.info/articles/installation-demo-of-websen-system-v-1-0-anna.html</feedburner:origLink></item>
		<item>
		<title>Database Configuration for MsSQL Server 2000 or higer in CakePHP 1.3.x or higher</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/rtbedEsNIgw/database-configuration-for-mssql-server-2000-or-higer-in-cakephp-1-3-x-or-higher.html</link>
		<comments>http://www.dremi.info/tutorials/php/database-configuration-for-mssql-server-2000-or-higer-in-cakephp-1-3-x-or-higher.html#comments</comments>
		<pubDate>Sun, 11 Mar 2012 14:04:33 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[mssql configuration]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=1406</guid>
		<description><![CDATA[I just found today, how to the best configuration for DBO Driver of MsSQL in CakePHP 1.3.7 First, I have try to make a connection to SQL Server 2000, 2005, and 2008. The result is always: After done for googling in few day(s), I just found a bug based on error above, in It looks [...]]]></description>
			<content:encoded><![CDATA[<p>I just found today, how to the best configuration for DBO Driver of MsSQL in CakePHP 1.3.7</p>
<p>First, I have try to make a connection to SQL Server 2000, 2005, and 2008. The result is always:</p>
<pre class="brush: xml; title: ; notranslate">
Warning (2): mssql_connect() [function.mssql-connect]: Unable to connect to server: 192.168.137.1\SQLEXPRESS,1433 [CORE\cake\libs\model\datasources\dbo\dbo_mssql.php, line 154]
Warning (2): mssql_select_db() expects parameter 2 to be resource, boolean given [CORE\cake\libs\model\datasources\dbo\dbo_mssql.php, line 159]
</pre>
<p>After done for googling in few day(s), I just found a bug based on error above, in </p>
<pre class="brush: xml; title: ; notranslate">CORE\cake\libs\model\datasources\dbo\dbo_mssql.php, line 154</pre>
<p>It looks likely, configuration is always overwrite into this line. But after read an article about port problem for mssql driver in cakephp (forgoten about where is the article link), I try to change it to port => &#8221;</p>
<p>And the result is still not connected, although I have try too in native php. And it&#8217;s works with simple line:</p>
<pre class="brush: php; title: ; notranslate">
$myServer = &quot;192.168.137.1\SQLEXPRESS&quot;; //I used sql server 2008
$myUser = &quot;sa&quot;;
$myPass = &quot;xxx&quot;;
$myDB = &quot;mesin_finger&quot;; 

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die(&quot;Couldn't connect to SQL Server on $myServer&quot;); 

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
  or die(&quot;Couldn't open database $myDB&quot;);
</pre>
<p>Next, trouble shoot continue to line before 154 in dbo_mssql.php: CORE\cake\libs\model\datasources\dbo\dbo_mssql.php</p>
<p>And the magic has come, after change $config['host'] to direct string &#8217;192.168.137.1\SQLEXPRESS&#8217;, it&#8217;s WORK!<br />
So, I just found the bug:</p>
<p>If I use $port as complete string in mssql_connect or mssql_pconnect, connection will not success, since in line 147 of dbo_mssql.php, I found this line:</p>
<pre class="brush: php; title: ; notranslate">} elseif ($config['port'] === null) {</pre>
<p>It&#8217;s mean, we must set port configuration in database.php to null, NOT IN STRING value. The option is only null and numeric value.</p>
<p>Here are my database.php configuration:</p>
<pre class="brush: php; title: ; notranslate">
var $attDbMsSqlServer = array(
                'driver' =&gt; 'mssql',
                'persistent' =&gt; false,
                'host' =&gt; '192.168.137.1\SQLEXPRESS',
                'login' =&gt; 'sa',
                'password' =&gt; 'xxx',
                'database' =&gt; 'mesin_finger',
                'prefix' =&gt; '',
                'encoding' =&gt; 'utf-8',
                'port' =&gt; null
        );
</pre>
<p>GOOD LUCK!!</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/database-configuration-for-mssql-server-2000-or-higer-in-cakephp-1-3-x-or-higher.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/database-configuration-for-mssql-server-2000-or-higer-in-cakephp-1-3-x-or-higher.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=1406&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/IXuCaVUXGyDAlT44QcKg3Vj_diQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/IXuCaVUXGyDAlT44QcKg3Vj_diQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/IXuCaVUXGyDAlT44QcKg3Vj_diQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/IXuCaVUXGyDAlT44QcKg3Vj_diQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/rtbedEsNIgw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/database-configuration-for-mssql-server-2000-or-higer-in-cakephp-1-3-x-or-higher.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/database-configuration-for-mssql-server-2000-or-higer-in-cakephp-1-3-x-or-higher.html</feedburner:origLink></item>
		<item>
		<title>Interactive Ajax Data Management with Codeigniter</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/UuDim1MTYQM/interactive-ajax-data-management-with-codeigniter.html</link>
		<comments>http://www.dremi.info/tutorials/php/interactive-ajax-data-management-with-codeigniter.html#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:58:18 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Codeigniter Academy]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[interactive ajax]]></category>
		<category><![CDATA[Interactive PHP CRUD]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=1248</guid>
		<description><![CDATA[Hi there! this is super fast tutorial, when I was take a rest at the room. Oh god, where is my cofee and PUNK music. Aha! This tutorial will show to you, how to create Interactive and very fast data management on one page together, without refreshing any page. One thing make this better &#8220;You [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://www.dremi.info/wp-content/uploads/2011/03/icon_ci_interactive.png" alt="Interactive Ajax Data Management with Codeigniter"/></p>
<p>Hi there! this is super fast tutorial, when I was take a rest at the room. Oh god, where is my cofee and PUNK music. Aha!</p>
<p>This tutorial will show to you, how to create Interactive and very fast data management on one page together, without refreshing any page. One thing make this better &#8220;You are in codeigniter class of dr.emi&#8221; So, enjoy this tutorial.</p>
<p><span id="more-1248"></span></p>
<div class="clear">&nbsp;</div>
<div id="img">
<img width="504" class="alignnone" title="Interactive Ajax: Colorbox Confirm Dialog" alt="Interactive Ajax: Colorbox Confirm Dialog" src="http://www.dremi.info/wp-content/uploads/2011/03/preview.jpg"/>
</div>
<p>First, we need some ammunition:</p>
<p>   1. Codeigniter framework<br />
   2. jQuery framework<br />
   3. Netbeans IDE<br />
   4. Colorbox jQuery plugin</p>
<h3>Part #1 Create database</h3>
<pre class="brush: sql; title: ; notranslate">
CREATE TABLE `blog` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;
</pre>
<h3>Part #2 Codeigniter configuration</h3>
<p>Open your base configuration and database configuration on folder ./application/config/</p>
<p><strong>>>> autoload.php</strong></p>
<pre class="brush: php; title: ; notranslate">
$autoload['libraries'] = array('database');
$autoload['helper'] = array('html', 'url', 'form', 'template');
$autoload['model'] = array('Blog_model');
</pre>
<p><strong>>>> database.php</strong></p>
<pre class="brush: php; title: ; notranslate">
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = 'dremi_still_here';
$db['default']['database'] = 'interactive_ajax_data_management';
</pre>
<h3>Part #3 Create Blog Controller</h3>
<p>Create new class file on <strong>./application/controllers/</strong> and save as <strong>blog.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Description of blog controller
*
* @author dr.emi
*/
class Blog extends CI_Controller {

function Blog() {
parent::__construct();
}
function index() {
$data = array(
'query' =&gt; $this-&gt;Blog_model-&gt;get_last_ten_entries()
);
$this-&gt;load-&gt;view('blog/index', $data);
}
function entries() {
$data = array(
'query' =&gt; $this-&gt;Blog_model-&gt;get_last_ten_entries()
);
$this-&gt;load-&gt;view('blog/entries', $data);
}
function form() {
$data = $this-&gt;Blog_model-&gt;current_entry();
$this-&gt;load-&gt;view('blog/form', $data);
}
function save() {
$this-&gt;Blog_model-&gt;save_entry();
}
function confirm() {
$this-&gt;load-&gt;view('blog/confirm');
}
function delete() {
$this-&gt;Blog_model-&gt;delete_entry();
}
}
</pre>
<h3>Part #4 Create Blog Model</h3>
<pre class="brush: php; title: ; notranslate">
Create new class file on &lt;strong&gt;./application/models/&lt;/strong&gt; and save as &lt;strong&gt;blog_model.php&lt;/strong&gt;

1
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Description of blog model
*
* @author dr.emi
*/
class Blog_model extends CI_Model {

function __construct() {
// Call the Model constructor
parent::__construct();
}
function get_last_ten_entries() {
$this-&gt;db-&gt;order_by(&quot;id&quot;, &quot;desc&quot;);
$query = $this-&gt;db-&gt;get('blog', 10);
return $query;
}
function save_entry() {
$tabledata = get_table_fld('blog');
$data = post2data($tabledata);
$id = store_data('blog',$data,'id');
}
function delete_entry() {
$this-&gt;db-&gt;delete('blog', array('id' =&gt; $this-&gt;uri-&gt;segment(3)));
}
function current_entry() {
// Get Table Fields
$fields = get_table_fld('blog');
$data = make_array_key($fields);

$this-&gt;db-&gt;where('id', $this-&gt;uri-&gt;segment(3));
$sql = $this-&gt;db-&gt;get('blog');
$row = (array) $sql-&gt;row();

$data = array_merge($data, $row);
return $data;
}
}
</pre>
<p>Everything is fine, if you read codeigniter user guide. I just wanna tell you about the main concept on this tutorial. So, what the next?</p>
<h3>Part #5 Create Template Helper</h3>
<p>Create new class file on <strong>./application/helpers/</strong> and save as <strong>template_helper.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author dr.emi
* @copyright 2010
*/
function get_table_fld($table) {
$_this = &amp; get_Instance();
$sql = &quot;show columns from $table &quot;;

$res = $_this-&gt;db-&gt;query($sql);
$rows = $res-&gt;result();
foreach($rows as $r){
$fld[] = $r-&gt;Field;
}
$fld = implode(';',$fld);

return ($fld);
}
function make_array_key($str) {
$ar = array();
$key = explode(';',$str);
foreach($key as $k){
$t = array($k=&gt;'');
$ar = array_merge($ar,$t);
}
return $ar;
}
function post2data($str) {
$_this = &amp; get_Instance();
$key = explode(';',$str);
foreach($key as $k){
if($_this-&gt;input-&gt;post($k)=='' ) continue;
$data[$k] = ltrim(rtrim($_this-&gt;input-&gt;post($k)));
}
return $data;
}
function store_data($table,&amp; $data,$id) {
$_this = &amp; get_Instance();
$result=0;
if($_this-&gt;input-&gt;post($id)==''){
if($_this-&gt;db-&gt;insert($table,$data)) {
//$data[$id] = mysql_insert_id();
$result = mysql_insert_id();
}
} else {
$_this-&gt;db-&gt;where($id,$_this-&gt;input-&gt;post($id));
if($_this-&gt;db-&gt;update($table,$data)) //update($table = '', $set = NULL, $where = NULL, $limit = NULL)
$result = $_this-&gt;input-&gt;post($id);
}
return $result;
}
</pre>
<h3>Part #6 Create View of blog cotroller</h3>
<p><strong>==========MAIN CONCEPT==========</strong></p>
<p>In this case, we will create it on new folder <strong>./application/view/blog/</strong></p>
<p>So, create all view into blog folder.</p>
<p>Then, we will load jQuery, colorbox, and a custom JS. Happy call the script!</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;?php echo link_tag('public/css/style.css'); ?&gt;
&lt;?php echo link_tag('public/css/colorbox.css'); ?&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/jquery.colorbox.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/custom.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Now, here is the main concept about the auto load dynamic content. We will open form, confirmation dialog, and action on one page without refresh current page. The strategy is: create two different ID on document as target. One as first init content, and the other as new content. When action is complete, we will reload the current content from entries.php file. We need, ajax jQuery here, and will show to you.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;newEntries&quot;&gt;&lt;!--NEW CONTENT HERE, AS entries.php target--&gt;&lt;/div&gt;
&lt;div id=&quot;firstEntries&quot;&gt;&lt;!--FIRST CONTENT HERE--&gt;&lt;/div&gt;
</pre>
<p>Remember, we have created function on blog controller class. So, use it! Here are the main function that will used on processing data.</p>
<p>function entries() >>> as result of table content<br />
function form() >>> as colorbox pop up content while ajax request form.php view<br />
function save() >>> as action while submit form, there are two condition: save new record and update new record<br />
function confirm() >>> as colorbox pop up content while ajax request confirm.php view<br />
function delete() >>> as action while delete record</p>
<p><strong>Part #6.A Index.php view</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo link_tag('public/css/style.css'); ?&gt;
&lt;?php echo link_tag('public/css/colorbox.css'); ?&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/jquery.colorbox.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/custom.js&quot;&gt;&lt;/script&gt;

&lt;h1&gt;Last 10 Entries&lt;/h1&gt;
&lt;a href=&quot;&lt;?php echo site_url().'/blog/form'; ?&gt;&quot; return=&quot;&lt;?php echo site_url().'/blog/entries'; ?&gt;&quot; id=&quot;popUpTrigger&quot;&gt;Insert new record&lt;/a&gt;
&lt;div id=&quot;newEntries&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;firstEntries&quot;&gt;
&lt;table width=&quot;80%&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#cecece&quot; style=&quot;margin-top: 30px;&quot;&gt;
&lt;thead style=&quot;font-weight: bold;&quot;&gt;
&lt;tr bgcolor=&quot;#ffffff&quot;&gt;
&lt;td&gt;#&lt;/td&gt;
&lt;td&gt;Title&lt;/td&gt;
&lt;td&gt;Date&lt;/td&gt;
&lt;td&gt;Action&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;?php
if ($query-&gt;num_rows() &gt; 0)
{
$i = 0;
foreach($query-&gt;result() as $row) { $i++;
?&gt;
&lt;tr bgcolor=&quot;#ffffff&quot;&gt;
&lt;td&gt;&lt;?php echo $i; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;a id=&quot;popUpEditFormTrigger&quot; return=&quot;&lt;?php echo site_url().'/blog/entries'; ?&gt;&quot; href=&quot;&lt;?php echo site_url().'/blog/form/'.$row-&gt;id; ?&gt;&quot;&gt;&lt;?php echo $row-&gt;title; ?&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $row-&gt;date; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;a id=&quot;popUpDeleteTrigger&quot; return=&quot;&lt;?php echo site_url().'/blog/entries'; ?&gt;&quot; href=&quot;&lt;?php echo site_url().'/blog/confirm/'.$row-&gt;id; ?&gt;&quot;&gt;Delete&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
} else {
?&gt;
&lt;tr bgcolor=&quot;#ffffff&quot;&gt;
&lt;td colspan=&quot;4&quot; align=&quot;center&quot;&gt;No data!&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
?&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</pre>
<p><strong>Part #6.B Form.php view</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/form.js&quot;&gt;&lt;/script&gt;

&lt;?php
echo form_fieldset('Blog form');

$hidden = array('id' =&gt; $id);
echo form_open('blog/save', 'method=&quot;post&quot; id=&quot;updateForm&quot;', $hidden);

echo form_label('Title', 'title');
echo '&lt;br /&gt;';
echo form_input('title', $title, 'id=&quot;title&quot;');
echo '&lt;hr style=&quot;color: #f1f1f1;background-color: #c0c0c0;height: 2px;&quot;&gt;';
echo form_label('Title', 'title');
echo '&lt;br /&gt;';
echo form_textarea('content', $content, 'id=&quot;content&quot;');
echo '&lt;hr style=&quot;color: #f1f1f1;background-color: #c0c0c0;height: 2px;&quot;&gt;';
echo form_button('Save', 'submit', 'id=&quot;submitForm&quot;');

echo form_close();

echo form_fieldset_close();
?&gt;
</pre>
<p><strong>Part #6.C Entries.php view</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;table width=&quot;80%&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#cecece&quot; style=&quot;margin-top: 30px;&quot;&gt;
&lt;thead style=&quot;font-weight: bold;&quot;&gt;
&lt;tr bgcolor=&quot;#ffffff&quot;&gt;
&lt;td&gt;#&lt;/td&gt;
&lt;td&gt;Title&lt;/td&gt;
&lt;td&gt;Date&lt;/td&gt;
&lt;td&gt;Action&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;?php
if ($query-&gt;num_rows() &gt; 0)
{
$i = 0;
foreach($query-&gt;result() as $row) { $i++;
?&gt;
&lt;tr bgcolor=&quot;#ffffff&quot;&gt;
&lt;td&gt;&lt;?php echo $i; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;a id=&quot;popUpEditFormTrigger&quot; return=&quot;&lt;?php echo site_url().'/blog/entries'; ?&gt;&quot; href=&quot;&lt;?php echo site_url().'/blog/form/'.$row-&gt;id; ?&gt;&quot;&gt;&lt;?php echo $row-&gt;title; ?&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $row-&gt;date; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;a id=&quot;popUpDeleteTrigger&quot; return=&quot;&lt;?php echo site_url().'/blog/entries'; ?&gt;&quot; href=&quot;&lt;?php echo site_url().'/blog/confirm/'.$row-&gt;id; ?&gt;&quot;&gt;Delete&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
} else {
?&gt;
&lt;tr bgcolor=&quot;#ffffff&quot;&gt;
&lt;td colspan=&quot;4 align=&quot;center&quot;&gt;No data!&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
?&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</pre>
<p><strong>Part #6.D Confirm.php view</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url(); ?&gt;public/js/form.js&quot;&gt;&lt;/script&gt;

&lt;h1&gt;Are you sure?&lt;/h1&gt;
&lt;p&gt;Are you sure you want to delete this record #&lt;?php echo $this-&gt;uri-&gt;segment(3); ?&gt;?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This cannot be undone!&lt;/p&gt;
&lt;input type=&quot;button&quot; id=&quot;confirmDeleteButton&quot; action=&quot;&lt;?php echo site_url().'/blog/delete/'.$this-&gt;uri-&gt;segment(3); ?&gt;&quot; value=&quot;Yes&quot;&gt;
&lt;input type=&quot;button&quot; id=&quot;cancelDeleteButton&quot; value=&quot;No&quot;&gt;
</pre>
<p>While delete link on entries row clicked, will call colorbox po pup. This pop up will request content of <strong>confirm.php</strong>, and give us two main button as choise. &#8220;Yes&#8221; if delete confirmed and &#8220;No&#8221; id delete calceled.</p>
<p>So, we need action while delete button cilicked. Here the ajax request action:</p>
<pre class="brush: jscript; title: ; notranslate">
//Handle the 'actual' delete button:
$(&quot;#confirmDeleteButton&quot;).click(function() {
var url = $(this).attr('action');
$.ajax({
type: &quot;POST&quot;,
url: url,
success: function() {
$.fn.colorbox.close();
}
});
return false;
});

//Handle the dialog cancel button:
$(&quot;#cancelDeleteButton&quot;).click(function() {
$.fn.colorbox.close();
return false;
});
</pre>
<p>And how about saving data? Don&#8217;t worry we will create this beautifull JS Code, to handle while Submit form clicked to send post data.</p>
<pre class="brush: jscript; title: ; notranslate">
var dataString = $('#updateForm').serialize();
//alert (dataString);
$.ajax({
type: &quot;POST&quot;,
url: url,
data: dataString,
success: function() {
$.fn.colorbox.close();
}
});
</pre>
<p>Before sending post data and request action URL from controller, you may create simple form validation:</p>
<pre class="brush: jscript; title: ; notranslate">
var title = $('#title');
var content = $('#content');
var url = $('#updateForm').attr('action');

if (title.val()=='') {
alert('Title field is required');
title.focus();
return false;
}
if (content.val()=='') {
alert('Content field is required');
content.focus();
return false;
}
</pre>
<p>Well, this is just a variation, your next code will better than sample above.</p>
<p><strong>OK! let&#8217;s try the result on browser. Happy coding!!</strong></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/interactive-ajax-data-management-with-codeigniter.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/interactive-ajax-data-management-with-codeigniter.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=1248&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/thXjOrcwtA5ybegn4_IDMF-f5h4/0/da"><img src="http://feedads.g.doubleclick.net/~a/thXjOrcwtA5ybegn4_IDMF-f5h4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/thXjOrcwtA5ybegn4_IDMF-f5h4/1/da"><img src="http://feedads.g.doubleclick.net/~a/thXjOrcwtA5ybegn4_IDMF-f5h4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/UuDim1MTYQM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/interactive-ajax-data-management-with-codeigniter.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/interactive-ajax-data-management-with-codeigniter.html</feedburner:origLink></item>
		<item>
		<title>Membuat Manajemen Hak Akses User dengan Codeigniter</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/pFXPPD-IR9w/membuat-manajemen-hak-akses-user-dengan-codeigniter.html</link>
		<comments>http://www.dremi.info/tutorials/php/membuat-manajemen-hak-akses-user-dengan-codeigniter.html#comments</comments>
		<pubDate>Sat, 06 Nov 2010 00:45:51 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Codeigniter Academy]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[hak akses user]]></category>
		<category><![CDATA[manajemen user]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[user access]]></category>
		<category><![CDATA[user manager]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=1215</guid>
		<description><![CDATA[malem eni gw akhirnya bisa juga nyolong2 waktu bwat nulis lagi. setelah skian lama pakum. ada tersirat, panggilan jiwa bwat nulis dan sharing lagi. setelah sekian lama males dan sibuk mncari napkah biar dapur ngebul terus. tapi setidaknya gw masih punya keinginan bwat sharing. pgimanepun, gw terlahir dari kalangan berpendidikan, orang tua gw guru smue. [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="Membuat Manajemen Hak Akses User dengan Codeigniter" src="http://www.dremi.info/wp-content/uploads/2010/11/icon_ci_user_access.png" class="imgheader"/> malem eni gw akhirnya bisa juga nyolong2 waktu bwat nulis lagi. setelah skian lama pakum. ada tersirat, panggilan jiwa bwat nulis dan sharing lagi. setelah sekian lama males dan sibuk mncari napkah biar dapur ngebul terus. tapi setidaknya gw masih punya keinginan bwat sharing. pgimanepun, gw terlahir dari kalangan berpendidikan, orang tua gw guru smue. gw masih merasa terpanggil bwat sharing dan berbagi ilmu. tanpa banyak bacot, dan masih dalam bahasa gw yang acakadut ini, kite mulai dah tutorial pertama di bulan nopember ini. haahah!! LEGEK PISAN!!<br />
<span id="more-1215"></span></p>
<div class="clear">&nbsp;</div>
<p>kali ini gw mau sharing tentang codeigniter. yey! di dremi.NET codeigniter kali ini menjadi primadona dalam projek projekna. beberapa taon lalu, gw gak sreg banged kalok make framework orang, tapi berbekal elmu dan inspirasi dari <a href="http://tfsys.net" target="_blank">mang opik</a>, hasilnya mampu membius gw bwat make ni framework di segala medan tempur yang berbau web based (PHP). cekakakak!!</p>
<p>ni tutorial bakalan ngebahas tentang pgimane mbikin user access bertingkat pada user manager di admin CMS sebagai simulasina. kalok biasana lu pada bikin CMS masih makek 1 tipe user, ada baikna lu pakein dah mulai sekarang. sbtulna script2 ini udah lama gw tanem dalam CMS, tapi beberapa client terkadang meminta bwat menghilangkan nya, yap gw sadar tidak smua client yang mau menggunakannya, mungkin karena keterbatasan nya dalam mempelajari cara penggunaannya. gw pleksibel aja, pgimane permintaan clientna dalam make user manager.</p>
<p><strong>Langkah #1 Nyiepin pael pael penting dan memahami konsepnya</strong></p>
<p>- codeigniter framework<br />
- jquery</p>
<p>Konsepnya:</p>
<p>1. User login via form login<br />
2. Masuk ke halaman admin area, dengan default data-data user<br />
3. Terdapat akses area yang di load dari table module<br />
4. User yang mendapat tipe user &#8220;1&#8243; merupakan Super Administrator dan &#8220;2&#8243; merupakan &#8220;Administrator&#8221;<br />
5. Tipe Super Administrator: dapat mengakses smua module area. Dan Administrator dapat mengakses module area sesuai hak akses yang diperoleh user yang sedang login<br />
6. Route akan digunakan dalam mengakses URL tertentu, demi keamanan<br />
7. jQuery akan digunakan bwat manggil live user access dalam form update user<br />
8. Config pada CI akan disesuaikan untuk menghandle Query Strings pada URL</p>
<p><strong><br />
Langkah #2 Buwat Database dengan table tablena</strong></p>
<pre class="brush: sql; title: ; notranslate">
CREATE TABLE `module` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`permalink` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;

INSERT INTO `module` VALUES (1, 'Posting', 'posting');
INSERT INTO `module` VALUES (2, 'Banner', 'banner');
INSERT INTO `module` VALUES (3, 'Gallery', 'gallery');
INSERT INTO `module` VALUES (4, 'File Manager', 'filemanager');

CREATE TABLE `user` (
`id` int(11) NOT NULL auto_increment,
`email` varchar(255) NOT NULL,
`password` text NOT NULL,
`user_type` int(2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

INSERT INTO `user` VALUES (1, 'dremi@ganteng.com', '5afd3f8890e535868773eb4a351489d9126613d8', 1);
INSERT INTO `user` VALUES (2, 'aku@sang.pangeran.cintah.com', '5afd3f8890e535868773eb4a351489d9126613d8', 2);

CREATE TABLE `user_access` (
`user_id` int(11) NOT NULL,
`access_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `user_access` VALUES (2, 3);
INSERT INTO `user_access` VALUES (2, 1);
</pre>
<p><strong>Langkah #3 Menyesuaikan Config Codeigniter (application/config/config.php)</strong></p>
<p>dibawah ini adalah config yang gw pake untuk menjalankan misi kita kali ini:</p>
<pre class="brush: php; title: ; notranslate">
$config['base_url'] = &quot;http://localhost/tutorial-programming/ci_class/user_manager_ci_tut/&quot;; //sesuaikan ama path di web serper lu
</pre>
<pre class="brush: php; title: ; notranslate">
$config['index_page'] = &quot;index.php/&quot;;

$config['uri_protocol'] = &quot;PATH_INFO&quot;;

$config['url_suffix'] = &quot;&quot;;

$config['language'] = &quot;english&quot;;

$config['charset'] = &quot;UTF-8&quot;;

$config['enable_hooks'] = FALSE;

$config['subclass_prefix'] = 'MY_';

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

/*PENTING BANGED*/

$config['enable_query_strings'] = TRUE;
$config['controller_trigger'] = 'x';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use

/*END OF PENTING BANGED*/

$config['log_threshold'] = 0;

$config['log_path'] = '';

$config['log_date_format'] = 'Y-m-d H:i:s';

$config['cache_path'] = '';

$config['encryption_key'] = &quot;NeO5C88iv7uo09U2E20iJFkaHJi0mPDm&quot;; //kite bakalan make library encrypt, jadi ni kudu diisi. bebas key na, tapi berjumlah 32 karakter

$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;

$config['cookie_prefix'] = &quot;&quot;;
$config['cookie_domain'] = &quot;&quot;;
$config['cookie_path'] = &quot;/&quot;;

$config['global_xss_filtering'] = FALSE;

$config['compress_output'] = FALSE;

$config['time_reference'] = 'local';

$config['rewrite_short_tags'] = FALSE;

$config['proxy_ips'] = '';
</pre>
<p>Wokeh!!!!! lanjut ke langkah berikutnya</p>
<p><strong>Langkah #4 Menyesuaikan Database Config (application/config/database.php)</strong></p>
<pre class="brush: php; title: ; notranslate">
$db['default']['hostname'] = &quot;localhost&quot;;
$db['default']['username'] = &quot;root&quot;;
$db['default']['password'] = &quot;password&quot;;
$db['default']['database'] = &quot;ci_class&quot;;
</pre>
<p><strong>Langkah #5 Menyesuaikan Autload Config (application/config/autoload.php)</strong></p>
<pre class="brush: php; title: ; notranslate">
$autoload['libraries'] = array('database', 'session', 'encrypt');

$autoload['helper'] = array('url','template','email','form');
</pre>
<p><strong>Langkah #6 Siapin Template Helper (application/helpers/template_helper.php) => berisi fungsi &#8211; fungsi bwat menghandle kebutuhan di controller maupun viewer</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php

/**
* @author dr.emi
* @copyright 2010
*/

function loginTrigger()
{
$_this = &amp; get_Instance();
if($_this-&gt;session-&gt;userdata('isLogin') == '')
{
redirect('user/login');
}
}

function CustomPassword($password)
{
$_this = &amp; get_Instance();
return sha1($password.$_this-&gt;config-&gt;item('encryption_key'));
}

function get_table_fld($table){

$_this = &amp; get_Instance();
$sql = &quot;show columns from $table &quot;;

$res = $_this-&gt;db-&gt;query($sql);
$rows = $res-&gt;result();
foreach($rows as $r){
$fld[] = $r-&gt;Field;
}
$fld = implode(';',$fld);

return ($fld);

}

function make_array_key($str){
$ar = array();
$key = explode(';',$str);
foreach($key as $k){
$t = array($k=&gt;'');
$ar = array_merge($ar,$t);
}
return $ar;
}

function post2data($str){
$_this = &amp; get_Instance();
$key = explode(';',$str);
foreach($key as $k){
if($_this-&gt;input-&gt;post($k)=='' ) continue;
$data[$k] = ltrim(rtrim($_this-&gt;input-&gt;post($k)));
}
return $data;
}

function store_data($table,&amp; $data,$id){
$_this = &amp; get_Instance();
$result=0;
if($_this-&gt;input-&gt;post($id)==''){
if($_this-&gt;db-&gt;insert($table,$data)) {
//$data[$id] = mysql_insert_id();
$result = mysql_insert_id();
}
} else {
$_this-&gt;db-&gt;where($id,$_this-&gt;input-&gt;post($id));
if($_this-&gt;db-&gt;update($table,$data)) //update($table = '', $set = NULL, $where = NULL, $limit = NULL)
$result = $_this-&gt;input-&gt;post($id);
}
return $result;
}

function delete_data($table,$key,$id)
{
$_this = &amp; get_Instance();
$_this-&gt;db-&gt;query(&quot;delete from &quot;.$table.&quot; where &quot;.$key.&quot; ='&quot;.$id.&quot;'&quot;);
}

function getFieldValue($tbl='', $field='', $param='', $value='')
{
$_this = &amp; get_Instance();
$sql = $_this-&gt;db-&gt;query(&quot;SELECT * FROM $tbl WHERE $param = '$value'&quot;);
if($sql-&gt;num_rows() !=0)
{
$r = $sql-&gt;row();
return $r-&gt;$field;
}
else
{
return false;
}
}

function getModuleAccessForm($query, $uid = '')
{
$_this = &amp; get_Instance();
$per_column = 2;
$count = 0;
$return = '';
foreach($query-&gt;result() as $row)
{
$count ++;
$return .= '&lt;div style=&quot;margin:0 10px 10px 0; float: left&quot;&gt;';
if($uid != '')
{
$sql = $_this-&gt;db-&gt;query(&quot;select * from user_access WHERE user_id = '&quot;.$uid.&quot;' AND access_id = '&quot;.$row-&gt;id.&quot;'&quot;);
if($sql-&gt;num_rows() == 1)
{
$return .= form_checkbox('module_id[]', $row-&gt;id, TRUE) . $row-&gt;name;
}
else
{
$return .= form_checkbox('module_id[]', $row-&gt;id) . $row-&gt;name;
}
}
else
{
$return .= form_checkbox('module_id[]', $row-&gt;id) . $row-&gt;name;
}
$return .= '&lt;/div&gt;';
if($count % $per_column == 0) { $return .= '&lt;div style=&quot;clear:both; height: 1px;&quot;&gt;&amp;nbsp;&lt;/div&gt;'; }
}
return $return;
}

function getModuleAccess($userID=0)
{
if($userID != 0)
{
$_this = &amp; get_Instance();
$sql = $_this-&gt;db-&gt;query(&quot;select * from user_access where user_id = '&quot;.$userID.&quot;'&quot;);
if($sql-&gt;num_rows() != 0)
{
echo &quot;&lt;ul style='margin:10px 0 0 30px;padding:0'&gt;&quot;;
foreach($sql-&gt;result_array() as $row)
{
echo &quot;&lt;li style='margin:0 0 10px 0;padding:0'&gt;&quot;.getFieldValue('module', 'name', 'id', $row['access_id']).&quot;&lt;/li&gt;&quot;;
}
echo &quot;&lt;/ul&gt;&quot;;
}
}
}

function getModuleLink()
{
$_this = &amp; get_Instance();
$sql = $_this-&gt;db-&gt;query(&quot;SELECT * FROM module ORDER BY name&quot;);
if($sql-&gt;num_rows() !=0)
{
foreach($sql-&gt;result() as $row)
{
echo anchor('admin/'.$row-&gt;permalink, $row-&gt;name) . ' | ';
}
}
else
{
return false;
}
}

function accessTrigger() {
$_this = &amp; get_Instance();
if($_this-&gt;session-&gt;userdata('level')!=1) {
$modID = getFieldValue('module', 'id', 'permalink', $_this-&gt;uri-&gt;segment(2));
$sql = $_this-&gt;db-&gt;query(&quot;select * from user_access where user_id = '&quot;.$_this-&gt;session-&gt;userdata('user_id').&quot;' AND access_id = '&quot;.$modID.&quot;' LIMIT 1&quot;);

//let's skip general access area to checked'
$skipped_area = array('','update','delete','save','access_area.php');

if($sql-&gt;num_rows() == 1 || in_array($_this-&gt;uri-&gt;segment(2), $skipped_area))
{
return true;
}
else
{
die('You don\'t have access to this area. Please contact your Super Administrator.');
}
}
}
?&gt;
</pre>
<p><strong>Langkah #7 Siapin Controller (application/controllers/)</strong></p>
<p>Disini gw gak make model, karena mnurut gw mbikin ribet aja. Jadi kebanyakan bakalan gw tulis keperluan modelnya di HELPER bwatan sndiri.</p>
<p><strong>Langkah #7.1</strong> User (application/controllers/user.php) => User login controller</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php

class User extends Controller {

function User()
{
parent::Controller();
}

function index()
{
loginTrigger();
}

function login()
{
$this-&gt;load-&gt;view('login');
}

function doLogin()
{
$email = $this-&gt;input-&gt;post('email');
$password = $this-&gt;input-&gt;post('password');

$enc_pass = CustomPassword($password);

$sql = $this-&gt;db-&gt;query(&quot;SELECT * FROM user WHERE email='&quot;.$email.&quot;' AND password='&quot;.$enc_pass.&quot;' LIMIT 1&quot;);
if($sql-&gt;num_rows() == 1)
{
$row = $sql-&gt;row();
$data = array (
'isLogin' =&gt; 'yes',
'user_id' =&gt; $row-&gt;id,
'level' =&gt; $row-&gt;user_type
);
$this-&gt;session-&gt;set_userdata($data);
redirect('admin');
}
else
{
redirect('user/login');
}
}

function doLogout()
{
$data_session = array(
'isLogin' =&gt; $this-&gt;session-&gt;userdata('isLogin'),
'user_id' =&gt; $this-&gt;session-&gt;userdata('user_id'),
'level' =&gt; $this-&gt;session-&gt;userdata('level')
);
$this-&gt;session-&gt;unset_userdata($data_session);
redirect('user/login');
}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
</pre>
<p><strong>Langkah #7.2</strong> Admin (application/controllers/admin.php) => Admin controller</p>
<p>fungsi- fungsi penting:</p>
<p>Update: satu fungsi ini bakalan menghandle form user. Trigger form nya adalah uri segment ke &#8211; 3, dengan ketentuan, kalok input user baru maka uri segment 3 kosong, sdangkan kalok mau update user dengan tujuan mengedit record, uri segment ke &#8211; 3 ini akan dikasi value berupa id record yang bersangkutan.</p>
<p>pada template_helper.php terdapat fungsi <strong>get_table_fld(), make_array_key(), post2data(), store_data(), dan delete_data()</strong></p>
<p>fungsi fungsi tersebut bakalan dibutin di cotroller admin ini, bwat mempermudah aja berok!!</p>
<p>get_table_fld() => mengambil nama nama colom pada table di database</p>
<p>make_array_key() => menyajikan hasil keluaran fungsi get_table_fld() ke dalam array</p>
<p>post2data() => mengkonvert inputan post form ke dalam data yang akan dibutuhkan saat fungsi store_data() dipanggil</p>
<p>store_data() => menyimpan data kedalam table di database, dimana sesuai trigger form yang didapat yakni jika inputan post id / sesuai key dalam table bernilai kosong, maka data akan di insert ke dalam table. sedangkan jika tidak bernilai kosong, maka record bersangkutan akan diupdate pada tablenya.</p>
<p>delete_data() => menghapus data record bersangkutan</p>
<p>setelah komentar /*MODULE ACCESS*/ pada controller dibawah ini, gw mengeksekusi beberapa baris perintah. diantaranya bwat memvalidasi jika form digunakan sebagai update data bersangkutan / input data baru.</p>
<p>semua action dalam module access ini, pada akhirnya akan menghapus record akses user sebelumnya. jika form digunakan sebagai update data bersangkutan, maka user id yang akan mengakses module diambil dari post data id user, sdangkan jika form digunakan sebagai input data baru, maka user id yang akan mengakses module diambil dari user id terakhir yang diinsert pada table user.</p>
<pre class="brush: php; title: ; notranslate">
/*MODULE ACCESS*/
if($this-&gt;input-&gt;post('id') != '')
{
$lastUserID = $this-&gt;input-&gt;post('id');
}
else
{
//get last id of user
$sqlLastUserID = $_this-&gt;db-&gt;query(&quot;SELECT * FROM user ORDER BY id DESC LIMIT 1&quot;);
$rowUserID = $sqlLastUserID-&gt;row();
$lastUserID = $rowUserID-&gt;id;
}
delete_data('user_access','user_id',$lastUserID);
</pre>
<p>berikut ini baris bwat menghandle data array dari checkbox yang bernilai module id</p>
<pre class="brush: php; title: ; notranslate">
$i=0;
foreach($this-&gt;input-&gt;post('module_id') as $mod_id)
{
$i++;
//echo $mod_id;
//let's check record of access area user. if record == 0, we will insert new access, and if &gt;= 1 let's delete the old record before then replace it with new isert record
//it's will protect user to have double or more than one access in same module

$sqlCheck = $this-&gt;db-&gt;query(&quot;SELECT * FROM user_access WHERE user_id = '&quot;.$lastUserID.&quot;' AND access_id = '&quot;.$mod_id.&quot;'&quot;);
if($sqlCheck-&gt;num_rows() == 0)
{
$this-&gt;db-&gt;query(&quot;INSERT INTO user_access(user_id, access_id) VALUES('&quot;.$lastUserID.&quot;', '&quot;.$mod_id.&quot;')&quot;);
}
else
{
delete_data('user_access','user_id',$lastUserID);
$this-&gt;db-&gt;query(&quot;INSERT INTO user_access(user_id, access_id) VALUES('&quot;.$lastUserID.&quot;', '&quot;.$mod_id.&quot;')&quot;);
}
}
</pre>
<p>Sedangkan bwat proses pergantian tipe user ke super administrator, kite perlu ngapus data aksesnya di table user_access, karena kita udah gak perlu lagi ngecek hak akses nya di table tersebut.</p>
<pre class="brush: php; title: ; notranslate">
if($this-&gt;input-&gt;post('user_type') == 1)
{
delete_data('user_access','user_id',$this-&gt;input-&gt;post('id'));
}
</pre>
<p>dan ini file controller admin selengkapna</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php

class Admin extends Controller {

function Admin()
{
parent::Controller();
loginTrigger();
accessTrigger();
}

function index()
{
$sql = $this-&gt;db-&gt;get('user');
$data = array (
'query' =&gt; $sql
);
$this-&gt;load-&gt;view('admin', $data);
}

function update()
{
// Get Table Fields
$fields = get_table_fld('user');
$data = make_array_key($fields);

$this-&gt;db-&gt;where('id',$this-&gt;uri-&gt;segment(3));
$sql = $this-&gt;db-&gt;get('user');
$row = (array) $sql-&gt;row();

//query suplied for update template
$sql = $this-&gt;db-&gt;get('module');
$data_module = array ('query' =&gt; $sql);
//end of query suplied for update template

$data = array_merge($data,$data_module,$row);

$this-&gt;load-&gt;view('admin_update',$data);
}

function save()
{
if($this-&gt;input-&gt;post('id') != '')
{
if(!valid_email($this-&gt;input-&gt;post('email')))
{
$this-&gt;session-&gt;set_flashdata('message','Valid email field required!');
redirect(&quot;admin/update/&quot;.$this-&gt;input-&gt;post('id'),301);
exit();
}
}
else
{
if(!valid_email($this-&gt;input-&gt;post('email')))
{
$this-&gt;session-&gt;set_flashdata('message','Valid email field required!');
redirect(&quot;admin/update/&quot;,301);
exit();
}
elseif($this-&gt;input-&gt;post('password') == '')
{
$this-&gt;session-&gt;set_flashdata('message','Password field required!');
redirect(&quot;admin/update/&quot;,301);
exit();
}
}
$tabledata = get_table_fld('user');
$data = post2data($tabledata);
if($this-&gt;input-&gt;post('password') != '')
{
$data['password'] = CustomPassword($this-&gt;input-&gt;post('password'));
}

$id = store_data('user',$data,'id');

/*Let's process access area module here'*/
if($this-&gt;input-&gt;post('module_id') != '')
{
/*MODULE ACCESS*/
if($this-&gt;input-&gt;post('id') != '')
{
$lastUserID = $this-&gt;input-&gt;post('id');
}
else
{
//get last id of user
$sqlLastUserID = $_this-&gt;db-&gt;query(&quot;SELECT * FROM user ORDER BY id DESC LIMIT 1&quot;);
$rowUserID = $sqlLastUserID-&gt;row();
$lastUserID = $rowUserID-&gt;id;
}
delete_data('user_access','user_id',$lastUserID);

$i=0;
foreach($this-&gt;input-&gt;post('module_id') as $mod_id)
{
$i++;
//echo $mod_id;
//let's check record of access area user. if record == 0, we will insert new access, and if &gt;= 1 let's delete the old record before then replace it with new isert record
//it's will protect user to have double or more than one access in same module

$sqlCheck = $this-&gt;db-&gt;query(&quot;SELECT * FROM user_access WHERE user_id = '&quot;.$lastUserID.&quot;' AND access_id = '&quot;.$mod_id.&quot;'&quot;);
if($sqlCheck-&gt;num_rows() == 0)
{
$this-&gt;db-&gt;query(&quot;INSERT INTO user_access(user_id, access_id) VALUES('&quot;.$lastUserID.&quot;', '&quot;.$mod_id.&quot;')&quot;);
}
else
{
delete_data('user_access','user_id',$lastUserID);
$this-&gt;db-&gt;query(&quot;INSERT INTO user_access(user_id, access_id) VALUES('&quot;.$lastUserID.&quot;', '&quot;.$mod_id.&quot;')&quot;);
}
}
}
##remove access rule to set all access trigger (set user as super administrator)##
if($this-&gt;input-&gt;post('user_type') == 1)
{
delete_data('user_access','user_id',$this-&gt;input-&gt;post('id'));
}
/*end of access area module*/

$this-&gt;session-&gt;set_flashdata('message','Data has been Updated/Saved Successfull!');

redirect(&quot;admin&quot;,301);
}

function delete()
{
delete_data('user','id',$this-&gt;uri-&gt;segment(3));
$this-&gt;session-&gt;set_flashdata('message','Data has been Deleted Successfull!');
redirect(&quot;admin&quot;,301);
}

/*Let's create sample of access area'*/
function banner()
{
$this-&gt;load-&gt;view('dummy');
}

function filemanager()
{
$this-&gt;load-&gt;view('dummy');
}

function gallery()
{
$this-&gt;load-&gt;view('dummy');
}

function posting()
{
$this-&gt;load-&gt;view('dummy');
}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
</pre>
<p><strong>Langkah #7.3</strong> Access (application/controllers/access.php) => Access controller</p>
<p>controller ini berfungsi bwat menghadle live user access pada form user. agak sdikit beda pada controller ini. konsepnya kita bakalan manggil live user access berdasarkan routes config, yakni:</p>
<pre class="brush: php; title: ; notranslate">
$route['admin/access_area.php'] = &quot;access/index&quot;; //harus ditambahkan pada application/config/routes.php
</pre>
<p>kite langsung aja ke controller nya:</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php

class Access extends Controller {

function Access()
{
parent::Controller();
loginTrigger();
accessTrigger();
}

function index()
{
//get the values
$access_id = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $this-&gt;input-&gt;get('access_id'));
$uid = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $this-&gt;input-&gt;get('uid'));

$sql = $this-&gt;db-&gt;get('module');
$data = array (
'query' =&gt; $sql,
'access_id' =&gt; $access_id,
'uid' =&gt; $uid
);
$this-&gt;load-&gt;view('access', $data);
}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
</pre>
<p>baris ini bergungsi memparsing string inputan pada url:</p>
<pre class="brush: php; title: ; notranslate">
$access_id = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $this-&gt;input-&gt;get('access_id'));
$uid = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $this-&gt;input-&gt;get('uid'));
</pre>
<p>dimana access_id dan uid bernilai 0-9, yang diambil dari parameter URL <strong>admin/access_area.php?access_id={int_value}&amp;uid={int_value}</strong></p>
<p>nah, dengan menggunakan routes <strong>$route['admin/access_area.php'] = &#8220;access/index&#8221;;</strong> kita nantinya bisa ngakses URL menggunakan <strong>admin/access_area.php?access_id={int_value}&amp;uid={int_value}</strong> pada form live user access. nanti bakalan dibahas pada langkah pembuatan form user.</p>
<p>disinilah fungsinya mengenable query string dan menggunakan PATH_INFO pada sebagai uri protocol pada config.php</p>
<pre class="brush: php; title: ; notranslate">
$config['enable_query_strings'] = TRUE;

$config['controller_trigger'] = 'x';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use

$config['uri_protocol'] = &quot;PATH_INFO&quot;;
</pre>
<p>dengan demikian kita bisa mengambil parameter URL access_id dan uid</p>
<p><strong>Langkah #8 Siapin Viewer (application/views)</strong></p>
<p><strong>Langkah #8.1</strong> Login viewer (application/views/login.php) => bwat nampilin form login user</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?&gt;
&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;

&lt;head&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;dr.emi&quot; /&gt;
&lt;link href=&quot;&lt;? echo base_url(); ?&gt;system/application/views/css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;title&gt;Login Form&lt;/title&gt;
&lt;/link&gt;&lt;/head&gt;

&lt;body&gt;

&lt;div id=&quot;stylized&quot; class=&quot;myform&quot;&gt;
&lt;form id=&quot;form&quot; name=&quot;form&quot; method=&quot;post&quot; action=&quot;&lt;?php echo site_url(); ?&gt;user/doLogin&quot;&gt;
&lt;h1&gt;Sign-in form&lt;/h1&gt;
&lt;p&gt;Silakan login untuk mengakses user manager&lt;/p&gt;

&lt;label&gt;Email&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; class=&quot;input&quot; /&gt;

&lt;label&gt;Password&lt;/label&gt;
&lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; class=&quot;input&quot; /&gt;

&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Sign-in&quot; class=&quot;submit&quot; /&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;

&lt;/form&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Langkah #8.2</strong> Admin viewer (application/views/admin.php) => bwat nampilin data data user</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?&gt;
&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;

&lt;head&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;dr.emi&quot; /&gt;
&lt;link href=&quot;&lt;? echo base_url(); ?&gt;system/application/views/css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;title&gt;Admin Area&lt;/title&gt;
&lt;/link&gt;&lt;/head&gt;

&lt;body&gt;

&lt;h3&gt;&lt; ?php echo anchor('user/doLogout', 'Sign-out'); ?&gt; | &lt; ?php echo anchor('admin', 'User Manager'); ?&gt; | &lt; ?php getModuleLink(); ?&gt;
&lt;/h3&gt;
&lt;p&gt;&lt; ?php echo anchor('admin/update', '+ Add New Data'); ?&gt;&lt;/p&gt;
&lt; ?php if($this-&gt;session-&gt;flashdata('message') != '') { echo '&lt;p style=&quot;color:green&quot;&gt;'.$this-&gt;session-&gt;flashdata('message').'&lt;/p&gt;'; } ?&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; bgcolor=&quot;gray&quot;&gt;
&lt;tr bgcolor=&quot;silver&quot;&gt;
&lt;td&gt;No.&lt;/td&gt;
&lt;td&gt;Email&lt;/td&gt;
&lt;td&gt;Access Area&lt;/td&gt;
&lt;td&gt;Option&lt;/td&gt;
&lt;/tr&gt;
&lt; ?php
$i = 0;
foreach($query-&gt;result() as $row)
{
$i++;
?&gt;
&lt;tr bgcolor=&quot;white&quot;&gt;
&lt;td&gt;&lt; ?php echo $i; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt; ?php echo $row-&gt;email; ?&gt;&lt;/td&gt;
&lt;td&gt;
&lt; ?php
if($row-&gt;user_type == 1)
{
$hakAkses = 'Super Administrator';
}
else
{
$hakAkses = 'Administrator';
}
?&gt;
&lt;h4&gt;&lt; ?php echo $hakAkses; ?&gt;&lt;/h4&gt;
&lt; ?php getModuleAccess($row-&gt;id); ?&gt;
&lt;/td&gt;
&lt;td&gt;
&lt; ?php echo anchor('admin/update/'.$row-&gt;id, 'Edit'); ?&gt;
&lt;a href=&quot;javascript: void(0);&quot; onclick=&quot;cf=confirm('Click OK to delete data: &lt;?php echo &quot;No. &quot;.$i; ?&gt;');if(cf)window.location='&lt; ?php echo site_url().'admin/delete/'.$row-&gt;id; ?&gt;';return false;&quot; title=&quot;Delete &lt; ?php echo &quot;No. &quot;.$i; ?&gt;&quot;&gt;
Delete
&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt; ?php
}
?&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Langkah #8.3</strong> Admin_update viewer (application/views/admin_update.php) => bwat nampilin form user. Dimana bergungsi sebagai form input data baru dan edit data</p>
<p>Yang perlu diperhatiin adalah: penggunaan jQuery bwat mengakses live access user, konsepnya adalah: ketika user merubah pilihan pada select form Access Area maka hasil HTML akan ditampilkan pada DIV ID <strong>html_access_area</strong>javasc</p>
<p>dimana html_access_area ini berisikan checkbox data data module yang tersedia dalam table module.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function(){

$(&quot;#user_type&quot;).change(onRelectChange);
function onRelectChange(){
var pilih = $(&quot;#user_type option:selected&quot;);
if(pilih.val() != 0){
$().ajaxStart(function() {
$('#loading').show();
})
$.ajax({
type: &quot;POST&quot;,
url: &quot;&lt; ?php echo site_url(); ?&gt;admin/access_area.php?access_id=&quot;+pilih.val()+&quot;&amp;uid=&lt; ?php echo $id; ?&gt;&quot;,
success: function(data) {
//alert(pilih.val())
$(&quot;#toBeHidden&quot;).hide();
$(&quot;#html_access_area&quot;).html(data);
}
});
}
}
});
</pre>
<p>Gw perjelas lagi disni. penambahan routes $route['admin/access_area.php'] = &#8220;access/index&#8221;; berguna pada url dibawah ini:</p>
<pre class="brush: jscript; title: ; notranslate">
url: &quot;&lt; ?php echo site_url(); ?&gt;admin/access_area.php?access_id=&quot;+pilih.val()+&quot;&amp;uid=&lt; ?php echo $id; ?&gt;&quot;,
</pre>
<p>OK BRAD ??!!</p>
<p>jadi lengkapnye kayak gini:</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?&gt;
&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;

&lt;head&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;dr.emi&quot; /&gt;
&lt;link href=&quot;&lt;? echo base_url(); ?&gt;system/application/views/css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;title&gt;Admin Area &amp;radic; Update Data&lt;/title&gt;
&lt;script src=&quot;&lt;? echo base_url(); ?&gt;system/application/views/js/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){

$(&quot;#user_type&quot;).change(onRelectChange);
function onRelectChange(){
var pilih = $(&quot;#user_type option:selected&quot;);
if(pilih.val() != 0){
$().ajaxStart(function() {
$('#loading').show();
})
$.ajax({
type: &quot;POST&quot;,
url: &quot;&lt; ?php echo site_url(); ?&gt;admin/access_area.php?access_id=&quot;+pilih.val()+&quot;&amp;uid=&lt; ?php echo $id; ?&gt;&quot;,
success: function(data) {
//alert(pilih.val())
$(&quot;#toBeHidden&quot;).hide();
$(&quot;#html_access_area&quot;).html(data);
}
});
}
}
});
&lt;/script&gt;
&lt;/link&gt;&lt;/head&gt;

&lt;body&gt;

&lt;div id=&quot;stylized&quot; class=&quot;myform&quot;&gt;
&lt; ?php if($this-&gt;session-&gt;flashdata('message') != '') { echo '&lt;p style=&quot;color:red&quot;&gt;'.$this-&gt;session-&gt;flashdata('message').'&lt;/p&gt;'; } ?&gt;
&lt; ?php
$f_attributes = array('name' =&gt; 'form', 'id' =&gt; 'form');
echo form_open(site_url().'admin/save', $f_attributes);
?&gt;
&lt;input type=&quot;hidden&quot; name=&quot;id&quot; id=&quot;id&quot; value=&quot;&lt;?php echo $id; ?/&gt;&quot; /&gt;
&lt;h1&gt;User update form&lt;/h1&gt;
&lt;p&gt;Dibawah ini merupakan form update data user&lt;/p&gt;

&lt;label&gt;Email&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; class=&quot;input&quot; value=&quot;&lt;?php echo $email; ?/&gt;&quot; /&gt;

&lt;label&gt;Password
&lt;span class=&quot;small&quot;&gt;Biarkan kosong jika tidak ingin dirubah&lt;/span&gt;
&lt;/label&gt;
&lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; class=&quot;input&quot; /&gt;

&lt;label&gt;Access Area&lt;/label&gt;
&lt; ?php
$options = array(
'1' =&gt; 'Super Admin',
'2' =&gt; 'Admin'
);
$s_attributes = 'id = &quot;user_type&quot; class = &quot;input&quot;';
if($user_type == 1)
{
echo form_dropdown('user_type', $options, '1', $s_attributes);
$setAccessInfo = 'All access';
}
else
{
echo form_dropdown('user_type', $options, '2', $s_attributes);
$setAccessInfo = getModuleAccessForm($query, $id);
}
?&gt;
&lt;label&gt;Module&lt;/label&gt;
&lt;div class=&quot;loaderBlock&quot;&gt;
&lt; ?php
if($id != '')
{
?&gt;
&lt;div id=&quot;loading&quot; style=&quot;display:none&quot;&gt;&lt;em&gt;Loading...&lt;/em&gt;&lt;/div&gt;&lt;div id=&quot;toBeHidden&quot;&gt;&lt; ?php echo $setAccessInfo; ?&gt;&lt;/div&gt;&lt;div id=&quot;html_access_area&quot;&gt;&lt;/div&gt;
&lt; ?php
}
?&gt;
&lt;div id=&quot;loading&quot; style=&quot;display:none&quot;&gt;&lt;em&gt;Loading...&lt;/em&gt;&lt;/div&gt;&lt;div id=&quot;html_access_area&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Save&quot; class=&quot;submit&quot; /&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;

&lt; ?php echo form_close(); ?&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Langkah #8.4</strong> Access viewer (application/views/access.php) => bwat nampilin checkbox module akses yang di load via controller Access</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?&gt;
&lt; ?php
if($access_id != 1)
{
echo getModuleAccessForm($query, $uid);
}
else
{
echo &quot;All access&quot;;
}
?&gt;
</pre>
<p><strong>Langkah #8.5</strong> Dummy viewer (application/views/dummy.php) => ni mah bwat dummy aja, diload ketika module pada uri segment 2 diakses.</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?&gt;
&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;

&lt;head&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;dr.emi&quot; /&gt;
&lt;link href=&quot;&lt;? echo base_url(); ?&gt;system/application/views/css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;title&gt;&lt; ?php echo $this-&gt;uri-&gt;segment(2); ?&gt;&lt;/title&gt;
&lt;/link&gt;&lt;/head&gt;

&lt;body&gt;

&lt;div id=&quot;stylized&quot; class=&quot;myform&quot;&gt;
Helloo.... you are in &lt; ?php echo $this-&gt;uri-&gt;segment(2); ?&gt; area. So, you have access to do something here.
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>SEDIKIT PENJELASAN PADA FUNGSI <strong>accessTrigger()</strong> di file template_helper.php</p>
<pre class="brush: php; title: ; notranslate">
//let's skip general access area to checked'
$skipped_area = array('','update','delete','save','access_area.php');

if($sql-&gt;num_rows() == 1 || in_array($_this-&gt;uri-&gt;segment(2), $skipped_area))
{
return true;
}
else
{
die('You don\'t have access to this area. Please contact your Super Administrator.');
}
</pre>
<p>baris ini dimaksudkan, untuk menskip/mengabaikan uri segment ke 2 yang tidak dikehendaki bwat dicek sebagai module akses user</p>
<pre class="brush: php; title: ; notranslate">
$skipped_area = array('','update','delete','save','access_area.php');
</pre>
<p>kedepannya bisa lu kembangin, jadi si user bisa dibagi bagi lagi menjadi user yang bisa edit / delete saja atau cuma bisa liat data record.</p>
<p>OK BEROK!!! AYE LOM TIDUR NIH, lu pelajarin, smoga beruntung cekakakakaaka</p>
<p>KLIK DEMO DAN DOWNLOAD bwat yang berminat bwat belajar lebih lanjut.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/membuat-manajemen-hak-akses-user-dengan-codeigniter.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/membuat-manajemen-hak-akses-user-dengan-codeigniter.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=1215&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/YBTfeId9RbutKHX8W1d_7q7PDr4/0/da"><img src="http://feedads.g.doubleclick.net/~a/YBTfeId9RbutKHX8W1d_7q7PDr4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YBTfeId9RbutKHX8W1d_7q7PDr4/1/da"><img src="http://feedads.g.doubleclick.net/~a/YBTfeId9RbutKHX8W1d_7q7PDr4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/pFXPPD-IR9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/membuat-manajemen-hak-akses-user-dengan-codeigniter.html/feed</wfw:commentRss>
		<slash:comments>38</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/membuat-manajemen-hak-akses-user-dengan-codeigniter.html</feedburner:origLink></item>
		<item>
		<title>Web Base Controller System with NirCMD</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/ai23HB_eniw/web-base-controller-system-with-nircmd.html</link>
		<comments>http://www.dremi.info/tutorials/photoshop/web-base-controller-system-with-nircmd.html#comments</comments>
		<pubDate>Sat, 27 Feb 2010 23:44:38 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSS tutorials]]></category>
		<category><![CDATA[handcoded HTML]]></category>
		<category><![CDATA[network remote system]]></category>
		<category><![CDATA[nirCMD]]></category>
		<category><![CDATA[photoshop design]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[web based software]]></category>
		<category><![CDATA[windows command]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=1014</guid>
		<description><![CDATA[Prikituw!!! gw awali selamat datang dr.emi wakakakakakaka .. slamat datang kok ama diri sndiri.. hehe, gw mang dah lama ga posting tutorial baru. berkutat ama urusan sendok ama piring di dapur. wkaakak.. tapi gw pernah janji kalo bakalan exist di blog legendaris ini. ya, dremi.INFO blog pertama gw mengudara sejak 2005, uset dah! emang radio [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/img-header.jpg"/>Prikituw!!! gw awali selamat datang dr.emi wakakakakakaka .. slamat datang kok ama diri sndiri.. </p>
<p>hehe, gw mang dah lama ga posting tutorial baru. berkutat ama urusan sendok ama piring di dapur. wkaakak.. </p>
<p>tapi gw pernah janji kalo bakalan exist di blog legendaris ini. ya, dremi.INFO blog pertama gw mengudara sejak 2005, uset dah! emang radio apa&#8230; hahaaha</p>
<p>tapi sekalipun demikian, gw selalui ngikutin perkembangan pendidikan di tanah air. dan beberapa memang membuat gw geleng-geleng kepala. dari dulu ampe sekarang, tutorial yang gw jumpai, itu itu mulu. ayolah kawand, ciptakan sesuatu yang beda! biar popularitas kagak jadi tolak ukur sebuah blog. tapi kualitas nya juga donk!</p>
<p><span id="more-1014"></span></p>
<div class="clear">&nbsp;</div>
<p>woke! thanks bwat <a href="http://www.facebook.com/farisw" target="blank">faris</a>, <a href="http://www.facebook.com/profile.php?id=1284444926" target="blank">argon</a>, <a href="http://www.facebook.com/l1n6g4" target="blank">hendri lingga</a>, ama fans berat dr.emi : <a href="http://www.facebook.com/profile.php?id=1561151817" target="blank">M Firmansyah</a>, <a href="http://www.facebook.com/jatrasmara" target="blank">Black Scorpio Night</a>, <a href="http://www.facebook.com/loka.dwiartara" target="blank">Al-K</a>, <a href="http://www.facebook.com/profile.php?id=1380165259" target="blank">Ephii</a>, <a href="http://gudangbawahtanah.uni.cc/wp/index.php" target="blank">X-ZER0 a.k.a Radiaku</a>, ga lupa juga bwat om <strong>C01n</strong> yang udah lama ngilang, om ajarin gw lagi!!! <img src='http://www.dremi.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , bwat temen temen di <a href="http://www.itclublombok.org/" target="blank">ITC</a> ada <strong><a href="http://www.facebook.com/X.N1nj4.Cyb3r" target="blank">x-n1nj4</a></strong> and crew, kalian smua bikin gw tambah semangat, let&#8217;s make Lombok as one of Cyber Iland, juga bwat para member lainna yang masih mendukung gw, yang tros ngasi gw semangat. agar tetep exist di blog ini. forum gw sekalipun dah sepi, member dah pada lumpuh, gw masih punya nyali bwat nulis ni tutorial. tutorial ni bwat advance coder, gw saranin bwat nutup jendela + pintu kamar dulu dah! hihi!</p>
<p>kali ini gw mau kasi sdikit tutorial sederhana tapi berguna bwat pada developer web based, hususna bwat yang sering ngerjain aplikasi intranet. sebetulnya apa aja yang bisa dilakukan dengan aplikasi web based? banyak brur! lu kire web based cuma bisa memperindah halaman web lu di browser dowank? kagak! web based punya kemampuan lebih dari sekedar opensource. kelebihannya yang mampu berintegrasi dengan environment system, membuat gw ga ada bosen bosen nya bwat ngoprek yang namanya aplikasi web based. </p>
<p>tros mau bikin apaan mang na? ni tutorial bwat ngegambarin, gimana sih konsep/teknik mengintegrasikan web based aplication ama system/aplikasi diluarna? gw sebut aja external application. tentuna bwat tujuan tertentu ye&#8230;</p>
<p>kite bakalan belajar bijimane mengontrol system jaringan via website. kalo yang udah pernah belajar router/server, pasti familiar dengan kata&quot; remote kan? nah ni ceritanye gw mau kasi gambaran bijimane bkin remote control system via web based.</p>
<p>control system yang bakalan kite jadiin sample kasus adalah me-restart, mematikan, dan mengeksekusi perintah open dan close sebuah drive CD-ROM pada remote system. cukup tiga aja ya, sekalipun banyak macam perintah remote yang bisa lu lakuin selain 3 ntu tadi.</p>
<p>bwat ngejalanin misina, gw perlu beberapa hal kayak di bawah ini ni:</p>
<ol>
<li>Adobe photoshop, bwat ngerancang antar muka aplikasi</li>
<li>Adobe Dreamweaver, bwat editing layout antar muka aplikasi + coding na, atau kalo lu cukup mahir, gw saranin make Zend Studio bwat coding na</li>
<li>Web Server Apache + PHP 5</li>
<li>Browser apa aja</li>
<li>LAN, ni bwat ujicoba dowank, sebuah jaringan peer 2 peer juga boleh brur!</li>
<li>nirCMD, apa tuh? ni yg gw sebut sebagai external application. yang bakalan membantu kite dalam mengeksekusi perintah remote via browser.</li>
</ol>
<p>gw yakin </p>
<p>no 1-5 dah banyak yang familiar, khusus bwat no 6 bisa lu liat info selengkapna, tentang kegunaan tool yang satu ini, disini ni:</p>
<p>http://nircmd.nirsoft.net/ </p>
<p>intina <strong>nirCMD </strong>merupakan command line tool, bwat mempermudah user menggantikan perintah CMD bawaan windows, sori bwat sample na gw ambil OS na windows yak! Tapi ntar kedepanna, gw bakalan kasi juga tutorial bijimane melakukan simulasi remote sistem ini under Linux Sistem, Ubuntu misalna.</p>
<h3>Designing Interface</h3>
<p>Buka photoshop, bwat dokumen baru secukupna</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_16.jpg" width="450" height="293" /></div>
<p>bikin layer baru, pencet [CTRL+SHIFT+N], tros pencet lagi [ALT+BACKSPACE], warna na bebas dah!</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_17.jpg" width="450" height="329" /></div>
<p>baru dah kasi dikit gradasi, bisa lu donglot gradasi style na di file tutorial nyang lu plototin ini ni&#8230; kakakakaakakakw</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_18.jpg" width="450" height="328" /></div>
<p>bwat ilustrasi, lu bisa make icon bwat eksekusi perintah command na ntar. disini gw make icon bwat restart, shutdown, ama open-close CD-ROM</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_3.jpg" width="450" height="340" /></div>
<p>dengan sdikit teknik refleksi, duplikat ketiga objek diatas, tros transform vertikal ke bawah ye</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_4.jpg" width="450" height="488" /></div>
<p>kesan refleksi na gw pake cara ngapusin tu bawah ikon ikon na make eraser tool.</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_5.jpg" width="450" height="546" /></div>
<p>tros kurangin opacity icon duplikatna jadi 40%</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_6.jpg" width="450" height="333" /></div>
<p>tros lu slice dah ketiga objek ikon na</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_7.jpg" width="450" height="329" /></div>
<p>pencet [CTRL+SHIFT+ALT+S], atow lwat menu File &gt; Save for Web</p>
<p>pake settingan kayak dibwah ini</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_8-zooming.jpg" width="450" height="331" /></div>
<p>pencet Save kalo udah, option save na kayak dibwah ini</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_9.jpg" width="450" height="103" /></div>
<p>woke bruder! lu bakalan dapet gambar bwat layoutna, terakhir save as juga bwat backgroundna, lu bisa hidden layer lainna bwat nyimpen background gradasi di belakagna, ntar kite bakalan pake bwat background panel control na.</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_10.jpg" width="450" height="122" /></div>
<p>&nbsp;</p>
<h3>HANDCODED HTML+CSS</h3>
<p>lumayan bwat pemanasan, hihi&#8230;.</p>
<p>tenggak kopi lu, isep tu rokok,.. hahahahha lu buka dah dreamweaver na, bikin manajemen situs baru, di folder webserver apache lu. folderna bebas bebas aja dah, suka suka lu</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_19.jpg" width="450" height="441" /></div>
<p>woke! layout ini kayak biasa aja dah, ada HTML ama CSS na. tapi format HTML yang kite pake yakni extensi <strong>*.PHP</strong></p>
<p>ni bwat CSS na (style.css)</p>
<pre class="brush: css; title: ; notranslate">
body { font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333333; background:#FFF; margin-top:30px; padding:0; }
.float { float:left; }
#mainBox { width:504px; height:360px; margin:0 auto; background:url(../image/bg.jpg) 0 0 no-repeat; }
#panelBox { width:416px; padding-top:66px; top:66px; margin:0 auto; }
#panelBox img { border:none; }

#panelBox #restart { width:150px; height:212px; cursor:hand; cursor:auto; }
#panelBox #cd-rom { width:122px; height:212px; cursor:hand; cursor:auto; }
#panelBox #shutdown { width:144px; height:212px; cursor:hand; cursor:auto; }
</pre>
<p>dan ni HTML na (index.php)</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Web Base Controller System with NirCMD&lt;/title&gt;
&lt;link href=&quot;css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;mainBox&quot;&gt;
&lt;div id=&quot;panelBox&quot;&gt;
&lt;div id=&quot;restart&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Do you want to reboot ?');if(cf)window.location='?a=restart';return false;&quot;&gt;&lt;img src=&quot;image/restart.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;cd-rom&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;?a=cdrom&quot;&gt;&lt;img src=&quot;image/cd-rom.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;shutdown&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Do you want to turn off ?');if(cf)window.location='?a=shutdown';return false;&quot;&gt;&lt;img src=&quot;image/shutdown.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align:center;&quot;&gt;
&lt;h3&gt;Command Status disini&lt;/h3&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>ga ada pertanyaan kan? hihii.. sejauh ini editing layout nyampe sini berur! lanjot ke tahap berikutna, coding!!</p>
<p>&nbsp;</p>
<h3>HANDCODED PHP SCRIPT</h3>
<p>kalo gw c, rokona dah wabis dari tadi ni, gw sulut lagi yak!
</p>
<p>hahahha&#8230;. </p>
<p>perlu gw tegasin, sebelum membuat script berikutna, ada baikna lu buka file help penggunaan command nirCMD, dalam tutorial ini file help nirCMD dah gw sertain juga.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//directories system
define(&quot;_BASE_DIR&quot;, realpath(dirname(__FILE__)).&quot;/&quot;);
define(&quot;_ABSOLUTE_PATH&quot;, &quot;/wbcs-NirCMD/&quot;);
define(&quot;_BASE_URI&quot;, &quot;http://localhost&quot;);
define(&quot;_URL&quot;, _BASE_URI._ABSOLUTE_PATH);

//nircmd
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Windows')  !== FALSE)
{
	define(&quot;_NIRCMD_EXEC&quot;, str_replace('/', '\\', _BASE_DIR.'nircmd\nircmd.exe'));
}
else
{
	define(&quot;_NIRCMD_EXEC&quot;, str_replace('\\', '/', _BASE_DIR.'nircmd/nircmd.exe'));
}
define(&quot;_CDROM_DRIVE&quot;, &quot;&quot;); //if you don't know drive letter of remote CD-ROM, just leave empty named constant
define(&quot;_IS_REMOTE_ACTIVE&quot;, false);
define(&quot;_REMOTE_IP&quot;, &quot;192.168.1.17&quot;);
define(&quot;_COMPUTER_NAME&quot;, strtoupper(gethostbyaddr(_REMOTE_IP)));
?&gt;
</pre>
<p>pada komentar //directories system, gw tentuin definisi konstanta bwat direktori aplikasi lu di web server, disini gw make <strong>__FILE__</strong> bwat definisi <strong>_BASE_DIR</strong>, dan beberapa defini lainna</p>
<p>sedangkan pada komentar //nircmd, lu bisa liat ada defnisini <strong>_NIRCMD_EXEC</strong>, sebagai konstanta dari lokasi tool nirCMD berada, dalam konteks ini gw taro <strong>nirCMD.exe</strong> di folder nircmd</p>
<p>khusus bwat definisi <strong>_CDROM_DRIVE</strong>, <strong>_IS_REMOTE_ACTIVE</strong> dan <strong>_REMOTE_IP</strong> hanya bwat opsi tambahan aja, defaultna, lu bisa pake seperti di script atas</p>
<p>kayak psen yg gw tarok sebage komentarna //if you don&#8217;t know drive letter of remote CD-ROM bal bla&#8230;, nyang kire kire artinye, kalo lu ga tawu drive letter CD-ROM pada remote system targetna, lu boleh kosongin</p>
<p>cuma kite punya planning, kalo <strong>_IS_REMOTE_ACTIVE</strong> bernilai <strong>true</strong>, maka aplikasi akan menjalankan command untuk me-remote system dalam jaringan LAN, yakni melalui definisi <strong>_COMPUTER_NAME</strong>. disni lu bisa liat ada baris gethostbyaddr, ntu bwat mengkonvert IP menjadi nama komputer yang bakalan diremote dalam koneksi jaringan lokal.</p>
<p>tros kalo <strong>_IS_REMOTE_ACTIVE</strong> bernilai <strong>false</strong>, maka <strong>_REMOTE_IP</strong> dan <strong>_COMPUTER_NAME</strong> bakalan diabaikan nilai konstantana. ni artina, command yang akan dijalankan aplikasi hanya bwat system komputer lokal, dimana tempat lu ngetik saat ini.</p>
<p>&nbsp;</p>
<p>Nah, lanjot ye! kite bakalan bikin class baru bwat aplikasi kite, ada tiga fungsi pada class yang bakalan dipake bwat mengeksekusi perintah remote command ke system, melalui perantara nirCMD console</p>
<ul>
<li><strong>restart() </strong>bwat merestart remote system, command line yang dijalanin pada fungsi ini adalah:<br />
  <em>exitwin reboot</em>  </p>
</li>
<li><strong>shutdown()</strong> bwat men-shutdown remote system, command line na:<br />
  <em>exitwin poweroff</em></p>
</li>
<li><strong>cdrom()</strong> bwat membuka dan menutup drive CD-ROM pada remote system, command line na:<br />
    <em>cdrom open</em><br />
  <em>cdrom close</em></li>
</ul>
<p>ni script lengkap na file nircmd.php</p>
<p>bwat class baru namana, nircmd.php atau lu bisa sesuaiin dengan gaya coding lu, bisa juga make fungsi dowank.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class nircmd
{
	function alert_url($msg, $url)
	{
		$alert = &quot;&lt;script&gt;alert(\&quot;$msg\&quot;);window.location='&quot;.$url.&quot;';&lt;/script&gt;&quot;;
		return $alert;
	}
	function restart()
	{
		if(_IS_REMOTE_ACTIVE == true)
		{
			$remoteParameter = 'remote \\\\'._COMPUTER_NAME.' ';
		}
		$cmd = '&quot;'._NIRCMD_EXEC.'&quot; '.$remoteParameter.'exitwin reboot';
		$output = system($cmd);
		echo '&lt;p&gt;Command: &lt;pre&gt;'.$cmd.'&lt;/pre&gt;&lt;/p&gt;';
	}
	function shutdown()
	{
		if(_IS_REMOTE_ACTIVE == true)
		{
			$remoteParameter = 'remote \\\\'._COMPUTER_NAME.' ';
		}
		$cmd = '&quot;'._NIRCMD_EXEC.'&quot; '.$remoteParameter.'exitwin poweroff';
		$output = system($cmd);
		echo '&lt;p&gt;Command: &lt;pre&gt;'.$cmd.'&lt;/pre&gt;&lt;/p&gt;';
	}
	function cdrom()
	{
		if(!isset($_SESSION['ROMSTATUS']))
		{
			$_SESSION['ROMSTATUS'] = 'open';
			$_SESSION['ROMIMG'] = '&lt;img src=&quot;'._URL.'image/dvd_mount.png&quot;&gt;';
		}
		elseif($_SESSION['ROMSTATUS'] == 'open')
		{
			$_SESSION['ROMSTATUS'] = 'close';
			$_SESSION['ROMIMG'] = '&lt;img src=&quot;'._URL.'image/dvd_unmount.png&quot;&gt;';
		}
		elseif($_SESSION['ROMSTATUS'] == 'close')
		{
			$_SESSION['ROMSTATUS'] = 'open';
			$_SESSION['ROMIMG'] = '&lt;img src=&quot;'._URL.'image/dvd_mount.png&quot;&gt;';
		}

		if(_IS_REMOTE_ACTIVE == true)
		{
			$remoteParameter = 'remote \\\\'._COMPUTER_NAME.' ';
		}
		$cmd = '&quot;'._NIRCMD_EXEC.'&quot; '.$remoteParameter.'cdrom '.$_SESSION['ROMSTATUS'].' '._CDROM_DRIVE;
		$output = system($cmd);
		echo '&lt;p&gt;Command: &lt;pre&gt;'.$cmd.'&lt;/pre&gt;&lt;/p&gt;';
	}
}
?&gt;
</pre>
<p>khusus bwat fungsi cdrom() ada tambahan kondisi, karena kite punya dua macam perintah command bwat cdrom na, yakni open dan close CD-ROM</p>
<p>jadi kite bisa make session bwat mendeteksi apakah saat ini CD-ROM sedang open atau close</p>
<pre class="brush: php; title: ; notranslate">
if(!isset($_SESSION['ROMSTATUS']))
		{
			$_SESSION['ROMSTATUS'] = 'open';
			$_SESSION['ROMIMG'] = '&lt;img src=&quot;'._URL.'image/dvd_mount.png&quot;&gt;';
		}
		elseif($_SESSION['ROMSTATUS'] == 'open')
		{
			$_SESSION['ROMSTATUS'] = 'close';
			$_SESSION['ROMIMG'] = '&lt;img src=&quot;'._URL.'image/dvd_unmount.png&quot;&gt;';
		}
		elseif($_SESSION['ROMSTATUS'] == 'close')
		{
			$_SESSION['ROMSTATUS'] = 'open';
			$_SESSION['ROMIMG'] = '&lt;img src=&quot;'._URL.'image/dvd_mount.png&quot;&gt;';
		}
</pre>
<p>woke! jangan bingung dulu, perhatiin langkah berikutna. di file index.php kite bakalan panggil config.php dan nircmd.php</p>
<pre class="brush: php; title: ; notranslate">
session_start();
ob_start();

include &quot;config.php&quot;; //panggil lokasi file config.php
include &quot;class/nircmd.php&quot;; //panggil lokasi file nircmd.php

$n = new nircmd; //ni diperlukan bwat class nircmd yang udah lu bikin diatas
</pre>
<p>selanjutna gunakan $n bwat manggil fungsi-fungsi dalam class nircmd</p>
<p>contoh:</p>
<ul>
<li><strong>$n-&gt;restart();</strong> //bwat merestart system</li>
<li><strong>$n-&gt;shutdown();</strong> //bwat men-shutdown system</li>
<li><strong>$n-&gt;cdrom();</strong> //bwat open dan close drive CD-ROM</li>
</ul>
<p>saat na masang parameter URL bwat pemilihan kondisi halaman, yakni bwat icon restart, shutdown dan cdrom</p>
<p>kasi link na kayak gini:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;restart&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Do you want to reboot  ?');if(cf)window.location='?a=restart';return false;&quot;&gt;&lt;img src=&quot;image/restart.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
   	  	&lt;div id=&quot;cd-rom&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;?a=cdrom&quot;&gt;&lt;img src=&quot;image/cd-rom.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  	  	&lt;div id=&quot;shutdown&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Do you want to turn off  ?');if(cf)window.location='?a=shutdown';return false;&quot;&gt;&lt;img src=&quot;image/shutdown.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</pre>
<p>parameter URL yang kite pake adalah &quot;a&quot;, nantina bakalan kite seleksi nilai dari parameter &quot;a&quot; ini di pemilihan kondisi halaman.</p>
<p>woke, bwat mempermudah, lu bisa pake switch bwat pemilihan halamana, apa itu switch dalam PHP? baca disini:</p>
<p>http://id.php.net/manual/en/control-structures.switch.php</p>
<p>dan ini implementasi dari pemilihan kondisi halaman na:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$a = $_REQUEST['a'];
switch ($a)
{
	case 'restart':
		$n-&gt;restart();
		break;
	case 'shutdown':
		$n-&gt;shutdown();
		break;
	case 'cdrom':
		$n-&gt;cdrom();
		break;
}
?&gt;
</pre>
<p>ok berur!????</p>
<p>jadi lengkapna, file index.php kayak gini sekarang:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
session_start();
ob_start();

/**
#
# Web Base Controller System with NirCMD
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Web development and design service =&gt; info@dremi.net
# Website http://dremi.info http://dremi.net
# License: GPL
# File: index.php
#
**/

include &quot;config.php&quot;;
include &quot;class/nircmd.php&quot;;

$n = new nircmd;
?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Web Base Controller System with NirCMD&lt;/title&gt;
&lt;link href=&quot;css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;mainBox&quot;&gt;
	&lt;div id=&quot;panelBox&quot;&gt;
    	&lt;div id=&quot;restart&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Do you want to reboot  ?');if(cf)window.location='?a=restart';return false;&quot;&gt;&lt;img src=&quot;image/restart.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
   	  	&lt;div id=&quot;cd-rom&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;?a=cdrom&quot;&gt;&lt;img src=&quot;image/cd-rom.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  	  	&lt;div id=&quot;shutdown&quot; class=&quot;float&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Do you want to turn off  ?');if(cf)window.location='?a=shutdown';return false;&quot;&gt;&lt;img src=&quot;image/shutdown.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align:center;&quot;&gt;
&lt;h3&gt;
&lt;?php
$a = $_REQUEST['a'];
switch ($a)
{
	case 'restart':
		$n-&gt;restart();
		break;
	case 'shutdown':
		$n-&gt;shutdown();
		break;
	case 'cdrom':
		$n-&gt;cdrom();
		break;
}
if(isset($a))
{
	echo '&lt;p&gt;COMMAND STATUS: &lt;b&gt;Executed!&lt;/b&gt;&lt;/p&gt;';
	echo '&lt;p&gt;ROM STATUS: '.$_SESSION['ROMIMG'].' '.$_SESSION['ROMSTATUS'].'&lt;/p&gt;';
}
?&gt;
&lt;/h3&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?
ob_end_flush();
?&gt;
</pre>
<p>liat, dipaling akhir sekarang ada baris <strong>ob_end_flush();</strong></p>
<p>ntu bwat mematikan buffer session yang dibuat oleh halaman <strong>index.php</strong> dan class pada <strong>nircmd.php</strong></p>
<p>pelajari disini:</p>
<p>http://id.php.net/manual/en/function.ob-end-flush.php</p>
<p>ni die tampilan awal index.php kalo di preview di design layout dreamweaver</p>
<div id="img"><img src="http://i846.photobucket.com/albums/ab22/dremiINFO/php-programming/web-based-controller-system/Controller_11.jpg" width="450" height="351" /></div>
<p>hehehe, tinggal lu coba dah di browser, buka URL aplikasi lu:</p>
<p><strong>http://localhost/wbcs-NirCMD/index.php</strong></p>
<p>URL na ga usah bingung donk, sesuaiin dengan folder aplikasi yang lu buat tadi di manajemen situs dreamweaver na.</p>
<p>&nbsp;</p>
<h3>TESTING</h3>
<p>coba lu test, klik icon CD-ROM dulu, sebelum nantina kudu lu coba link icon restart dan shutdown na</p>
<h3>KETERANGAN</h3>
<p>bwat awal awal ujicoba, pake settingan <strong>false</strong> dulu bwat definisi <strong>_IS_REMOTE_ACTIVE</strong> pada file <strong>config.php</strong></p>
<p>jadi lu bisa langsung liat hasil eksekusi perintah nirCMD dalam delay yang kagak terlalu lama. beda dengan menggunakan <strong>_IS_REMOTE_ACTIVE</strong> sebagai <strong>true</strong>, maka command remote system sesuai IP yang dijadiin target akan dieksekusi. dan ini memakan waktu terkadang delay 5-10 detik, tergantung kondisi jaringan LAN punya lu.</p>
<p>ni video saat PC dr.emi gw remote menggunakan aplikasi web based yang baru aja kite bikin ini.</p>
<div id="img"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/aYomXhcRkjo&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aYomXhcRkjo&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
</div>
<p>bwat struktur file aplikasi, lu bisa donglot script lengkap pada tutorial ini&#8230; </p>
<p>woke bruder!!! tengkyu berat dah mau baca tutorial acak kadut gw dan semrawut ini. diskusi kite terbuka di <a href="http://www.facebook.com/group.php?gid=168745886577" target="blank">FaceBook dremi.INFO</a> atau di <a href="http://www.dremi.info/forum" target="blank">forumna</a>.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/web-base-controller-system-with-nircmd.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/web-base-controller-system-with-nircmd.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=1014&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/ekU4z9RcH6Us8Ha2X0OybKWsFMs/0/da"><img src="http://feedads.g.doubleclick.net/~a/ekU4z9RcH6Us8Ha2X0OybKWsFMs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ekU4z9RcH6Us8Ha2X0OybKWsFMs/1/da"><img src="http://feedads.g.doubleclick.net/~a/ekU4z9RcH6Us8Ha2X0OybKWsFMs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/ai23HB_eniw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/photoshop/web-base-controller-system-with-nircmd.html/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		<enclosure url="http://www.youtube.com/v/aYomXhcRkjo&amp;#038;hl=en&amp;#038;fs=1" length="1008" type="application/x-shockwave-flash" /><media:content url="http://www.youtube.com/v/aYomXhcRkjo&amp;#038;hl=en&amp;#038;fs=1" fileSize="1008" type="application/x-shockwave-flash" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Prikituw!!! gw awali selamat datang dr.emi wakakakakakaka .. slamat datang kok ama diri sndiri.. hehe, gw mang dah lama ga posting tutorial baru. berkutat ama urusan sendok ama piring di dapur. wkaakak.. tapi gw pernah janji kalo bakalan exist di blog leg</itunes:subtitle><itunes:author>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</itunes:author><itunes:summary>Prikituw!!! gw awali selamat datang dr.emi wakakakakakaka .. slamat datang kok ama diri sndiri.. hehe, gw mang dah lama ga posting tutorial baru. berkutat ama urusan sendok ama piring di dapur. wkaakak.. tapi gw pernah janji kalo bakalan exist di blog legendaris ini. ya, dremi.INFO blog pertama gw mengudara sejak 2005, uset dah! emang radio [...]</itunes:summary><itunes:keywords>photoshop,tutorials,tutorial,php,mysql,jquery,jsp,psd,html,css,web,development,login,thickbox,lightbox,shopping,cart</itunes:keywords><feedburner:origLink>http://www.dremi.info/tutorials/photoshop/web-base-controller-system-with-nircmd.html</feedburner:origLink></item>
		<item>
		<title>dreLogin v.2.0 Has Release</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/i5bohOsUWoM/drelogin-v20-has-release.html</link>
		<comments>http://www.dremi.info/tutorials/jquery/drelogin-v20-has-release.html#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:33:55 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Free Download Script]]></category>
		<category><![CDATA[PHP login]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=975</guid>
		<description><![CDATA[I has release dreLogin V.2.0, it&#8217;s available to download and distributed under common license 3.0 Update bug notice: - Clearing string username and password before login action - Fixing CSS bug for IE 5 and IE 6 - Change from $_GET to $_REQUEST for URL parameter - More secure and custom user password encryption - [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i409.photobucket.com/albums/pp172/psdremi/images-header200/dreloginv2.png" alt="jQuery PHP User Form Login" />I has release dreLogin V.2.0, it&#8217;s available to download and distributed under common license 3.0<br />
<span id="more-975"></span></p>
<div class="clear"></div>
<p><strong>Update bug notice:</strong><br />
- Clearing string username and password before login action<br />
- Fixing CSS bug for IE 5 and IE 6<br />
- Change from $_GET to $_REQUEST for URL parameter<br />
- More secure and custom user password encryption<br />
- Change jQuery JS Lib to jquery-1.3.2.min.js<br />
- Fixing HTML TAG for Ajax Spinner Display</p>
<p><strong>Enjoy it friends!! </strong></p>
<p>If you want to download the old version, it&#8217;s still available at:<br />
<a target="blank" title="jquery php tutorial" href="http://dremi.info/articles/drelogin-v10-a-simple-jquery-php-login.html">http://dremi.info/articles/drelogin-v10-a-simple-jquery-php-login.html</a></p>
<p><strong>Report and Bug:</strong><br />
Please contact me for report and bug.</p>
<p><strong>Demo:</strong><br />
Username: dremi<br />
Password: terusberjuang</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/jquery/drelogin-v20-has-release.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/jquery/drelogin-v20-has-release.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=975&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/KVdkD--lZzIQZqNN7jAoQNbsWGc/0/da"><img src="http://feedads.g.doubleclick.net/~a/KVdkD--lZzIQZqNN7jAoQNbsWGc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KVdkD--lZzIQZqNN7jAoQNbsWGc/1/da"><img src="http://feedads.g.doubleclick.net/~a/KVdkD--lZzIQZqNN7jAoQNbsWGc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/i5bohOsUWoM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/jquery/drelogin-v20-has-release.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/jquery/drelogin-v20-has-release.html</feedburner:origLink></item>
		<item>
		<title>How to Check Username Availability using jQuery + PHP</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/IsOYBi9aC4w/how-to-check-username-availability-using-jquery-php.html</link>
		<comments>http://www.dremi.info/tutorials/jquery/how-to-check-username-availability-using-jquery-php.html#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:54:26 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Check Username]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[PHP validate]]></category>
		<category><![CDATA[string Availability]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=955</guid>
		<description><![CDATA[Hi! dude! how are you today ? I hope all of you will fine Today is our nice day, it&#8217;s time to party. Let&#8217;s learn again about jQuery and PHP. How to create safety validation of username checker for your member register using jQuery and PHP ? Check it now! However we still need : [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i409.photobucket.com/albums/pp172/psdremi/check-username-dremi.png" alt="" />Hi! dude! how are you today ? I hope all of you will fine <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Today is our nice day, it&#8217;s time to party. Let&#8217;s learn again about jQuery and PHP. How to create safety validation of username checker for your member register using jQuery and PHP ? Check it now!<br />
<span id="more-955"></span></p>
<div class="clear"></div>
<p>However we still need :</p>
<p>Member register form, just a simple HTML code</p>
<p>jQuery library, the Ajax Masterpiece</p>
<p>PHP Script, basic validation script</p>
<p>Little bit of member sql table, we will create it using PHPMyAdmin</p>
<p>Now, open your Dreamweaver, or any Code Editor, Notepad++ are welcome!</p>
<p>First, we will create HTML code for member register form. Remember, this form is just for illustrate the real form.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
&lt;fieldset&gt;
	&lt;legend&gt;Check Username Availability&lt;/legend&gt;
	&lt;label&gt;Username &lt;span class=&quot;require&quot;&gt;(* requiered: alphanumeric, without white space, and minimum 4 char&lt;/span&gt;&lt;/label&gt;
    &lt;input type=&quot;text&quot; name=&quot;username&quot; id=&quot;username&quot; size=&quot;15&quot; maxlength=&quot;15&quot; onchange=&quot;loadContentResult(this.value)&quot; /&gt;
	&lt;div id=&quot;spinner&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;actionresult&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
	&lt;label&gt;Email:&lt;/label&gt;
	&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; size=&quot;30&quot; maxlength=&quot;255&quot; /&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
	&lt;input type=&quot;submit&quot; name=&quot;submit&quot; id=&quot;submit&quot; value=&quot;Register&quot; /&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<p>On my input code, I use onchange=&#8221;loadContentResult(this.value)&#8221; to handle username field value while onChange event. So, where is come from the loadContentResult() ?</p>
<p>Here are the Javascript code, include for jQuery preloader.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
// Count the number of times a substring is in a string.
String.prototype.substrCount =
  function(s) {
    return this.length &amp;&amp; s ? (this.split(s)).length - 1 : 0;
  };

// Return a new string without leading and trailing whitespace
// Double spaces whithin the string are removed as well
String.prototype.trimAll =
  function() {
    return this.replace(/^\s+|(\s+(?!\S))/mg,&quot;&quot;);
  };

//event handler
function loadContentResult(username) {
	if(username.substrCount(' ') &gt; 0)
	{
		$(&quot;#actionresult&quot;).hide();
		$(&quot;#actionresult&quot;).load(&quot;user.php?msg=whitespace&quot;, '', callbackResult);
	}
	else
	{
		$(&quot;#actionresult&quot;).hide();
		$(&quot;#actionresult&quot;).load(&quot;user.php?username=&quot;+username.trimAll()+&quot;&quot;, '', callbackResult);
	}
}

//callback
function callbackResult() {
	$(&quot;#actionresult&quot;).show();
}

//ajax spinner
$(function(){
	$(&quot;#spinner&quot;).ajaxStart(function(){
		$(this).html('&lt;img src=&quot;image/wait.gif&quot; /&gt;');
	});
	$(&quot;#spinner&quot;).ajaxSuccess(function(){
		$(this).html('');
 	});
	$(&quot;#spinner&quot;).ajaxError(function(url){
		alert('Error: server was not respond, communication interrupt. Please try again in a few moment.');
 	});
});
&lt;/script&gt;
</pre>
<p>To call jQuery library, use </p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>You must carefull to validate string from username field before send it into PHP script. The problem is if you enter white space string from username field then send it into PHP script without validate it before, you will trouble while accessing user.php as PHP Script. So I need to add this javascript before validated by PHP script.</p>
<pre class="brush: jscript; title: ; notranslate">
// Count the number of times a substring is in a string.
String.prototype.substrCount =
  function(s) {
    return this.length &amp;&amp; s ? (this.split(s)).length - 1 : 0;
  };

// Return a new string without leading and trailing whitespace
// Double spaces whithin the string are removed as well
String.prototype.trimAll =
  function() {
    return this.replace(/^\s+|(\s+(?!\S))/mg,&quot;&quot;);
  };
</pre>
<p>How about jquery as script loader? To load user.php and attempt it into DIV ID for #actionresult, we can use this script:</p>
<pre class="brush: jscript; title: ; notranslate">
//event handler
function loadContentResult(username) {
	if(username.substrCount(' ') &gt; 0)
	{
		$(&quot;#actionresult&quot;).hide();
		$(&quot;#actionresult&quot;).load(&quot;user.php?msg=whitespace&quot;, '', callbackResult);
	}
	else
	{
		$(&quot;#actionresult&quot;).hide();
		$(&quot;#actionresult&quot;).load(&quot;user.php?username=&quot;+username.trimAll()+&quot;&quot;, '', callbackResult);
	}
}

//callback
function callbackResult() {
	$(&quot;#actionresult&quot;).show();
}
</pre>
<p>Don&#8217;t worry about ajax loading animation, I use simple GIF animation as spinner:</p>
<pre class="brush: jscript; title: ; notranslate">
//ajax spinner
$(function(){
	$(&quot;#spinner&quot;).ajaxStart(function(){
		$(this).html('&lt;img src=&quot;image/wait.gif&quot; /&gt;');
	});
	$(&quot;#spinner&quot;).ajaxSuccess(function(){
		$(this).html('');
 	});
	$(&quot;#spinner&quot;).ajaxError(function(url){
		alert('Error: server was not respond, communication interrupt. Please try again in a few moment.');
 	});
});
</pre>
<p>So, what netxt!? It&#8217;s time to make cool PHP Script to validate our username string (in this case, I just use username field as POST variable. But before it, let&#8217;s create our mysql table:</p>
<pre class="brush: sql; title: ; notranslate">
CREATE TABLE `member2` (
`member_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`username` varchar( 15 ) NOT NULL ,
`email` varchar( 255 ) NOT NULL ,
PRIMARY KEY ( `member_id` )
);
INSERT INTO `member` VALUES (1, 'dremi', 'webmaster@dremi.info');
</pre>
<p>This script for user.php file as response validator. Remember this is main function only, you may add some connection script.</p>
<pre class="brush: php; title: ; notranslate">
function clearString($value)
{
	if (get_magic_quotes_gpc())
	{
		$value = stripslashes($value);
	}
	if (!is_numeric($value))
	{
		$value = mysql_real_escape_string($value);
	}
	$value = trim(strip_tags($value));
	return $value;
}

function validStr($str, $num_chars, $behave) //alpha numeric only for entire of string width
{
	if($behave==&quot;min&quot;)
	{
		$pattern=&quot;^[0-9a-zA-Z]{&quot;.$num_chars.&quot;,}$&quot;;
	}
	elseif($behave==&quot;max&quot;)
	{
		$pattern=&quot;^[0-9a-zA-Z]{0,&quot;.$num_chars.&quot;}$&quot;;
	}
	elseif($behave==&quot;exactly&quot;)
	{
		$pattern=&quot;^[0-9a-zA-Z]{&quot;.$num_chars.&quot;,&quot;.$num_chars.&quot;}$&quot;;
	}

	if(ereg($pattern,$str))
	{
		return true;
	}
	else
	{
		return false;
	}
}
</pre>
<p>And this is for validate condition.</p>
<pre class="brush: php; title: ; notranslate">
$username	= $_REQUEST['username'];
$msg		= $_REQUEST['msg'];

if(isset($username) &amp;&amp; $username != '')
{
	if(validStr($username, 4, 'min') == false)
	{
		?&gt;
		&lt;span style=&quot;color:red&quot;&gt;You enter invalid username&lt;/span&gt;
		&lt;?php
	}
	else
	{
		connect(_HOST, _USER, _PASS, _DB);
		$jCekMember = numrows(query(&quot;SELECT * FROM member WHERE username = '&quot;.clearString($username).&quot;'&quot;));
		if($jCekMember != 0)
		{
			?&gt;
			&lt;span style=&quot;color:blue&quot;&gt;Username &lt;?php echo $username; ?&gt; was unavailable, another people has taken.&lt;/span&gt;
			&lt;?php
		}
		else
		{
			?&gt;
			&lt;span style=&quot;color:green&quot;&gt;Username &lt;?php echo $username; ?&gt; available.&lt;/span&gt;
			&lt;?php
		}
		close();
	}
}
elseif($msg == 'whitespace')
{
	?&gt;
	&lt;span style=&quot;color:red&quot;&gt;Username cannot contain of white space&lt;/span&gt;
    &lt;?php
}
else
{
	?&gt;
	&lt;span style=&quot;color:red&quot;&gt;Insert username&lt;/span&gt;
    &lt;?php
}
</pre>
<p>While username is valid string, PHP script will check availablility on member table using this code:</p>
<pre class="brush: php; title: ; notranslate">
$jCekMember = numrows(query(&quot;SELECT * FROM member WHERE username = '&quot;.clearString($username).&quot;'&quot;));
</pre>
<p>So, as showed on next line, if username is not available to register in member table, it&#8217;s mean the username has taken by another people, and message will say :</p>
<pre class="brush: php; title: ; notranslate">
Username &lt;?php echo $username; ?&gt; was unavailable, another people has taken.
</pre>
<p>Well, everything is gonna be Allright <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Now let&#8217;s see the result by click on Demo Button or you can Download full code to learn.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/jquery/how-to-check-username-availability-using-jquery-php.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/jquery/how-to-check-username-availability-using-jquery-php.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=955&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/y7O7rVmcAQpat51NylCFEfsdz9E/0/da"><img src="http://feedads.g.doubleclick.net/~a/y7O7rVmcAQpat51NylCFEfsdz9E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/y7O7rVmcAQpat51NylCFEfsdz9E/1/da"><img src="http://feedads.g.doubleclick.net/~a/y7O7rVmcAQpat51NylCFEfsdz9E/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/IsOYBi9aC4w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/jquery/how-to-check-username-availability-using-jquery-php.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/jquery/how-to-check-username-availability-using-jquery-php.html</feedburner:origLink></item>
		<item>
		<title>Download PHP Script: Backup and Restore Database</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/Ij7noU8mLx0/download-php-script-backup-and-restore-database.html</link>
		<comments>http://www.dremi.info/articles/download-php-script-backup-and-restore-database.html#comments</comments>
		<pubDate>Thu, 01 Oct 2009 07:34:28 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[database management]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[php class]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=906</guid>
		<description><![CDATA[Hi guys! This is PHP Script to backup or restore your SQL Database. It&#8217;s Free to download! Just visit my PHPClasses Page: http://www.phpclasses.org/browse/package/5720.html Or let&#8217;s discuss about something bug or report on: http://www.phpclasses.org/discuss/package/5720/ Share on Facebook]]></description>
			<content:encoded><![CDATA[<p>Hi guys!</p>
<div id="img">
<img src="http://i175.photobucket.com/albums/w126/hairulazami/scr.jpg" alt="" />
</div>
<p>This is PHP Script to backup or restore your SQL Database. It&#8217;s Free to download!</p>
<p>Just visit my PHPClasses Page:<br />
<a target="blank" href="http://www.phpclasses.org/browse/package/5720.html">http://www.phpclasses.org/browse/package/5720.html</a></p>
<p>Or let&#8217;s discuss about something bug or report on:<br />
<a target="blank" href="http://www.phpclasses.org/discuss/package/5720/">http://www.phpclasses.org/discuss/package/5720/</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/download-php-script-backup-and-restore-database.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/download-php-script-backup-and-restore-database.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=906&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/eAhZ6TpIixPCLtKPwu7ap7snP3E/0/da"><img src="http://feedads.g.doubleclick.net/~a/eAhZ6TpIixPCLtKPwu7ap7snP3E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/eAhZ6TpIixPCLtKPwu7ap7snP3E/1/da"><img src="http://feedads.g.doubleclick.net/~a/eAhZ6TpIixPCLtKPwu7ap7snP3E/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/Ij7noU8mLx0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/articles/download-php-script-backup-and-restore-database.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.dremi.info/articles/download-php-script-backup-and-restore-database.html</feedburner:origLink></item>
		<item>
		<title>Building Administrator Manager for Table Relation Using PHP and jQuery</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/GT_G9gbjsyw/building-administrator-manager-for-table-relation-using-php-and-jquery.html</link>
		<comments>http://www.dremi.info/tutorials/php/building-administrator-manager-for-table-relation-using-php-and-jquery.html#comments</comments>
		<pubDate>Fri, 03 Jul 2009 10:46:04 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSS tutorials]]></category>
		<category><![CDATA[handcoded HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery highlightfade plugin]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[psd2html]]></category>
		<category><![CDATA[table relation]]></category>
		<category><![CDATA[thickbox]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=870</guid>
		<description><![CDATA[Hello my friends, this tutorial will explain about how to building complete Administrator Manager, Using PHP and jQuery. At the begining of tutorial you will explained about designing interface for our Administrator Page, then will continue with steps about how to make it as ready application. Well, actually I don&#8217;t know how to create good [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/preview200.png" alt="" width="200" height="200" />Hello my friends, this tutorial will explain about how to building complete Administrator Manager, Using PHP and jQuery. At the begining of tutorial you will explained about designing interface for our Administrator Page, then will continue with steps about how to make it as ready application.</p>
<p>Well, actually I don&#8217;t know how to create good tutorial, but I feel, I must share this tutorial. Based on my recent project last month, this tutorial will guide you to be a webmaster. I am sure, you know about what is webmaster <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Because in this tutorial you will see technic from first designing till hand code your application. Enjoy it friends !</p>
<p><span id="more-870"></span></p>
<div class="clear"></div>
<p>On this tutorial, we need several important thing to complete our work today <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Designing and layout</p>
<ol>
<li>Adobe Photoshop</li>
<li>Adobe Dreamweaver</li>
</ol>
<p>Programming</p>
<ol>
<li>PHP</li>
<li>HTML + CSS</li>
<li>Javascript</li>
<li>jQuery</li>
<li>jQuery ThickBox Plugin</li>
<li>jQuery HighlightFade Plugin</li>
<li>MySQL Server</li>
<li>Apache Server</li>
<li>phpMyAdmin</li>
</ol>
<p>So, just start from First Step: Designing</p>
<h3>Step 1 » Designing</h3>
<p>Start with your new document of Adobe Photoshop. You may use free size for new document.</p>
<p>Use your shapping tool to grab a new rounded rectangle. Remember that this is for your header of Administrator Page.</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation1.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation1.png" alt="" width="708" height="95" /></a></div>
<p>Add simple inner glow, gradient style and stroke for your header</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation20.png" alt="" width="410" height="361" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation21.png" alt="" width="432" height="350" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation22.png" alt="" width="415" height="329" /></div>
<p>And the result is&#8230;.</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation2.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation2.png" alt="" width="713" height="77" /></a></div>
<p>Add your title at front of header layer. To make it better, I use small icon from crystalxp.net for the logo</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation5.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation5.png" alt="" width="724" height="80" /></a></div>
<p>Next, Create several rectangle at the bottom of header for a little bit welcome text and menus. To make it beautifull menu, I use two icon again.</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation9.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation9.png" alt="" width="715" height="125" /></a></div>
<p>Grab new rectangle again for your main content, feel free to add some style. For nice design, you may create the other amazing styles.</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation10.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation10.png" alt="" width="708" height="633" /></a></div>
<p>Well, your basic layout has done! It&#8217;s time to illustrate the form for your application. In this case, I will show about illustrate edit form page as a part of your hand code at the next step.</p>
<p>Grab some label and rectangle. For the button, I use simple reflection effect by duplicate button layer and transform it vertical then erase half of button layer copy. So you will see a simple reflection for your button.</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation14.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation14.png" alt="" width="642" height="458" /></a></div>
<p>To manage relation data at the future, add some icon that will used for manage relation data</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation15.png" alt="" width="393" height="280" /></div>
<p>Enough! <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  now you may slice your design to save it as image. Be carefull, slice for needed area only.</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation16.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation16.png" alt="" width="708" height="626" /></a></div>
<p>This is screen shoot of my setting of Save For Web Window</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation17.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation17.png" alt="" width="1103" height="586" /></a></div>
<p>Save only selected sliced</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation18.png" alt="" width="363" height="113" /></div>
<p>The result of images</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation19.png" alt="" width="493" height="575" /></div>
<h3>Step 2 » Converting from PSD Design to HTML and CSS</h3>
<p>This step will show to you about how to convert our previous psd design to hand code of HTML and CSS. Let&#8217;s open your Adobe Dreamweaver to begin!</p>
<p>In this part, we need two main file, consist of HTML and CSS file.</p>
<p>Create new CSS Document, with this simple hand code:</p>
<pre class="brush: css; title: ; notranslate">

@charset &quot;utf-8&quot;;
/* CSS Document */

html,body{
margin:0;
padding:0;
border:0;
height:100%;
}
body{
background:#ffffff;
color:#2a2a2a;
min-width:697px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
a:link {
color: #99CC00;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #99CC00;
}
a:hover {
text-decoration: underline;
color: #FF9900;
}
a:active {
text-decoration: none;
color: #FF9900;
}
#ajax_display {
position: fixed; top: 49%; left: 35%; border:0px; z-index: 50; width: 110px; height: 100px; margin: auto 0;
}
#mainPan {
width:697px;
position:relative;
margin:0 auto;
}
#bodyPan {
width:697px;
margin:0 auto;
}
.clear {
clear:both;
height:1px;
overflow:hidden;
line-height:1%;
font-size:0px;
margin-bottom:-1px;
}
.spacer { margin-bottom:10px; }

/*HEADER*/
#header {
margin-top: 10px;
height: 54px;
width: 697px;
background:url(images/header.gif) 0 0 no-repeat;
}

/*MENU*/
#menu {
margin-top: 10px;
height: 36px;
width: 697px;
}
#menu a:link {
color: #2a2a2a;
text-decoration: none;
}
#menu a:visited {
text-decoration: none;
color: #2a2a2a;
}
#menu a:hover {
text-decoration: none;
color: #006600;
}
#menu a:active {
text-decoration: none;
color: #2a2a2a;
}
#menu #welcome {
height: 36px;
width: 401px;
background:url(images/bg-welcome.gif) 0 0 no-repeat;
padding-left: 22px;
padding-top: 8px;
margin-right: 10px;
font-size:16px;
float:left;
}
#menu #addnew {
height: 36px;
width: 83px;
background:url(images/bg-addnew.gif) 0 0 no-repeat;
padding-left: 40px;
padding-top: 8px;
margin-right: 10px;
font-size:16px;
float:left;
cursor: pointer; cursor: hand;
}
#menu #list {
height: 36px;
width: 75px;
background:url(images/bg-list.gif) 0 0 no-repeat;
padding-left: 50px;
padding-top: 8px;
font-size:16px;
float:left;
cursor: pointer; cursor: hand;
}

/*CONTENT*/
#content {
margin-top: 10px;
width: 697px;
}
#content #top-content {
height: 6px;
width: 697px;
background:url(images/bg-top-content.gif) 0 0 no-repeat;
}
#content #center-content {
min-height: 350px;
width: 697px;
background:url(images/bg-center-content.gif) 0 0 repeat-y;
}
#content #bottom-content {
height: 6px;
width: 697px;
background:url(images/bg-bottom-content.gif) 0 0 no-repeat;
}
#content #text {
padding:20px;
color: #b4cff2;
background:none;
}
#content #text #maintable {
color: #2a2a2a;
}
#content #text p {
margin:0px;
padding:0px;
color: #b4cff2;
background:none;
}
#content #text p.msg {
margin-bottom:10px;
padding:10px;
color: #b4cff2;
text-align:center;
background: #6699FF;
border:solid 1px #000066;
-moz-border-radius: 4px;
}
#content #text p.msg span {
background: url(images/exclamation.png) 0 -10px no-repeat;
padding-left:30px;
}

/* FORM BOX */
#formM { padding:10px;}
#formM p { padding-left:72px;padding-top:10px; font-size:11px;padding-bottom:10px; }
#formM .inputM{
border:none;
color:#2a2a2a;
background:url(images/bg-field.gif) 0 0 no-repeat;
width:327px;
height:26px;
padding:2px;
font-size:14px;
margin-bottom:10px;
cursor: pointer; cursor: hand;
}
#formM #fieldBox {
width:367px;
float:right;
margin-right:4px;
margin-top:-10px;
margin-bottom:20px;
}
#formM #submenu {
width:40px;
height:150px;
float:left;
}
#formM #submenu #icon {
width:22px;
height:29px;
float:left;
margin-right:10px;
}
#formM #submenu #icon img {
border:none;
}
#formM #submenu #icon.space {
margin-top:10px;
}
#formM #collection{
border:none;
color:#2a2a2a;
width:307px;
float:left;
background:none;
}
#formM #collection #top-box {
height: 6px;
width:337px;
background:url(images/bg-top-box.gif) 0 0 no-repeat;
}
#formM #collection #center-box {
width:337px;
background:url(images/bg-center-box.gif) 0 0 repeat-y;
}
#formM #collection #bottom-box {
height: 6px;
width:337px;
background:url(images/bg-bottom-box.gif) 0 0 no-repeat;
}
#formM #collection #center-box #text {
padding:10px;
color:#2a2a2a;
}

#formM #collection #center-box #text #divTxt {
color:#2a2a2a;
}

#formM .textareaM{
border:1px solid #C0C0C0;
color:#666666;
font-size:16px;
cursor: pointer; cursor: hand;
}
#formM label{
display:block;
color:#b4cff2;
}

#formM label span{
display:block;
float:left;
padding-right:6px;
width:300px;
text-align:left;
font-weight:bold;
font-size:16px;
}
#formM .note{
float:right;
margin-top:-5px;
width: 325px;
font-size:10px;
}
#formM .buttonM{
background:url(images/bg-button.gif) 0 0 no-repeat;
border:none;
height:75px;
width:116px;
color:#b4cff2;
padding-bottom:40px;
font-size:14px;
text-decoration:none;
font-weight:bold;
cursor: pointer; cursor: hand;
}

/*FOOTER*/
#footer {
margin-bottom: 20px;
margin-top: 20px;
height: 30px;
width: 697px;
text-align:center;
}
#footer a:link {
color: #2a2a2a;
text-decoration: none;
}
#footer a:visited {
text-decoration: none;
color: #2a2a2a;
}
#footer a:hover {
text-decoration: underline;
color: #0099FF;
}
#footer a:active {
text-decoration: none;
color: #2a2a2a;
}
</pre>
<p>Well to make your main page, just create new HTML document with this HTML code:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Building Administrator Manager for Table Relation Using PHP and jQuery&lt;/title&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;!--

#
# Building Administrator Manager for Table Relation Using PHP and jQuery
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Website http://dremi.info
# License: GPL
#

--&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;ajax_display&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;mainPan&quot;&gt;
&lt;div id=&quot;bodyPan&quot;&gt;
&lt;div id=&quot;header&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;menu&quot;&gt;
&lt;div id=&quot;welcome&quot;&gt;Welcome. Today is &lt;/div&gt;
&lt;a href=&quot;?cPub=addnew&quot;&gt;&lt;div id=&quot;addnew&quot;&gt;ADD NEW&lt;/div&gt;&lt;/a&gt;
&lt;a href=&quot;?cPub=list&quot;&gt;&lt;div id=&quot;list&quot;&gt;LIST&lt;/div&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id=&quot;content&quot;&gt;
&lt;div id=&quot;top-content&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-content&quot;&gt;
&lt;div id=&quot;text&quot;&gt;
&lt;div id=&quot;formM&quot;&gt;
&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;get&quot; action=&quot;&quot;&gt;
&lt;label&gt;&lt;span&gt;Book Title &lt;/span&gt;
&lt;input name=&quot;title&quot; value=&quot;&quot; type=&quot;text&quot; class=&quot;inputM&quot; id=&quot;title&quot; size=&quot;20&quot; /&gt;
&lt;/label&gt;

&lt;label&gt;&lt;span&gt;Category &lt;/span&gt;
&lt;div id=&quot;contenPanCategory&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCategory&quot;&gt;
&lt;select class=&quot;inputM&quot; name=&quot;category_id&quot; size=&quot;1&quot;&gt;
&lt;option value=&quot;&quot;&gt;-category-&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;span class=&quot;note&quot;&gt; (* Your category not listed ? Manage &lt;a href=&quot;#&quot; title=&quot;Manage Category&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;#&quot; title=&quot;Refresh Category List&quot;&gt;refresh&lt;/a&gt;&lt;/span&gt;
&lt;/label&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;Collections &lt;/span&gt;
&lt;div id=&quot;fieldBox&quot;&gt;
&lt;div id=&quot;submenu&quot;&gt;
&lt;div id=&quot;icon&quot;&gt;&lt;a href=&quot;#&quot;&gt;&lt;img alt=&quot;Refresh Collection Data&quot; src=&quot;images/refresh.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;icon&quot; class=&quot;space&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;Add New Collection&quot;&gt;&lt;img alt=&quot;Add New Collection&quot; src=&quot;images/addplus.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;icon&quot; class=&quot;space&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;Remove All Collection&quot;&gt;&lt;img alt=&quot;Remove All Collection&quot; src=&quot;images/remove.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;collection&quot;&gt;
&lt;div id=&quot;top-box&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-box&quot;&gt;
&lt;div id=&quot;text&quot;&gt;
&lt;div id=&quot;contenPanCollection&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCollection&quot;&gt;
&lt;!--
iFrame Collection
--&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;bottom-box&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/label&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;UPDATE&quot; class=&quot;buttonM&quot;/&gt;
&lt;/label&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;bottom-content&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id=&quot;footer&quot;&gt;
&amp;copy; Copyright 2009 dr.emi creative design { &lt;a href=&quot;http://www.dremi.info&quot; target=&quot;_blank&quot;&gt;www.dremi.info&lt;/a&gt; }
&lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Note: this is just planning HTML page. Next, we will save as PHP file. This is preview of main HTML page</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation24.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation24.png" alt="" width="706" height="692" /></a></div>
<h3>Step 3 »  Database and Programming</h3>
<p>Oukee!!!! In this step, we will learn how to create database and hand code of PHP for our Administrator Page.</p>
<p>But before you have fun with your code, take look my simple database structure from the scratch</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/DSC00460.jpg"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/DSC00460.jpg" alt="" width="640" height="480" /></a></div>
<p>The table that have relation to others is <strong>book</strong> . The book table related for collection and category table. So for the next, you will need phpMyAdmin to create our new SQL code, based on our table structure above.</p>
<p>MySQL Code</p>
<pre class="brush: sql; title: ; notranslate">

CREATE TABLE `book` (
`book_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 255 ) NOT NULL ,
`category_id` INT( 11 ) NOT NULL
) ENGINE = MYISAM ;

CREATE TABLE `category` (
`category_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`description` VARCHAR( 255 ) NOT NULL
) ENGINE = MYISAM ;

CREATE TABLE `collection` (
`collection_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`collection_data` VARCHAR( 255 ) NOT NULL ,
`book_id` INT( 11 ) NOT NULL
) ENGINE = MYISAM ;
</pre>
<p>Just login into your phpMyAdmin page, and create new database, called as: <strong>my_book</strong> database.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation25.png" alt="" width="492" height="433" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation26.png" alt="" width="476" height="330" /></div>
<p>Then execute your SQL code</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation31.png" alt="" width="466" height="362" /></div>
<p>Ok, now you have 3 table on your database</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation32.png" alt="" width="200" height="239" /></div>
<p>Database and table was created. Next is programming time !</p>
<p>Let me explain about our planning for files structure.</p>
<p>The srtructure of files consist of :</p>
<table border="0" cellspacing="1" cellpadding="4" width="100%" bgcolor="#999999">
<tbody>
<tr>
<td width="3%" bgcolor="#cccccc"><strong>No.</strong></td>
<td width="28%" bgcolor="#cccccc"><strong>Files/folder</strong></td>
<td width="69%" bgcolor="#cccccc"><strong>Description</strong></td>
</tr>
<tr>
<td bgcolor="#ffffff">1.</td>
<td bgcolor="#ffffff">./images/</td>
<td bgcolor="#ffffff">Images folder</td>
</tr>
<tr>
<td bgcolor="#ffffff">2.</td>
<td bgcolor="#ffffff">./js/</td>
<td bgcolor="#ffffff">Javascript folder</td>
</tr>
<tr>
<td bgcolor="#ffffff"></td>
<td bgcolor="#ffffff">- thickbox/</td>
<td bgcolor="#ffffff">jQuery thickbox plugin</td>
</tr>
<tr>
<td bgcolor="#ffffff"></td>
<td bgcolor="#ffffff">- ajax-display.js</td>
<td bgcolor="#ffffff">jQuery ajax loading indicator</td>
</tr>
<tr>
<td bgcolor="#ffffff"></td>
<td bgcolor="#ffffff">- dynamic-form.js</td>
<td bgcolor="#ffffff">Javascript Dynamic Form for Category and Collection Data</td>
</tr>
<tr>
<td bgcolor="#ffffff"></td>
<td bgcolor="#ffffff">- jquery-1.2.6.js</td>
<td bgcolor="#ffffff">jQuery framework</td>
</tr>
<tr>
<td bgcolor="#ffffff"></td>
<td bgcolor="#ffffff">- jquery.highlightFade.js</td>
<td bgcolor="#ffffff">jQuery highlightFade plugin</td>
</tr>
<tr>
<td bgcolor="#ffffff">3.</td>
<td bgcolor="#ffffff">category-loader.php</td>
<td bgcolor="#ffffff">file handler for dynamic category field</td>
</tr>
<tr>
<td bgcolor="#ffffff">4.</td>
<td bgcolor="#ffffff">db.php</td>
<td bgcolor="#ffffff">database connection class</td>
</tr>
<tr>
<td bgcolor="#ffffff">5.</td>
<td bgcolor="#ffffff">dre-config.php</td>
<td bgcolor="#ffffff">database configuration</td>
</tr>
<tr>
<td bgcolor="#ffffff">6.</td>
<td bgcolor="#ffffff">frame-collection-loader.php</td>
<td bgcolor="#ffffff">file loader for iframe of collection data</td>
</tr>
<tr>
<td bgcolor="#ffffff">7.</td>
<td bgcolor="#ffffff">function.php</td>
<td bgcolor="#ffffff">simple php function</td>
</tr>
<tr>
<td bgcolor="#ffffff">8.</td>
<td bgcolor="#ffffff">index.php</td>
<td bgcolor="#ffffff">main PHP file</td>
</tr>
<tr>
<td bgcolor="#ffffff">9.</td>
<td bgcolor="#ffffff">style.css</td>
<td bgcolor="#ffffff">our beautifull style <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </td>
</tr>
<tr>
<td bgcolor="#ffffff">10.</td>
<td bgcolor="#ffffff">ui-collection.php</td>
<td bgcolor="#ffffff">unit interface for collection data</td>
</tr>
</tbody>
</table>
<p>You may use login form for user authentication, but on this tutorial I&#8217;m not explain about it. The solution is you may use my free opensource login scripts by click this link:</p>
<p><a href="http://www.4shared.com/file/82642576/3cb9f4a6/dreLogin1.html" target="_blank">http://www.4shared.com/file/82642576/3cb9f4a6/dreLogin1.html</a></p>
<p>or you can try demo page before download it</p>
<p><a href="../demo/dreLogin1" target="_blank">http://www.dremi.info/demo/dreLogin1</a></p>
<p><strong>Class and Configuration</strong></p>
<p>Now create simple PHP class for database connection and database configuration</p>
<p>PHP code for Database class: db.php</p>
<pre class="brush: php; title: ; notranslate">

&lt;?
/**
#
# Building Administrator Manager for Table Relation Using PHP and jQuery
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Website http://dremi.info
# License: GPL
# File: db.php
#
**/

## connection &amp; database class
if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}

class mydb
{
//connect to database
function connect($host, $user, $pass, $dbase)
{
$con = mysql_connect($host, $user, $pass);
if($con)
{
mysql_select_db($dbase) or die(&quot;could'nt select database&quot;);
}
else
{
die(&quot;couldn't connect to host&quot;);
}
}

//query
function query($sql)
{
$qry = mysql_query($sql);
return $qry;
}

//counter rows
function numrows($qry)
{
$num = mysql_num_rows($qry);
return $num;
}

//rows data
function fetch($qry)
{
if($row = mysql_fetch_array($qry))
{
return $row;
}
else
{
echo mysql_error();
}
}

//next classes
}
?&gt;
</pre>
<p>The classe will help you to call simple paramater of each of table execution needed.</p>
<p>Next create database configuration file for: dre-config.php</p>
<p>PHP code for configuration file : dre-config.php</p>
<pre class="brush: php; title: ; notranslate">

&lt;?

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}

##connection definition
define(&quot;_DB_HOST&quot;, &quot;localhost&quot;);
define(&quot;_DB_USER&quot;, &quot;root&quot;);
define(&quot;_DB_PASS&quot;, &quot;yoursecreetpassword&quot;);
define(&quot;_DB_NAME&quot;, &quot;my_book&quot;);
?&gt;
</pre>
<p><strong>define</strong> is used for Defines a named constant. Example: localhost is your server host name, will defined as _DB_HOST.</p>
<p>Next file is function.php. This is my function code:</p>
<pre class="brush: php; title: ; notranslate">

&lt;?

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}

function redirect($delay,$goto)
{
echo&quot;&lt;br&gt;Redirect progress..&lt;br&gt;Please Stand By.. &lt;meta http-equiv=\&quot;refresh\&quot; content=\&quot;$delay;URL=$goto\&quot; /&gt;&quot;;
}
function alert($msg)
{
echo &quot;&lt;SCRIPT&gt;alert(\&quot;$msg\&quot;);history.go(-1)&lt;/SCRIPT&gt;&quot;;
exit;
}
function alert2($msg)
{
echo &quot;&lt;SCRIPT&gt;alert(\&quot;$msg\&quot;);&lt;/SCRIPT&gt;&quot;;
exit;
}
?&gt;
</pre>
<p><strong>redirect</strong> is function that used for redirect the result page, once action cleared. For <strong>alert</strong> and <strong>alert2</strong> is just to display Javascript alert, maybe you will need as messager for action result.</p>
<p><strong>PHP Main Page</strong></p>
<p>Well&#8230;.. continue with PHP main Page, save as main.html into index.php</p>
<p>Now, I will explain about codes in index.php. In index.php we will create dynamic content for each of link, I use $_GET['string'] to implementad it. GET will give value from URL parameter. Also, in this page, we will create some code for insert, edit and delete rows of table. So, do not close your window now <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First you must call dre-config.php, db.php, and function.php at the begining of index.php Use <strong>include_once</strong> to call each of file.</p>
<pre class="brush: php; title: ; notranslate">

define(&quot;_VALID_ACCESS&quot;, true);

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}

include_once &quot;dre-config.php&quot;;
include_once &quot;db.php&quot;;
include_once &quot;function.php&quot;;
</pre>
<p>You must define _VALID_ACCESS as true. So, index.php are allowed to direct access.</p>
<p>For calling your database connection class, use this code:</p>
<pre class="brush: php; title: ; notranslate">

$db = new mydb;
$db-&gt;connect(_DB_HOST, _DB_USER, _DB_PASS, _DB_NAME);
</pre>
<p><strong>connect</strong> is one of your function on db.php class. To call another function, just use $db-&gt;functionname. Example: $db-&gt;query() or $db-&gt;fetch()</p>
<p>OK, the next is creating javascript files. Just Begin with ajax-display.js</p>
<pre class="brush: jscript; title: ; notranslate">

// JavaScript Document
$(function(){
$(&quot;#ajax_display&quot;).ajaxStart(function(){
$(this).html('&lt;img src=&quot;images/ajax-loader-trans.gif&quot; /&gt;');
});
$(&quot;#ajax_display&quot;).ajaxSuccess(function(){
$(this).html('');
});
$(&quot;#ajax_display&quot;).ajaxError(function(url){
alert('jQuery ajax is error ');
});
});
</pre>
<p>ajax-display.js will display jQuery action loading indicator by print out the <strong>images/ajax-loader-trans.gif</strong> into browser page.</p>
<p>Next, dynamic-form.js. This file will used for handling dynamic process for insert and update form. Offcourse to manage our relation table data.</p>
<pre class="brush: jscript; title: ; notranslate">

// JavaScript Document

function addFormField() {
var id = document.getElementById(&quot;id&quot;).value;
$(&quot;#divTxt&quot;).append(&quot;&lt;p style='margin:0px;padding:0px;width:90%;' id='row&quot; + id + &quot;'&gt;&lt;label for='txt&quot; + id + &quot;' style='color:#2a2a2a;'&gt;&quot; + id + &quot;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;input title='Type new collection data' type=text name='collection_data[]' id='txt1&quot; + id + &quot;' size='35'&gt;&amp;nbsp;&amp;nbsp;&lt;a href='#' onClick='removeFormField(\&quot;#row&quot; + id + &quot;\&quot;); return false;'&gt;&lt;img alt='Remove' title='Remove' border=0 src='images/close.png'&gt;&lt;/a&gt;&lt;/label&gt;&lt;/p&gt;&lt;br&gt;&quot;);

$('#row' + id).highlightFade({
speed:1000
});

id = (id - 1) + 2;
document.getElementById(&quot;id&quot;).value = id;
}

function removeFormField(id) {
$(id).remove();
}

/**REFRESH SCRIPT FOR COLLECTION**/
function refreshCollection(book_id, cDel) {
$(&quot;#contenPanCollection&quot;).load(&quot;frame-collection-loader.php?book_id=&quot;+book_id+&quot;&amp;cDel=&quot;+cDel+&quot;&quot;, '', callbackCollection);
}
function callbackCollection() {
$(&quot;#toBeHideCollection&quot;).hide();
$(&quot;#contenPanCollection&quot;).show();
}
$(document).ready(refreshCollection(book_id, cDel));

/**REFRESH SCRIPT FOR CATEGORY**/
function refreshCategory() {
$(&quot;#contenPanCategory&quot;).load(&quot;category-loader.php&quot;, '', callbackCategory);
}
function callbackCategory() {
$(&quot;#toBeHideCategory&quot;).hide();
$(&quot;#contenPanCategory&quot;).show();
}
$(document).ready(refreshCategory());
</pre>
<p><strong>addFormField</strong> is function to display dynamic text field, on this part I use jquery.highlightFade.js plugin to implementad it.</p>
<p><strong>frame-collection-loader.php</strong> is file that used by jQuery ajax, to get value of book relation table. Remember that, book table related with collection data table. So, to implementad it using jQuery, you must create function like refreshCollection.</p>
<p>OK, back to index.php, add this code to call some javascript file</p>
<pre class="brush: jscript; title: ; notranslate">

&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.highlightFade.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/dynamic-form.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/ajax-display.js&quot;&gt;&lt;/script&gt;
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
@import &quot;js/thickbox/thickbox.css&quot;;
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/thickbox/thickbox.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Thickbox is a jQuery plugin to displaying unit interface content in form page. You will see the result after complete this tutorial.</p>
<p>On index.php I use &lt;div id=&#8221;ajax_display&#8221;&gt;&lt;/div&gt; after BODY tag as target of ajax-display javascript. So, you may create a style for it.</p>
<pre class="brush: css; title: ; notranslate">

#ajax_display {
position: fixed; top: 49%; left: 35%; border:0px; z-index: 50; width: 110px; height: 100px; margin: auto 0;
}
</pre>
<p>Let&#8217;s see our last index.php code</p>
<pre class="brush: php; title: ; notranslate">

&lt;?
/**
#
# Building Administrator Manager for Table Relation Using PHP and jQuery
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Website http://dremi.info
# License: GPL
# File: index.php
#
**/

##YOU MAY ADD SOME AUTHENTICATION CODE FOR USER LOGIN HERE
define(&quot;_VALID_ACCESS&quot;, true);

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}

include_once &quot;dre-config.php&quot;;
include_once &quot;db.php&quot;;
include_once &quot;function.php&quot;;

$db = new mydb;
$db-&gt;connect(_DB_HOST, _DB_USER, _DB_PASS, _DB_NAME);
?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Building Administrator Manager for Table Relation Using PHP and jQuery&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.2.6.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.highlightFade.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/dynamic-form.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/ajax-display.js&quot;&gt;&lt;/script&gt;
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
@import &quot;js/thickbox/thickbox.css&quot;;
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/thickbox/thickbox.js&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;ajax_display&quot;&gt;&lt;/div&gt;
</pre>
<p>OK, next task is creating dynamic content for insert, edit, and delete of table rows.</p>
<p>Take look this code:</p>
<p>First content is listing and delete of table data</p>
<pre class="brush: php; title: ; notranslate">

&lt;?
if($_GET['cPub'] == 'list')
{
if($_GET['cTask'] == 'delete')
{
$CHK = &quot;SELECT * FROM collection WHERE book_id = '$_GET[book_id]'&quot;;
$SQL = &quot;DELETE FROM book WHERE book_id = '$_GET[book_id]'&quot;;

##FIRST CHECK IT FOR COLLECTION
$COLL= $db-&gt;numrows($db-&gt;query($CHK));

if($COLL &gt; 0)
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;You cannot delete BOOK ID = $_GET[book_id]. This record still have $COLL collection data&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
if($QRY = $db-&gt;query($SQL))
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;Successfully Delete for BOOK ID = $_GET[book_id]&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;Error: Delete for BOOK ID = $_GET[book_id]&lt;span&gt;&lt;/p&gt;&quot;;
}
}
}

$SQL = &quot;SELECT * FROM book ORDER BY book_id DESC&quot;;
$QRY = $db-&gt;query($SQL);
$NUM = $db-&gt;numrows($QRY);
$i = 0;
if($NUM &gt; 0)
{
?&gt;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot; id=&quot;maintable&quot;&gt;
&lt;tr&gt;
&lt;td width=&quot;5%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;No.&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;47%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Book Title&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;24%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Category&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;10%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Collection&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;14%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Option&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?
while($ROW = $db-&gt;fetch($QRY))
{
$i++;

?&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;&lt;? echo $i; ?&gt;&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;&lt;? echo $ROW['title']; ?&gt;&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;&lt;?
$CATROW = $db-&gt;fetch($db-&gt;query(&quot;SELECT * FROM category WHERE category_id = '$ROW[category_id]'&quot;));
echo $CATROW['description'];
?&gt;
&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;
&lt;?
##NUMBER OF COLLECTION
$COLLECTION_NUMBER = $db-&gt;numrows($db-&gt;query(&quot;SELECT * FROM collection WHERE book_id = '$ROW[book_id]'&quot;));
echo $COLLECTION_NUMBER;
?&gt;
&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;
&lt;a href=&quot;ui-collection.php?book_id=&lt;? echo $ROW['book_id']; ?&gt;&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=500&quot; class=&quot;thickbox&quot; title=&quot;View Collection of &lt;? echo $ROW['title']; ?&gt;&quot;&gt;&lt;img src=&quot;images/zoom16.png&quot; alt=&quot;View Collection&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href=&quot;?cPub=edit&amp;amp;book_id=&lt;? echo $ROW['book_id']; ?&gt;&quot; title=&quot;Edit&quot;&gt;&lt;img src=&quot;images/edit.png&quot; alt=&quot;Edit&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Are you sure to delete No. &lt;? echo $i; ?&gt; ???');if(cf)window.location='?cPub=list&amp;amp;cTask=delete&amp;amp;book_id=&lt;? echo $ROW['book_id']; ?&gt;';return false;&quot; title=&quot;Delete&quot;&gt;&lt;img src=&quot;images/delete.png&quot; alt=&quot;Delete&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?
}
?&gt;
&lt;/table&gt;
&lt;?
}
else
{
echo &quot;&lt;p&gt;No Query&lt;/p&gt;&quot;;
}
}
</pre>
<p>Well&#8230; I cannot explain each of line, but feel free to have fun while typing the code. Actually the code will diplaying List of Data Rows.</p>
<p>Next is Adding New Record. This code will displaying form for adding new record of data</p>
<pre class="brush: php; title: ; notranslate">

elseif($_GET['cPub'] == 'addnew')
{
?&gt;
&lt;?
if($_GET['Submit'] == 'SUBMIT' &amp;&amp; !empty($_GET['title']))
{
##INSERT NEW BOOK
if(!empty($_GET['category_id2']))
{
$choseCat = $_GET['category_id2'];
}
else
{
$choseCat = $_GET['category_id'];
}
$SQL = &quot;INSERT INTO book(title, category_id) VALUES('$_GET[title]', '$choseCat')&quot;;
if($db-&gt;query($SQL))
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;New Record Successfully Submited&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
echo &quot;&lt;p class='msg'&gt;E R R O R !&lt;/p&gt;&quot;;
}

##GET THE LAST ID FOR BOOK RECORD
$BOOKID = $db-&gt;fetch($db-&gt;query(&quot;SELECT * FROM book ORDER BY book_id DESC&quot;));

##INSERT NEW COLLECTION
for($i=0;$i&lt;=count($_GET['collection_data']);$i++)
{
if(!empty($_GET['collection_data'][$i]))
{
$SQLCOLLECTION = &quot;INSERT INTO collection(collection_data, book_id)
VALUES('&quot;.$_GET['collection_data'][$i].&quot;', '$BOOKID[book_id]')&quot;;
$db-&gt;query($SQLCOLLECTION);
}
}
}
?&gt;
&lt;div id=&quot;formM&quot;&gt;
&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;get&quot; action=&quot;&quot;&gt;
&lt;input name=&quot;cPub&quot; type=&quot;hidden&quot; value=&quot;&lt;? echo $_GET['cPub']; ?&gt;&quot; /&gt;
&lt;label&gt;&lt;span&gt;Book Title &lt;/span&gt;
&lt;input name=&quot;title&quot; type=&quot;text&quot; class=&quot;inputM&quot; id=&quot;title&quot; size=&quot;20&quot; /&gt;
&lt;/label&gt;

&lt;label&gt;&lt;span&gt;Category &lt;/span&gt;
&lt;div id=&quot;contenPanCategory&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCategory&quot;&gt;
&lt;select class=&quot;inputM&quot; name=&quot;category_id&quot; size=&quot;1&quot;&gt;
&lt;?
$QRYCAT = $db-&gt;query(&quot;SELECT * FROM category ORDER BY description&quot;);
while($ROWCAT = $db-&gt;fetch($QRYCAT))
{
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT['category_id']; ?&gt;&quot;&gt;&lt;? echo $ROWCAT['description']; ?&gt;&lt;/option&gt;
&lt;?
}
?&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;span class=&quot;note&quot;&gt; (* Your category not listed ? Manage &lt;a href=&quot;category-loader.php?cF=Manage&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=300&quot; class=&quot;thickbox&quot; title=&quot;Manage Category&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;javascript:void(0);&quot; title=&quot;Refresh Category List&quot; onClick=&quot;refreshCategory()&quot;&gt;refresh&lt;/a&gt;&lt;/span&gt;
&lt;/label&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;Collections &lt;/span&gt;
&lt;div id=&quot;fieldBox&quot;&gt;
&lt;div id=&quot;submenu&quot;&gt;
&lt;div id=&quot;icon&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;addFormField(); return false;&quot; title=&quot;Add New Collection&quot;&gt;&lt;img alt=&quot;Add New Collection&quot; src=&quot;images/addplus.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;input type=&quot;hidden&quot; id=&quot;id&quot; value=&quot;1&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;collection&quot;&gt;
&lt;div id=&quot;top-box&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-box&quot;&gt;
&lt;div id=&quot;text&quot;&gt;&lt;div id=&quot;divTxt&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id=&quot;bottom-box&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/label&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;SUBMIT&quot; class=&quot;buttonM&quot;/&gt;
&lt;/label&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;?
}
</pre>
<p>And this is for Editing Form code. Will used for update one of data record.</p>
<pre class="brush: php; title: ; notranslate">

elseif($_GET['cPub'] == 'edit')
{
?&gt;
&lt;?
if($_GET['Submit'] == 'UPDATE' &amp;&amp; !empty($_GET['title']))
{
##UPDATE CURRENT BOOK
if(!empty($_GET['category_id2']))
{
$choseCat = $_GET['category_id2'];
}
else
{
$choseCat = $_GET['category_id'];
}
$SQL = &quot;UPDATE book SET title='$_GET[title]', category_id='$choseCat' WHERE book_id='$_GET[book_id]'&quot;;
if($db-&gt;query($SQL))
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;Current Record Successfully Updated&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
echo &quot;&lt;p class='msg'&gt;E R R O R !&lt;/p&gt;&quot;;
}
}
?&gt;

&lt;?
$SQL = &quot;SELECT * FROM book WHERE book_id = '$_GET[book_id]'&quot;;
$ROW = $db-&gt;fetch($db-&gt;query($SQL));
?&gt;
&lt;div id=&quot;formM&quot;&gt;
&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;get&quot; action=&quot;&quot;&gt;
&lt;input name=&quot;cPub&quot; type=&quot;hidden&quot; value=&quot;&lt;? echo $_GET['cPub']; ?&gt;&quot; /&gt;
&lt;input name=&quot;book_id&quot; type=&quot;hidden&quot; value=&quot;&lt;? echo $_GET['book_id']; ?&gt;&quot; /&gt;
&lt;label&gt;&lt;span&gt;Book Title &lt;/span&gt;
&lt;input name=&quot;title&quot; value=&quot;&lt;? echo $ROW['title']; ?&gt;&quot; type=&quot;text&quot; class=&quot;inputM&quot; id=&quot;title&quot; size=&quot;20&quot; /&gt;
&lt;/label&gt;

&lt;label&gt;&lt;span&gt;Category &lt;/span&gt;
&lt;div id=&quot;contenPanCategory&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCategory&quot;&gt;
&lt;select class=&quot;inputM&quot; name=&quot;category_id&quot; size=&quot;1&quot;&gt;
&lt;?
$SQLCAT_CUR = &quot;SELECT * FROM category WHERE category_id = '$ROW[category_id]'&quot;;
$ROWCAT_CUR = $db-&gt;fetch($db-&gt;query($SQLCAT_CUR));
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT_CUR['category_id']; ?&gt;&quot;&gt;- &lt;? echo $ROWCAT_CUR['description']; ?&gt; -&lt;/option&gt;
&lt;?
$SQLCAT = &quot;SELECT * FROM category ORDER BY description&quot;;
$QRYCAT = $db-&gt;query($SQLCAT);
while($ROWCAT = $db-&gt;fetch($QRYCAT))
{
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT['category_id']; ?&gt;&quot;&gt;&lt;? echo $ROWCAT['description']; ?&gt;&lt;/option&gt;
&lt;?
}
?&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;span class=&quot;note&quot;&gt; (* Your category not listed ? Manage &lt;a href=&quot;category-loader.php?cF=Manage&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=300&quot; class=&quot;thickbox&quot; title=&quot;Manage Category&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;javascript:void(0);&quot; title=&quot;Refresh Category List&quot; onClick=&quot;refreshCategory()&quot;&gt;refresh&lt;/a&gt;&lt;/span&gt;
&lt;/label&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;Collections &lt;/span&gt;
&lt;div id=&quot;fieldBox&quot;&gt;
&lt;div id=&quot;submenu&quot;&gt;
&lt;div id=&quot;icon&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; title=&quot;Refresh Collection Data&quot; onClick=&quot;refreshCollection(&lt;? echo $ROW['book_id']; ?&gt;, 0)&quot;&gt;&lt;img alt=&quot;Refresh Collection Data&quot; src=&quot;images/refresh.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;icon&quot; class=&quot;space&quot;&gt;&lt;a href=&quot;ui-collection.php?cF=Input&amp;amp;book_id=&lt;? echo $ROW['book_id'];?&gt;&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=300&quot; class=&quot;thickbox&quot; title=&quot;Add New Collection&quot;&gt;&lt;img alt=&quot;Add New Collection&quot; src=&quot;images/addplus.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;icon&quot; class=&quot;space&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Are you sure to remove all collection data ???');if(cf)refreshCollection(&lt;? echo $ROW['book_id']; ?&gt;, 1);return false;&quot; title=&quot;Remove All Collection&quot;&gt;&lt;img alt=&quot;Remove All Collection&quot; src=&quot;images/remove.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;collection&quot;&gt;
&lt;div id=&quot;top-box&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-box&quot;&gt;
&lt;div id=&quot;text&quot;&gt;
&lt;div id=&quot;contenPanCollection&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCollection&quot;&gt;
&lt;iframe width=&quot;300&quot; name=&quot;refreshCollectionFrame&quot; src=&quot;ui-collection.php?book_id=&lt;? echo $ROW['book_id']; ?&gt;&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot;&gt;
&lt;/iframe&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;bottom-box&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/label&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;UPDATE&quot; class=&quot;buttonM&quot;/&gt;
&lt;/label&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;?
}
else
{
echo &quot;&lt;p&gt;You are in Administrator Page. Select Main Menu to Manage your data.&lt;/p&gt;&quot;;
}
?&gt;
</pre>
<p>The last is let me type my copyright website</p>
<pre class="brush: xml; title: ; notranslate">

&lt;div id=&quot;footer&quot;&gt;
&amp;copy; Copyright 2009 dr.emi creative design { &lt;a href=&quot;http://www.dremi.info&quot; target=&quot;_blank&quot;&gt;www.dremi.info&lt;/a&gt; }
&lt;/div&gt;
</pre>
<p><strong>IFRAME</strong> code will load <strong>ui-collection.php</strong> that contain used for displaying collection data of current data row.       DIV ID contenPanCollection is ID that used by jQuery Ajax as target for Dynamic Collection Data. To activated it, I use  <strong>onClick=&#8221;refreshCollection(&lt;? echo $ROW['book_id']; ?&gt;, 0)&#8221;</strong>.      While refreshCollection function executed, the condition  is hidding DIV ID <strong>toBeHideCollection</strong> and show DIV ID <strong>contenPanCollection</strong>.       The other example of dynamic field is refreshCategory javascript function to load dynamicly <strong>category-loader.php</strong></p>
<p><strong>How about thickbox plugin ?</strong></p>
<p>ThickBox jQuery plugin used for displaying unit interface for Add New Collection link or manage category link.      As you see, to define class of thickbox plugin, just use <strong>class=&#8221;thickbox&#8221;</strong>, and to define width and height of unit interface, just change parameter of width and height from this line:</p>
<pre class="brush: xml; title: ; notranslate">   keepThis=true&amp;TB_iframe=true&amp;height=250&amp;width=300   </pre>
<p>And this is code of <strong>ui-collection.php</strong></p>
<pre class="brush: php; title: ; notranslate">

&lt;?
define(&quot;_VALID_ACCESS&quot;, true);

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}
//echo $_SERVER['REQUEST_URI'];
include_once &quot;dre-config.php&quot;;
include_once &quot;db.php&quot;;
include_once &quot;function.php&quot;;
$db = new mydb;
?&gt;
&lt;style media=&quot;all&quot; type=&quot;text/css&quot;&gt;
* {
background:#ffffff;
color:#2a2a2a;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
&lt;/style&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.highlightFade.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/dynamic-form.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/ajax-display.js&quot;&gt;&lt;/script&gt;

&lt;?
$book_id=intval($_GET['book_id']);

$cDel=intval($_GET['cDel']);
$db-&gt;connect(_DB_HOST, _DB_USER, _DB_PASS, _DB_NAME); //changet the configuration in required

?&gt;

&lt;?
if($_GET['cF'] == 'Delete')
{
$db-&gt;query(&quot;DELETE FROM collection WHERE collection_id = '$_GET[collection_id]'&quot;);
redirect(0, &quot;$_SERVER[PHP_SELF]?book_id=$_GET[book_id]&quot;);
}
elseif($cDel == 1)
{
$chk4Del = $db-&gt;numrows($db-&gt;query(&quot;SELECT * FROM collection
WHERE book_id = '$book_id'&quot;));
if($chk4Del &gt;= 1)
{

if($db-&gt;query(&quot;DELETE FROM collection WHERE book_id = '$book_id'&quot;))
{
alert2(&quot;All Collection data has been deleted !&quot;);
}

}
else
{
alert2(&quot;I didn't deleted anything !&quot;);
}
}
elseif($_GET['cF'] == 'Edit')
{
if($_POST['update'] &amp;&amp; !empty($_POST['collection_data']))
{
$db-&gt;query(&quot;UPDATE collection SET collection_data = '$_POST[collection_data]' WHERE collection_id = '$_GET[collection_id]'&quot;);
redirect(0, &quot;$_SERVER[PHP_SELF]?book_id=$_GET[book_id]&quot;);
}

$e_data_collection = $db-&gt;fetch($db-&gt;query(&quot;SELECT * FROM collection WHERE collection_id = '$_GET[collection_id]'&quot;));
?&gt;
&lt;p style=&quot;font-weight:bold&quot;&gt;Edit Data for Collection&lt;/p&gt;
&lt;form name=&quot;miniForm&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;book_id&quot; value=&quot;&lt;? echo $_GET['book_id']; ?&gt;&quot; /&gt;
&lt;input class=&quot;miniInput&quot; type=&quot;text&quot; name=&quot;collection_data&quot; value=&quot;&lt;? echo $e_data_collection['collection_data']; ?&gt;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;submit&quot; name=&quot;update&quot; value=&quot;update&quot;&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;button&quot; name=&quot;cancel&quot; onclick=&quot;javascript:history.go(-1);&quot; value=&quot;cancel&quot;&gt;
&lt;/form&gt;
&lt;?
}
elseif($_GET['cF'] == 'Input')
{
if($_POST['submit'])
{
for($i=0;$i&lt;=count($_POST['collection_data']);$i++)
{
if(!empty($_POST['collection_data'][$i]))
{
$SQLCOLLECTION = &quot;INSERT INTO collection(collection_data, book_id) VALUES('&quot;.$_POST['collection_data'][$i].&quot;', '$_POST[book_id]')&quot;;
if($db-&gt;query($SQLCOLLECTION))
{
echo &quot;Collection Data $i Submited Successfully.&lt;br&gt;&quot;;
}
}
}
}

?&gt;
&lt;p style=&quot;font-weight:bold&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;addFormField(); return false;&quot; title=&quot;Add New Collection&quot;&gt;&lt;img alt=&quot;Add New Collection&quot; src=&quot;images/add.png&quot; border=&quot;0&quot; /&gt; Add New Collection Data&lt;/a&gt;&lt;input type=&quot;hidden&quot; id=&quot;id&quot; value=&quot;1&quot;&gt;&lt;/p&gt;
&lt;form name=&quot;miniForm&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;book_id&quot; value=&quot;&lt;? echo $_GET['book_id']; ?&gt;&quot; /&gt;
&lt;div id=&quot;divTxt&quot;&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot;&gt;
&lt;/form&gt;
&lt;?
}
else
{
?&gt;

&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
&lt;tr&gt;
&lt;td width=&quot;5%&quot; bgcolor=&quot;#efefef&quot;&gt;No.&lt;/td&gt;
&lt;td width=&quot;26%&quot; bgcolor=&quot;#efefef&quot;&gt;Collection Data &lt;/td&gt;
&lt;td width=&quot;20%&quot; bgcolor=&quot;#efefef&quot;&gt;&lt;center&gt;Option&lt;/center&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?
$q_data_colllection = $db-&gt;query(&quot;SELECT * FROM collection WHERE book_id = '$book_id'&quot;);
while($r_data_colllection = $db-&gt;fetch($q_data_colllection))
{
$i++;
?&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#ffffff&quot;&gt;&lt;? echo $i; ?&gt;&lt;/td&gt;
&lt;td bgcolor=&quot;#ffffff&quot;&gt;&lt;? echo $r_data_colllection['collection_data']; ?&gt; &lt;/td&gt;
&lt;td valign=&quot;top&quot; bgcolor=&quot;#ffffff&quot;&gt;&lt;center&gt;
&lt;a alt=&quot;Edit Collection Data No. &lt;? echo $i; ?&gt;&quot; title=&quot;Edit Collection Data No. &lt;? echo $i; ?&gt;&quot; href=&quot;?cF=Edit&amp;book_id=&lt;? echo $_GET['book_id'] ?&gt;&amp;collection_id=&lt;? echo $r_data_colllection['collection_id'] ?&gt;&quot; class=&quot;thickbox&quot;&gt;&lt;img alt=&quot;Edit Collection Data No. &lt;? echo $i; ?&gt;&quot; title=&quot;Edit Collection Data No. &lt;? echo $i; ?&gt;&quot; src=&quot;images/edit.png&quot; border=&quot;0&quot; width=&quot;16px;&quot; height=&quot;16px;&quot; /&gt;&lt;/a&gt;

&lt;a alt=&quot;Delete Collection Data No. &lt;? echo $i; ?&gt;&quot; title=&quot;Delete Collection Data No. &lt;? echo $i; ?&gt;&quot; href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Are you sure to delete No. &lt;? echo $i; ?&gt; ???');if(cf)window.location='?cF=Delete&amp;book_id=&lt;? echo $_GET['book_id'] ?&gt;&amp;collection_id=&lt;? echo $r_data_colllection['collection_id'] ?&gt;';return false;&quot;&gt;&lt;img alt=&quot;Delete Collection Data No. &lt;? echo $i; ?&gt;&quot; title=&quot;Delete Collection Data No. &lt;? echo $i; ?&gt;&quot; src=&quot;images/delete.png&quot; border=&quot;0&quot; width=&quot;16px;&quot; height=&quot;16px;&quot; /&gt;&lt;/a&gt;
&lt;/center&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?
}
?&gt;
&lt;/table&gt;

&lt;?
}
?&gt;
</pre>
<p>PHP code for <strong>category-loader.php</strong></p>
<pre class="brush: php; title: ; notranslate">

&lt;?
define(&quot;_VALID_ACCESS&quot;, true);

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}
//echo $_SERVER['REQUEST_URI'];
include_once &quot;dre-config.php&quot;;
include_once &quot;db.php&quot;;
include_once &quot;function.php&quot;;
$db = new mydb;
?&gt;
&lt;?
$category_id=intval($_GET['category_id']);
$cDel=intval($_GET['cDel']);
$db-&gt;connect(_DB_HOST, _DB_USER, _DB_PASS, _DB_NAME); //changet the configuration if required
?&gt;
&lt;?
if($_GET['cF'] == 'Delete')
{
$db-&gt;query(&quot;DELETE FROM category WHERE category_id = '$_GET[category_id]'&quot;);
redirect(0, &quot;$_SERVER[PHP_SELF]?cF=Manage&quot;);
}
elseif($_GET['cF'] == 'Edit')
{
if($_POST['update'] &amp;&amp; !empty($_POST['description']))
{
$db-&gt;query(&quot;UPDATE category SET description = '$_POST[description]' WHERE category_id = '$_GET[category_id]'&quot;);
redirect(0, &quot;$_SERVER[PHP_SELF]?cF=Manage&quot;);
}

$e_data_category = $db-&gt;fetch($db-&gt;query(&quot;SELECT * FROM category WHERE category_id = '$_GET[category_id]'&quot;));
?&gt;
&lt;style media=&quot;all&quot; type=&quot;text/css&quot;&gt;
* {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
&lt;/style&gt;
&lt;p style=&quot;font-weight:bold&quot;&gt;Edit Data for Category&lt;/p&gt;
&lt;form name=&quot;miniForm&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;
&lt;input title='Type new category' type=&quot;text&quot; name='description' value=&quot;&lt;? echo $e_data_category['description']; ?&gt;&quot; size='35'&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;submit&quot; name=&quot;update&quot; value=&quot;update&quot;&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;button&quot; name=&quot;cancel&quot; onclick=&quot;javascript:history.go(-1);&quot; value=&quot;cancel&quot;&gt;
&lt;/form&gt;
&lt;?
}
elseif($_GET['cF'] == 'Manage')
{
?&gt;
&lt;style media=&quot;all&quot; type=&quot;text/css&quot;&gt;
* {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
&lt;/style&gt;
&lt;p style=&quot;font-weight:bold&quot;&gt;&lt;a href=&quot;?cF=Input&quot; title=&quot;Add New Category&quot;&gt;&lt;img alt=&quot;Add New Category&quot; src=&quot;images/add.png&quot; border=&quot;0&quot; /&gt; Add New Category&lt;/a&gt;&lt;/p&gt;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
&lt;tr&gt;
&lt;td width=&quot;5%&quot; bgcolor=&quot;#efefef&quot;&gt;No.&lt;/td&gt;
&lt;td width=&quot;26%&quot; bgcolor=&quot;#efefef&quot;&gt;Category Name&lt;/td&gt;
&lt;td width=&quot;20%&quot; bgcolor=&quot;#efefef&quot;&gt;&lt;center&gt;Option&lt;/center&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?
$q_data_category = $db-&gt;query(&quot;SELECT * FROM category ORDER BY description&quot;);
while($r_data_category = $db-&gt;fetch($q_data_category))
{
$i++;
?&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#ffffff&quot;&gt;&lt;? echo $i; ?&gt;&lt;/td&gt;
&lt;td bgcolor=&quot;#ffffff&quot;&gt;&lt;? echo $r_data_category['description']; ?&gt; &lt;/td&gt;
&lt;td valign=&quot;top&quot; bgcolor=&quot;#ffffff&quot;&gt;&lt;center&gt;
&lt;a alt=&quot;Edit Collection Data No. &lt;? echo $i; ?&gt;&quot; title=&quot;Edit Category No. &lt;? echo $i; ?&gt;&quot; href=&quot;?cF=Edit&amp;category_id=&lt;? echo $r_data_category['category_id'] ?&gt;&quot; class=&quot;thickbox&quot;&gt;&lt;img alt=&quot;Edit Category No. &lt;? echo $i; ?&gt;&quot; title=&quot;Edit Category No. &lt;? echo $i; ?&gt;&quot; src=&quot;images/edit.png&quot; border=&quot;0&quot; width=&quot;16px;&quot; height=&quot;16px;&quot; /&gt;&lt;/a&gt;

&lt;a alt=&quot;Delete Category No. &lt;? echo $i; ?&gt;&quot; title=&quot;Delete Category No. &lt;? echo $i; ?&gt;&quot; href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Are you sure to delete No. &lt;? echo $i; ?&gt; ???');if(cf)window.location='?cF=Delete&amp;category_id=&lt;? echo $r_data_category['category_id'] ?&gt;';return false;&quot;&gt;&lt;img alt=&quot;Delete Category Data No. &lt;? echo $i; ?&gt;&quot; title=&quot;Delete Category No. &lt;? echo $i; ?&gt;&quot; src=&quot;images/delete.png&quot; border=&quot;0&quot; width=&quot;16px;&quot; height=&quot;16px;&quot; /&gt;&lt;/a&gt;
&lt;/center&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?
}
?&gt;
&lt;/table&gt;
&lt;?
}
elseif($_GET['cF'] == 'Input')
{
if($_POST['submit'] &amp;&amp; !empty($_POST['description']))
{
$SQL = &quot;INSERT INTO category(description) VALUES('$_POST[description]')&quot;;
if($db-&gt;query($SQL))
{
redirect(0, &quot;$_SERVER[PHP_SELF]?cF=Manage&quot;);
}
}

?&gt;
&lt;style media=&quot;all&quot; type=&quot;text/css&quot;&gt;
* {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
&lt;/style&gt;
&lt;form name=&quot;miniForm&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;
&lt;input title='Type new category' type=&quot;text&quot; name='description' size='35'&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot;&gt;
&lt;input class=&quot;miniSubmit&quot; type=&quot;button&quot; name=&quot;cancel&quot; onclick=&quot;javascript:history.go(-1);&quot; value=&quot;cancel&quot;&gt;
&lt;/form&gt;
&lt;?
}
else
{
?&gt;
&lt;select class=&quot;inputM&quot; name=&quot;category_id2&quot; size=&quot;1&quot;&gt;
&lt;?
$SQLCAT = &quot;SELECT * FROM category ORDER BY description&quot;;
$QRYCAT = $db-&gt;query($SQLCAT);
while($ROWCAT = $db-&gt;fetch($QRYCAT))
{
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT['category_id']; ?&gt;&quot;&gt;&lt;? echo $ROWCAT['description']; ?&gt;&lt;/option&gt;
&lt;?
}
?&gt;
&lt;/select&gt;
&lt;?
}
?&gt;
</pre>
<p>PHP Code for <strong>frame-collection-loader.php</strong></p>
<pre class="brush: xml; title: ; notranslate">

&lt;iframe width=&quot;300&quot; name=&quot;refreshCollectionFrame&quot; src=&quot;ui-collection.php?book_id=&lt;? echo $_GET['book_id']; ?&gt;&amp;cDel=&lt;? echo $_GET['cDel']; ?&gt;&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot;&gt;
&lt;/iframe&gt;
</pre>
<p>Here are the complete <strong>index.php</strong> code</p>
<pre class="brush: php; title: ; notranslate">

&lt;?
/**
#
# Building Administrator Manager for Table Relation Using PHP and jQuery
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Website http://dremi.info
# License: GPL
# File: index.php
#
**/

##YOU MAY ADD SOME AUTHENTICATION CODE FOR USER LOGIN HERE
define(&quot;_VALID_ACCESS&quot;, true);

if(!defined('_VALID_ACCESS'))
{
die(&quot;Direct Access Are Not Allow&quot;);
}

include_once &quot;dre-config.php&quot;;
include_once &quot;db.php&quot;;
include_once &quot;function.php&quot;;

$db = new mydb;
$db-&gt;connect(_DB_HOST, _DB_USER, _DB_PASS, _DB_NAME);
?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Building Administrator Manager for Table Relation Using PHP and jQuery&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.highlightFade.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/dynamic-form.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/ajax-display.js&quot;&gt;&lt;/script&gt;
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
@import &quot;js/thickbox/thickbox.css&quot;;
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/thickbox/thickbox.js&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;!--

#
# Building Administrator Manager for Table Relation Using PHP and jQuery
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Website http://dremi.info
# License: GPL
#

--&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;ajax_display&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;mainPan&quot;&gt;
&lt;div id=&quot;bodyPan&quot;&gt;
&lt;div id=&quot;header&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;menu&quot;&gt;
&lt;div id=&quot;welcome&quot;&gt;Welcome. Today is &lt;? echo date(&quot;F j, Y, g:i a&quot;); ?&gt;&lt;/div&gt;
&lt;a href=&quot;?cPub=addnew&quot;&gt;&lt;div id=&quot;addnew&quot;&gt;ADD NEW&lt;/div&gt;&lt;/a&gt;
&lt;a href=&quot;?cPub=list&quot;&gt;&lt;div id=&quot;list&quot;&gt;LIST&lt;/div&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id=&quot;content&quot;&gt;
&lt;div id=&quot;top-content&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-content&quot;&gt;
&lt;div id=&quot;text&quot;&gt;
&lt;?
if($_GET['cPub'] == 'list')
{
if($_GET['cTask'] == 'delete')
{
$CHK = &quot;SELECT * FROM collection WHERE book_id = '$_GET[book_id]'&quot;;
$SQL = &quot;DELETE FROM book WHERE book_id = '$_GET[book_id]'&quot;;

##FIRST CHECK IT FOR COLLECTION
$COLL= $db-&gt;numrows($db-&gt;query($CHK));

if($COLL &gt; 0)
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;You cannot delete BOOK ID = $_GET[book_id]. This record still have $COLL collection data&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
if($QRY = $db-&gt;query($SQL))
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;Successfully Delete for BOOK ID = $_GET[book_id]&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;Error: Delete for BOOK ID = $_GET[book_id]&lt;span&gt;&lt;/p&gt;&quot;;
}
}
}

$SQL = &quot;SELECT * FROM book ORDER BY book_id DESC&quot;;
$QRY = $db-&gt;query($SQL);
$NUM = $db-&gt;numrows($QRY);
$i = 0;
if($NUM &gt; 0)
{
?&gt;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot; id=&quot;maintable&quot;&gt;
&lt;tr&gt;
&lt;td width=&quot;5%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;No.&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;47%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Book Title&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;24%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Category&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;10%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Collection&lt;/span&gt;&lt;/td&gt;
&lt;td width=&quot;14%&quot; bgcolor=&quot;#003366&quot;&gt;&lt;span style=&quot;color:#FFFFFF; font-weight:bold;&quot;&gt;Option&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?
while($ROW = $db-&gt;fetch($QRY))
{
$i++;

?&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;&lt;? echo $i; ?&gt;&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;&lt;? echo $ROW['title']; ?&gt;&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;&lt;?
$CATROW = $db-&gt;fetch($db-&gt;query(&quot;SELECT * FROM category WHERE category_id = '$ROW[category_id]'&quot;));
echo $CATROW['description'];
?&gt;
&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;
&lt;?
##NUMBER OF COLLECTION
$COLLECTION_NUMBER = $db-&gt;numrows($db-&gt;query(&quot;SELECT * FROM collection WHERE book_id = '$ROW[book_id]'&quot;));
echo $COLLECTION_NUMBER;
?&gt;
&lt;/td&gt;
&lt;td bgcolor=&quot;#B7C0FF&quot;&gt;
&lt;a href=&quot;ui-collection.php?book_id=&lt;? echo $ROW['book_id']; ?&gt;&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=500&quot; class=&quot;thickbox&quot; title=&quot;View Collection of &lt;? echo $ROW['title']; ?&gt;&quot;&gt;&lt;img src=&quot;images/zoom16.png&quot; alt=&quot;View Collection&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href=&quot;?cPub=edit&amp;amp;book_id=&lt;? echo $ROW['book_id']; ?&gt;&quot; title=&quot;Edit&quot;&gt;&lt;img src=&quot;images/edit.png&quot; alt=&quot;Edit&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Are you sure to delete No. &lt;? echo $i; ?&gt; ???');if(cf)window.location='?cPub=list&amp;amp;cTask=delete&amp;amp;book_id=&lt;? echo $ROW['book_id']; ?&gt;';return false;&quot; title=&quot;Delete&quot;&gt;&lt;img src=&quot;images/delete.png&quot; alt=&quot;Delete&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?
}
?&gt;
&lt;/table&gt;
&lt;?
}
else
{
echo &quot;&lt;p&gt;No Query&lt;/p&gt;&quot;;
}
}
elseif($_GET['cPub'] == 'addnew')
{
?&gt;
&lt;?
if($_GET['Submit'] == 'SUBMIT' &amp;&amp; !empty($_GET['title']))
{
##INSERT NEW BOOK
if(!empty($_GET['category_id2']))
{
$choseCat = $_GET['category_id2'];
}
else
{
$choseCat = $_GET['category_id'];
}
$SQL = &quot;INSERT INTO book(title, category_id) VALUES('$_GET[title]', '$choseCat')&quot;;
if($db-&gt;query($SQL))
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;New Record Successfully Submited&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
echo &quot;&lt;p class='msg'&gt;E R R O R !&lt;/p&gt;&quot;;
}

##GET THE LAST ID FOR BOOK RECORD
$BOOKID = $db-&gt;fetch($db-&gt;query(&quot;SELECT * FROM book ORDER BY book_id DESC&quot;));

##INSERT NEW COLLECTION
for($i=0;$i&lt;=count($_GET['collection_data']);$i++)
{
if(!empty($_GET['collection_data'][$i]))
{
$SQLCOLLECTION = &quot;INSERT INTO collection(collection_data, book_id)
VALUES('&quot;.$_GET['collection_data'][$i].&quot;', '$BOOKID[book_id]')&quot;;
$db-&gt;query($SQLCOLLECTION);
}
}
}
?&gt;
&lt;div id=&quot;formM&quot;&gt;
&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;get&quot; action=&quot;&quot;&gt;
&lt;input name=&quot;cPub&quot; type=&quot;hidden&quot; value=&quot;&lt;? echo $_GET['cPub']; ?&gt;&quot; /&gt;
&lt;label&gt;&lt;span&gt;Book Title &lt;/span&gt;
&lt;input name=&quot;title&quot; type=&quot;text&quot; class=&quot;inputM&quot; id=&quot;title&quot; size=&quot;20&quot; /&gt;
&lt;/label&gt;

&lt;label&gt;&lt;span&gt;Category &lt;/span&gt;
&lt;div id=&quot;contenPanCategory&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCategory&quot;&gt;
&lt;select class=&quot;inputM&quot; name=&quot;category_id&quot; size=&quot;1&quot;&gt;
&lt;?
$QRYCAT = $db-&gt;query(&quot;SELECT * FROM category ORDER BY description&quot;);
while($ROWCAT = $db-&gt;fetch($QRYCAT))
{
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT['category_id']; ?&gt;&quot;&gt;&lt;? echo $ROWCAT['description']; ?&gt;&lt;/option&gt;
&lt;?
}
?&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;span class=&quot;note&quot;&gt; (* Your category not listed ? Manage &lt;a href=&quot;category-loader.php?cF=Manage&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=300&quot; class=&quot;thickbox&quot; title=&quot;Manage Category&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;javascript:void(0);&quot; title=&quot;Refresh Category List&quot; onClick=&quot;refreshCategory()&quot;&gt;refresh&lt;/a&gt;&lt;/span&gt;
&lt;/label&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;Collections &lt;/span&gt;
&lt;div id=&quot;fieldBox&quot;&gt;
&lt;div id=&quot;submenu&quot;&gt;
&lt;div id=&quot;icon&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;addFormField(); return false;&quot; title=&quot;Add New Collection&quot;&gt;&lt;img alt=&quot;Add New Collection&quot; src=&quot;images/addplus.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;input type=&quot;hidden&quot; id=&quot;id&quot; value=&quot;1&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;collection&quot;&gt;
&lt;div id=&quot;top-box&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-box&quot;&gt;
&lt;div id=&quot;text&quot;&gt;&lt;div id=&quot;divTxt&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id=&quot;bottom-box&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/label&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;SUBMIT&quot; class=&quot;buttonM&quot;/&gt;
&lt;/label&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;?
}
elseif($_GET['cPub'] == 'edit')
{
?&gt;
&lt;?
if($_GET['Submit'] == 'UPDATE' &amp;&amp; !empty($_GET['title']))
{
##UPDATE CURRENT BOOK
if(!empty($_GET['category_id2']))
{
$choseCat = $_GET['category_id2'];
}
else
{
$choseCat = $_GET['category_id'];
}
$SQL = &quot;UPDATE book SET title='$_GET[title]', category_id='$choseCat' WHERE book_id='$_GET[book_id]'&quot;;
if($db-&gt;query($SQL))
{
echo &quot;&lt;p class='msg'&gt;&lt;span&gt;Current Record Successfully Updated&lt;/span&gt;&lt;/p&gt;&quot;;
}
else
{
echo &quot;&lt;p class='msg'&gt;E R R O R !&lt;/p&gt;&quot;;
}
}
?&gt;

&lt;?
$SQL = &quot;SELECT * FROM book WHERE book_id = '$_GET[book_id]'&quot;;
$ROW = $db-&gt;fetch($db-&gt;query($SQL));
?&gt;
&lt;div id=&quot;formM&quot;&gt;
&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;get&quot; action=&quot;&quot;&gt;
&lt;input name=&quot;cPub&quot; type=&quot;hidden&quot; value=&quot;&lt;? echo $_GET['cPub']; ?&gt;&quot; /&gt;
&lt;input name=&quot;book_id&quot; type=&quot;hidden&quot; value=&quot;&lt;? echo $_GET['book_id']; ?&gt;&quot; /&gt;
&lt;label&gt;&lt;span&gt;Book Title &lt;/span&gt;
&lt;input name=&quot;title&quot; value=&quot;&lt;? echo $ROW['title']; ?&gt;&quot; type=&quot;text&quot; class=&quot;inputM&quot; id=&quot;title&quot; size=&quot;20&quot; /&gt;
&lt;/label&gt;

&lt;label&gt;&lt;span&gt;Category &lt;/span&gt;
&lt;div id=&quot;contenPanCategory&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCategory&quot;&gt;
&lt;select class=&quot;inputM&quot; name=&quot;category_id&quot; size=&quot;1&quot;&gt;
&lt;?
$SQLCAT_CUR = &quot;SELECT * FROM category WHERE category_id = '$ROW[category_id]'&quot;;
$ROWCAT_CUR = $db-&gt;fetch($db-&gt;query($SQLCAT_CUR));
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT_CUR['category_id']; ?&gt;&quot;&gt;- &lt;? echo $ROWCAT_CUR['description']; ?&gt; -&lt;/option&gt;
&lt;?
$SQLCAT = &quot;SELECT * FROM category ORDER BY description&quot;;
$QRYCAT = $db-&gt;query($SQLCAT);
while($ROWCAT = $db-&gt;fetch($QRYCAT))
{
?&gt;
&lt;option value=&quot;&lt;? echo $ROWCAT['category_id']; ?&gt;&quot;&gt;&lt;? echo $ROWCAT['description']; ?&gt;&lt;/option&gt;
&lt;?
}
?&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;span class=&quot;note&quot;&gt; (* Your category not listed ? Manage &lt;a href=&quot;category-loader.php?cF=Manage&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=300&quot; class=&quot;thickbox&quot; title=&quot;Manage Category&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;javascript:void(0);&quot; title=&quot;Refresh Category List&quot; onClick=&quot;refreshCategory()&quot;&gt;refresh&lt;/a&gt;&lt;/span&gt;
&lt;/label&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;Collections &lt;/span&gt;
&lt;div id=&quot;fieldBox&quot;&gt;
&lt;div id=&quot;submenu&quot;&gt;
&lt;div id=&quot;icon&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; title=&quot;Refresh Collection Data&quot; onClick=&quot;refreshCollection(&lt;? echo $ROW['book_id']; ?&gt;, 0)&quot;&gt;&lt;img alt=&quot;Refresh Collection Data&quot; src=&quot;images/refresh.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;icon&quot; class=&quot;space&quot;&gt;&lt;a href=&quot;ui-collection.php?cF=Input&amp;amp;book_id=&lt;? echo $ROW['book_id'];?&gt;&amp;amp;keepThis=true&amp;amp;TB_iframe=true&amp;amp;height=250&amp;amp;width=300&quot; class=&quot;thickbox&quot; title=&quot;Add New Collection&quot;&gt;&lt;img alt=&quot;Add New Collection&quot; src=&quot;images/addplus.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;icon&quot; class=&quot;space&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;cf=confirm('Are you sure to remove all collection data ???');if(cf)refreshCollection(&lt;? echo $ROW['book_id']; ?&gt;, 1);return false;&quot; title=&quot;Remove All Collection&quot;&gt;&lt;img alt=&quot;Remove All Collection&quot; src=&quot;images/remove.gif&quot; width=&quot;32&quot; height=&quot;29&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;collection&quot;&gt;
&lt;div id=&quot;top-box&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;center-box&quot;&gt;
&lt;div id=&quot;text&quot;&gt;
&lt;div id=&quot;contenPanCollection&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;toBeHideCollection&quot;&gt;
&lt;iframe width=&quot;300&quot; name=&quot;refreshCollectionFrame&quot; src=&quot;ui-collection.php?book_id=&lt;? echo $ROW['book_id']; ?&gt;&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot;&gt;
&lt;/iframe&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;bottom-box&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/label&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;label&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;UPDATE&quot; class=&quot;buttonM&quot;/&gt;
&lt;/label&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;?
}
else
{
echo &quot;&lt;p&gt;You are in Administrator Page. Select Main Menu to Manage your data.&lt;/p&gt;&quot;;
}
?&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;bottom-content&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id=&quot;footer&quot;&gt;
&amp;copy; Copyright 2009 dr.emi creative design { &lt;a href=&quot;http://www.dremi.info&quot; target=&quot;_blank&quot;&gt;www.dremi.info&lt;/a&gt; }
&lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Oukeh!!!! I think all hand code was appear on your apache server. Try it with type this URL on your browser:</p>
<p>http://localhost/foldername/index.php</p>
<p>And this is screenshoot of Index.php within load default content</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation33.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation33.png" alt="" width="710" height="647" /></a></div>
<p>Just click on main menu to try the result of dynamic content.</p>
<p>Screenshoot for Add New Record</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation35.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation35.png" alt="" width="712" height="677" /></a></div>
<p>Screenshoot for Listing Record</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation36.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation36.png" alt="" width="718" height="640" /></a></div>
<p>Screenshoot for View Collection Data, using unit interface</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation37.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation37.png" alt="" width="717" height="629" /></a></div>
<p>Screenshoot for Dynamic Refresh of Collection Data</p>
<div id="img"><a class="thickbox" href="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation38.png"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Relation%20Table/table-relation38.png" alt="" width="709" height="682" /></a></div>
<p>Feel free to try the demo on my demo page, and do not forget to leave your comment for suggest, critics, report or bug.</p>
<p>Now, you has been successfully to create your Administrator Page to Manage Some Relation Table Using PHP as main programming language and jQuery to give some interactivity result for dynamic form.</p>
<p>Regard, <strong>Hairul Azami</strong> a.k.a <strong>dr.emi</strong></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/building-administrator-manager-for-table-relation-using-php-and-jquery.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/building-administrator-manager-for-table-relation-using-php-and-jquery.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=870&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/YDAlKkCpuzLsaCIzioawKvnP3qo/0/da"><img src="http://feedads.g.doubleclick.net/~a/YDAlKkCpuzLsaCIzioawKvnP3qo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YDAlKkCpuzLsaCIzioawKvnP3qo/1/da"><img src="http://feedads.g.doubleclick.net/~a/YDAlKkCpuzLsaCIzioawKvnP3qo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/GT_G9gbjsyw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/building-administrator-manager-for-table-relation-using-php-and-jquery.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/building-administrator-manager-for-table-relation-using-php-and-jquery.html</feedburner:origLink></item>
		<item>
		<title>How to Modifiying SMF User Register Page to Protect from Spammer or Junker</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/E6mo4OaV4NI/how-to-modifiying-smf-user-register-page-to-protect-from-spammer-or-junker.html</link>
		<comments>http://www.dremi.info/tutorials/php/how-to-modifiying-smf-user-register-page-to-protect-from-spammer-or-junker.html#comments</comments>
		<pubDate>Sat, 27 Jun 2009 15:23:59 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[modifiying smf]]></category>
		<category><![CDATA[personal verification]]></category>
		<category><![CDATA[smf template coding]]></category>
		<category><![CDATA[visual verification]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=853</guid>
		<description><![CDATA[Hello my fox! glad to see you today. For more than one week, I got spam and bad posting (junk) on my forum . But today I hope no more again. I think this tutorial will help you, how to modifiying SMF User Register Page to protect from spammer or junker. As you know, SMF [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/modif-smf200.png" alt="" />Hello my fox! glad to see you today. For more than one week, I got spam and bad posting (junk) on my forum . But today I hope no more again. I think this tutorial will help you, how to modifiying SMF User Register Page to protect from spammer or junker. As you know, SMF has Spam Protection like Captcha, called as Visual Verification. For a simple spam protection, I think captcha is enough for your forum register protection. But how if users do register and then make some posting on your forum ?<br />
<span id="more-853"></span></p>
<div class="clear">&nbsp;</div>
<p>As you know, forum is place for your community to discuss about your website or other, and absolutly your website have members. But becarefull, how if your member only want to post spam or junk maybe. You will not have more time to moderate the junk or spam posts.</p>
<p>It explain about, we need personal verification for the register user page. So we must modify the user register page. Actually SMF has a default template for displaying user register, you can found it at: /SMF-Folder/Themes/default/Register.template.php</p>
<p>Just begin from this file, open it and find this line:</p>
<pre class="brush: php; title: ; notranslate">if ($context['visual_verification'])</pre>
<p>Before these line, you will see table structure for password field.</p>
<pre class="brush: php; title: ; notranslate">
&lt;tr&gt;
&lt;td width=&quot;40%&quot;&gt;
&lt;b&gt;', $txt[82], ':&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;input type=&quot;password&quot; name=&quot;passwrd2&quot; size=&quot;30&quot; tabindex=&quot;', $context['tabindex']++, '&quot; /&gt;
&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Add this code after password table row</p>
<pre class="brush: php; title: ; notranslate">
$tempPhrase = 'YourSecreetWord';
$_SESSION['temp_phrase'] = $tempPhrase;

echo '
&lt;tr&gt;
&lt;td width=&quot;40%&quot;&gt;
&lt;b&gt;', $txt[88], ':&lt;/b&gt;
&lt;div class=&quot;smalltext&quot;&gt;', $txt['valid_phrase_description'], '&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;input type=&quot;text&quot; name=&quot;valid_phrase&quot; size=&quot;30&quot; tabindex=&quot;', $context['tabindex']++, '&quot; /&gt;
&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Let&#8217;s see this extra code:</p>
<pre class="brush: php; title: ; notranslate">
$tempPhrase = 'Azami'; ==&gt; YourSecreetWord, will used for session value and this is your answer of Personal Perification
$_SESSION['temp_phrase'] = $tempPhrase; ==&gt; make session value registered

$txt[88] ==&gt; Language array, will used for displaying Personal Verfication Label.
$txt['valid_phrase_description'] ==&gt; Language array, will used for displaying notes or simple question for you new member
name=&quot;valid_phrase&quot; ==&gt; a name for your new field
</pre>
<p>Then how to adding new language array ?? just open Login.english.php that located on /SMF-Folder/Themes/default/Languages/Login.english.php</p>
<p>Then Add this line wherever you want:</p>
<pre class="brush: php; title: ; notranslate">$txt['valid_phrase_description'] = 'What is my last name ?'; //will displayed on Register.template.php</pre>
<p>Next, open /SMF-Folder/Themes/default/Languages/index.english.php file. Then add this line wherever you want:</p>
<pre class="brush: php; title: ; notranslate">
$txt[88] = 'Personal Verification '; //will displayed on Register.template.php
##note: 88 is number of variable for Language array of Login.english.php
</pre>
<p>Next step is modifying this file: /SMF-Folder/Sources/Register.php. Then find this line : </p>
<pre class="brush: php; title: ; notranslate">if (!empty($modSettings['coppaAge']) &amp;&amp; empty($modSettings['coppaType']) &amp;&amp; !isset($_POST['skip_coppa']))</pre>
<p>Add this code after these line:</p>
<pre class="brush: php; title: ; notranslate">
if ($_SESSION['temp_phrase'] != $_POST['valid_phrase'])
	{
		loadLanguage('Login');
		fatal_lang_error('phrase_verification_failed', false);
	}
	elseif (isset($_SESSION['temp_phrase']))
		unset($_SESSION['temp_phrase']);
</pre>
<p>The code above will used for session authentication of Personal Perification Answer. </p>
<p>And don&#8217;t forget to add &#8220;phrase_verification_failed&#8221; array string into file: /SMF-Folder/Themes/default/Languages/Errors.english.php </p>
<pre class="brush: php; title: ; notranslate">$txt['phrase_verification_failed'] = 'Your answer is wrong ! Please Try Again.';</pre>
<p>It&#8217;s DONE! <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Upload your new modifiying files into Host. And then you will see the new Personal Verification in User Register Page.</p>
<p>This is my screeshoot of spammer (human) user that trying to register with wrong answer in User Register Page.</p>
<div id="img"><a href="http://i175.photobucket.com/albums/w126/hairulazami/spammer2.png" target="_blank"><img src="http://i175.photobucket.com/albums/w126/hairulazami/spammer2.png" border="0" alt="Photobucket"/></a></div>
<p>Regard, dr.emi</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/how-to-modifiying-smf-user-register-page-to-protect-from-spammer-or-junker.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/how-to-modifiying-smf-user-register-page-to-protect-from-spammer-or-junker.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=853&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/Nxjn3ZuZrjRHZ7KmHfsB_liM6Tk/0/da"><img src="http://feedads.g.doubleclick.net/~a/Nxjn3ZuZrjRHZ7KmHfsB_liM6Tk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Nxjn3ZuZrjRHZ7KmHfsB_liM6Tk/1/da"><img src="http://feedads.g.doubleclick.net/~a/Nxjn3ZuZrjRHZ7KmHfsB_liM6Tk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/E6mo4OaV4NI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/how-to-modifiying-smf-user-register-page-to-protect-from-spammer-or-junker.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/how-to-modifiying-smf-user-register-page-to-protect-from-spammer-or-junker.html</feedburner:origLink></item>
		<item>
		<title>Creating Auto Checker for IP Network Lifetime</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/tuZD3m3ZbB8/creating-auto-checker-for-ip-network-lifetime.html</link>
		<comments>http://www.dremi.info/tutorials/jquery/creating-auto-checker-for-ip-network-lifetime.html#comments</comments>
		<pubDate>Sat, 27 Jun 2009 00:47:36 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[fsockopen]]></category>
		<category><![CDATA[ip checker]]></category>
		<category><![CDATA[PHP Advance]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=844</guid>
		<description><![CDATA[Hi! I have a tutorial to check lifetime connectivity for IP and PORT in your Network. You may use it as component of enterpise application to check IP and PORT. So, what next ??? &#160; Offcourse, we need this files: ipchecker.php, frame_ip.php, index.php, and jquery framework. First create ipchecker.php for function handler: Code: The function [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://s175.photobucket.com/albums/w126/hairulazami/ipchecker/ipchecker200.png" alt="" class="imgheader" />Hi! I have a tutorial to check lifetime connectivity for IP and PORT in your Network. You may use it as component of enterpise application to check IP and PORT.</p>
<p>So, what next ???</p>
<p><span id="more-844"></span></p>
<div class="clear">&nbsp;</div>
<p>Offcourse, we need this files:  ipchecker.php, frame_ip.php, index.php,  and jquery framework.</p>
<p>First create  ipchecker.php for function handler:</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">

&lt;?
/**

#
# Auto Checker for IP Network Lifetime
# Author  hairul azami a.k.a dr.emi &lt;webmaster@dremi.info&gt;
# Website http://dremi.info
# License: GPL
#

**/

error_reporting(0);
define(&quot;_IMAGES&quot;, &quot;images/&quot;);
define(&quot;_IPROUTER&quot;, &quot;192.168.1.1&quot;);

function checkIP($ip, $p)
{

//error_reporting(E_ALL);
@set_time_limit(0);

$address = &quot;$ip&quot;; //your public IP
$port = $p; // your IP open port

$fp = @fsockopen($address,$port,$errno,$errstr,10);
stream_set_timeout($fp, 1);
if ($fp)
{
$statusIPport =  &quot;&lt;font color=green&gt;Connected&lt;/font&gt;&quot;;
$imgTitle = &quot;Connected&quot;;
$imgStats = &quot;accepted_32.png&quot;;
}
else
{
$statusIPport =  &quot;&lt;font color=#CCCCCC&gt;Disconnect&lt;/font&gt;&quot;;
$imgTitle = &quot;Disconnect&quot;;
$imgStats = &quot;warning_32.png&quot;;
}
$info = stream_get_meta_data($fp);
if($info['timed_out'])
{
$statusIPport =  &quot;&lt;font color=#CCCCCC&gt;Time Out&lt;/font&gt;&quot;;
$imgTitle = &quot;Time Out&quot;;
$imgStats = &quot;cancel_32.png&quot;;
}

flush();
$checkID = strtoupper(gethostbyaddr($address));
if($checkID != $address)
{
$comname = $checkID;
}
elseif($checkID == _IPROUTER)
{
$comname = &quot;ROUTER&quot;;
}
else
{
$comname = &quot;NONAME&quot;;
}
echo &quot;
&lt;div style='text-align:center;'&gt;
&lt;img src='&quot;._IMAGES . $imgStats.&quot;' alt='$imgTitle' title='$imgTitle' border=0&gt;&lt;br&gt;
&lt;strong&gt;$imgTitle&lt;/strong&gt;&lt;br&gt;
$address:$port&lt;br&gt;
$comname
&lt;/dvi&gt;&quot;;

}

checkIP($_GET['ip'], $_GET['port']);
?&gt;
</pre>
<p>The function will used as checker for each of variable IP and PORT</p>
<p>Second, create an jQuery Auto Load for file, called as frame_ip.php</p>
<p>In this file, you must load jQuery framework to complete javascript function bellow</p>
<p>Code:</p>
<pre class="brush: jscript; title: ; notranslate">

&lt;script language=&quot;javascript&quot; src=&quot;jquery-1.2.6.min.js&quot;&gt;&lt;/script&gt;
&lt;script language=&quot;javascript&quot;&gt;
//show animation
$(function(){
$(&quot;#ajax_display&quot;).ajaxStart(function(){
$(this).html('&lt;div style=&quot;text-align:center&quot;&gt;&lt;img src=&quot;images/ajax-loader-trans.gif&quot;/&gt;&lt;br&gt;Checking Target...&lt;/div&gt;');
});
$(&quot;#ajax_display&quot;).ajaxSuccess(function(){
$(this).html('');
});
$(&quot;#ajax_display&quot;).ajaxError(function(url){
alert('jqSajax is error ');
});
});
&lt;/script&gt;
</pre>
<p>Then to load ipchecker.php, I use this code:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;div id=&quot;ajax_display&quot;&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function getRandom() {
$(&quot;#random&quot;).hide(&quot;slow&quot;);
$(&quot;#random&quot;).load(&quot;ipchecker.php?ip=&lt;? echo $_GET['ip']; ?&gt;&amp;port=&lt;? echo $_GET['port']; ?&gt;&quot;, '', callback);
}
function callback() {
$(&quot;#random&quot;).show(&quot;slow&quot;);
setTimeout(&quot;getRandom();&quot;, 10000*2);
}
$(document).ready(getRandom);
&lt;/script&gt;
&lt;div id=&quot;random&quot;&gt;&lt;/div&gt;
</pre>
<p>While ip and port was defined in iframe URL, PHP function checkIP($ip, $p) will work.</p>
<p>I use this line for set the time while load ipchecker.php from first time to next load progress.</p>
<pre class="brush: jscript; title: ; notranslate">setTimeout(&quot;getRandom();&quot;, 10000*2);</pre>
<p>The last is index.php</p>
<p>This file will give you GUI of all process</p>
<pre class="brush: php; title: ; notranslate">

&lt;?
for($i=1;$i&lt;=10;$i++)
{
?&gt;
&lt;div id=&quot;ipslot&quot;&gt;
&lt;iframe scrolling=&quot;No&quot; frameborder=&quot;0&quot; class=&quot;frameloader&quot; width=&quot;100px&quot; height=&quot;100px&quot; name=&quot;ajax_ipchecker&quot; src=&quot;frame_ip.php?ip=192.168.1.&lt;? echo $i; ?&gt;&amp;port=80&quot;&gt;
&lt;/iframe&gt;
&lt;/div&gt;
&lt;?
}
?&gt;
</pre>
<p>While index.php loaded, frame_ip.php will work as &#8220;data sender&#8221; from URL, so we can check it in checkIP function.</p>
<p>Well this is screenshoot while you access index.php from http://localhost/[foldername]/index.php</p>
<div id="img"><img src="http://s175.photobucket.com/albums/w126/hairulazami/ipchecker/preview.png" alt="" width="335" height="252" /></div>
<p>OK, I think it&#8217;s really good time to see you here, thanks for read <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you find any bug / report, just comment here ..</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/jquery/creating-auto-checker-for-ip-network-lifetime.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/jquery/creating-auto-checker-for-ip-network-lifetime.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=844&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/95ZnC3TpAWCYqLoNnIqLrM6k6R0/0/da"><img src="http://feedads.g.doubleclick.net/~a/95ZnC3TpAWCYqLoNnIqLrM6k6R0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/95ZnC3TpAWCYqLoNnIqLrM6k6R0/1/da"><img src="http://feedads.g.doubleclick.net/~a/95ZnC3TpAWCYqLoNnIqLrM6k6R0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/tuZD3m3ZbB8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/jquery/creating-auto-checker-for-ip-network-lifetime.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/jquery/creating-auto-checker-for-ip-network-lifetime.html</feedburner:origLink></item>
		<item>
		<title>Web Design Layout Plus Implementasi jQuery Tab Content</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/kFfQJnPTozQ/web-design-layout-plus-implementasi-jquery-tab-content.html</link>
		<comments>http://www.dremi.info/tutorials/photoshop/web-design-layout-plus-implementasi-jquery-tab-content.html#comments</comments>
		<pubDate>Wed, 26 Nov 2008 01:22:20 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSS tutorials]]></category>
		<category><![CDATA[handcoded HTML]]></category>
		<category><![CDATA[tab link]]></category>
		<category><![CDATA[web layout]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=87</guid>
		<description><![CDATA[Welcome back friend ! tutorial ini menjelaskan bagaimana membuat sebuah layout yang interaktif. Penggabungan dari designing web layout menggunakan photoshop dan Editing dengan HTML+CSS. Kemudian mengimplementasikannya menggunakan jQuery Ajax saat meload PHP Content &#160; Yang lu perlukan adalah: -Photoshop -HTML+CSS -jQuery Ajax -PHP Part I Designing Website Layout Buka Photoshop lu, bikin ukuran kanvas kaya [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/jQuery-tab.png" alt="" /> Welcome back friend ! tutorial ini menjelaskan bagaimana membuat sebuah layout yang interaktif. Penggabungan dari designing web layout menggunakan photoshop dan Editing dengan HTML+CSS. Kemudian mengimplementasikannya menggunakan jQuery Ajax saat meload PHP Content<span id="more-87"></span></p>
<div class="clear">&nbsp;</div>
<p>Yang lu perlukan adalah:</p>
<p>-Photoshop<br />
-HTML+CSS<br />
-jQuery Ajax<br />
-PHP</p>
<h3>Part I Designing Website Layout</h3>
<p>Buka Photoshop lu, bikin ukuran kanvas kaya gini:</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs31.png" alt="" width="530" height="323" /></div>
<p>Pilih Rectangle Marquee Tool, bikin objek header ke gini:</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs1.png" alt="" width="498" height="82" /></div>
<p>Apply beberapa layer style :</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs32.png" alt="" width="278" height="293" /></div>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs33.png" alt="" width="300" height="206" /></div>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs34.png" alt="" width="422" height="488" /></div>
<p>Liat dlu hasilna</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs2.png" alt="" width="299" height="149" /></div>
<p>Sekarang bikin garis berwarna putih make single row marquee tool, antara gradien dan drop shadow. fill line make warna putih</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs35.png" alt="" width="348" height="266" /></div>
<p>Gunakan rounded rectangle tool bwat mbikin navigation button, gunakan radius sesuai keinginan lu</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs36.png" alt="" width="232" height="338" /></div>
<p>apply layer style</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs37.png" alt="" width="268" height="300" /></div>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs38.png" alt="" width="262" height="204" /></div>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs39.png" alt="" width="423" height="486" /></div>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs40.png" alt="" width="262" height="278" /></div>
<p>Semua gradien ada dalam paket download tutorial na</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs5.png" alt="" width="177" height="106" /></div>
<p>Pencet [CTRL+Click] pada layer navigation button, bwat mbikin seleksi sekitar button.</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs41.png" alt="" width="143" height="57" /></div>
<p>Pilih seleksi Eliptical Marquee Tool dengan option option : Intersect with selection. Truzzz buat seleksi oval diatas seleksi sebelumna</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs7.png" alt="" width="236" height="84" /></div>
<p>Lu bakalan dapet hasil seleksi ke gini</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs8.png" alt="" width="256" height="85" /></div>
<p>Pencet [CTRL+D] bwat Deselect</p>
<p>Tros transform objek na vertikal, dengan mencet [CTRL+T] -&gt; Flip Vertical</p>
<p>Pilih menu Filter &gt; Blur &gt; Gaussian Blur. Kasiin 2 px radius.</p>
<p>dan ubah blending layerna menjadi Overlay</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs6.png" alt="" width="171" height="87" /></div>
<p>Kasi text button na juga</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs9.png" alt="" width="159" height="67" /></div>
<p>Lu bisa group ksmua layer navigasi ke dalam satu group, dan duplikat gorup na mnjadi beberapa group</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs10.png" alt="" width="360" height="75" /></div>
<p>Hampir selesai layoutna, kasiin objek icon dan text sebagai title web na</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs11.png" alt="" width="199" height="119" /></div>
<p>Terakhir bikinin footer dengan cara sederhana kaya mbikin header</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs14.png" alt="" width="487" height="86" /></div>
<p>Review dlo hasil akhir layout na</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs142.png" alt="" width="478" height="300" /></div>
<h3>Part II Slicing Images</h3>
<p>Bagian ini kita bakalan ambil gambar tertentu saja, ambil bagian na dengan slicing tool yang nantina bakalan diperlukan bwat bikin code CSS na</p>
<p>Pertama adlah slice navigasi</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs15.png" alt="" width="593" height="329" /></div>
<p>Pilih  File &gt; Save for Web and Device</p>
<div id="img"><a href="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs16.png" target="_blank"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs16400.png" border="0" alt="" width="400" height="282" /></a></div>
<p>Inget ye: pilihna nyang Selected Slice dowank</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs17.png" alt="" width="368" height="127" /></div>
<p>Selanjutna terusin ke slice berikutna, kaya bg-header, bg-footer dan logo</p>
<p>Jadi lu bakalan dapet beberapa images yang dibutuhkan dalam coding CSS na</p>
<div id="img"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs42.png" alt="" width="367" height="267" /></div>
<h3>Part III Make HTML+CSS Code</h3>
<p>Bwat mbikin web lu knceng di load saat dibuka di browser, Less Table adaalh salah satu cra terbaik <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Gw paling suka bagian ini, buka Dreamweaver lu, bikin file CSS</p>
<p>Nah ini code CSS na:</p>
<pre class="brush: css; title: ; notranslate">  &lt;style type=&quot;text/css&quot;&gt;
html,body{
margin:0;
padding:0;
border:0;
/* \*/
height:100%;
/* Last height declaration hidden from Mac IE 5.x */
}
body {
background:#ffffff url(images/bg-header.gif) 0 0 repeat-x;
color:#000000;
min-width:960px;
}
#mainPan {
width:960px;
position:relative;
margin:0 auto;
}
#bodyPan {
width:960px;
margin:0 auto;
}
#headerPan {
width:960px;
height:127px;
margin:0px;
padding:0px;
}
#headerPan img.logo {
border:0px;
width:148px;
height:69px;
margin-left:20px;
margin-top:10px;
}
/* MENU TAB NAVIGATION */
#tabs {
line-height:normal;
top: 25px;
right:10px;
position:absolute;
}
#tabs ul {
margin:0;
padding:10px 10px 0 50px;
list-style:none;
}
#tabs li {
display:inline;
margin:0;
padding:0;
}
#tabs a {
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
color:#ffffff;
float:left;
background:url(images/bg-navigasi.gif) no-repeat left top;
margin:0;
padding-top:10px;
text-decoration:none;
width:137px;
height:59px;
text-align:center; /*for IE + FF right here*/
}
#tabs a:hover {
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
color: #FFCC00;
}
.spacer {
margin-bottom:20px;
}
/* CONTENT */
#contenPan {
font-size:11px;
color:#666666;
font-family:Arial, Helvetica, sans-serif;
width:960px;
margin:0px;
}
#contenPan h2 {
font-size:14px;
font-family:Arial, Helvetica, sans-serif;
color:#006699;
}
#contenPan a {
color:#0066CC;
text-decoration:none;
}
#contenPan a:hover {
color: #FF0000;
text-decoration:none;
}
/* FOOTER */
#footerMainPan {
position:relative;
clear: both;
width:100%;
height:138px; /*for FF add 10px;*/
overflow:hidden;
background:url(images/bg-footer.gif) 30px center repeat-x;
text-align:center;
}
#footerPan {
padding-top:50px;
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
color: #666666;
width:960px;
height:88px;
background: url(images/cutter.gif) right top no-repeat;
margin:0px;
}
#footerPan a {
color: #0099FF; text-decoration:none;
}
#footerPan a:hover {
color: #333399; text-decoration:none;
}
&lt;/style&gt;</pre>
<p>save dan kasi nama <strong>style.css</strong></p>
<p>sekarang kite bakalan mbikin <strong>index.html</strong></p>
<p>dan ini code ma:</p>
<pre class="brush: xml; title: ; notranslate">&lt;div id=&quot;mainPan&quot;&gt;
&lt;div id=&quot;bodyPan&quot;&gt;

&lt;div id=&quot;headerPan&quot;&gt;
&lt;img src=&quot;images/logo.gif&quot; class=&quot;logo&quot; /&gt;
&lt;div id=&quot;tabs&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Photoshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;PHP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;AJAX&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;div id=&quot;contenPan&quot;&gt;
&lt;h2&gt;Heloo....&lt;/h2&gt;
&lt;p&gt;This is main Content &lt;a href=&quot;#&quot;&gt;[link]&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
&lt;div id=&quot;footerMainPan&quot;&gt;
&lt;div id=&quot;footerPan&quot;&gt;
&amp;copy; 2008 Web Design Ajax jQuery.
&lt;a href=&quot;http://www.psdremi.co.cc&quot; target=&quot;_blank&quot;&gt;
PSDREMI.CO.CC
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<p>Gw rasa cuma sgitu code na, gw yakin lu bakalan familiar kok <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Part IV Adding jQuery Ajax Scripts to Load Contents</h3>
<p>Lu pada tau  <a href="http://jquery.com" target="_blank">jQuery</a> kan ? kalo belom, baca pengenalan tentang jQuery dlo yak di web na <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Pada bagian ini kita butuh jQuery script library, sedangkan <a href="http://plugins.jquery.com" target="_blank">plugin</a> ga diperlukan.</p>
<p>Cuma kasi baris ini di HTML na, bwat ngeload jQuery Javascript Library na</p>
<pre class="brush: jscript; title: ; notranslate">&lt;script src=&quot;jquery-1.2.6.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre>
<p>dan kasi code javascripts bwat mbikin fungsi untuk meload external content pada contentPan Div</p>
<pre class="brush: jscript; title: ; notranslate">&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
$(&quot;#ajax_display&quot;).ajaxStart(function(){
$(this).html('&lt;p&gt;&lt;img src=&quot;images/ajax-loader.gif&quot; /&gt;&lt;/p&gt;');
});
$(&quot;#ajax_display&quot;).ajaxSuccess(function(){
$(this).html('');
});
$(&quot;#ajax_display&quot;).ajaxError(function(url){
alert('jQuery ajax is error ');
});
});
function loadContent(id) {
$(&quot;#contenPan&quot;).hide();
$(&quot;#contenPan&quot;).load(&quot;php-loader.php?cPub=&quot;+id+&quot;&quot;, '', callback);
}
function callback() {
$(&quot;#contenPan&quot;).show();
}
$(document).ready(loadContent(id));
&lt;/script&gt;</pre>
<p>Simple line:</p>
<pre class="brush: jscript; title: ; notranslate">  $(this).html('&lt;p&gt;&lt;img src=&quot;images/ajax-loader.gif&quot; /&gt;&lt;/p&gt;');

/*this line will load the ajax-loader.gif while progress on request*/</pre>
<p>dan code berikut ini diperlukan bwat memanngil data content</p>
<pre class="brush: jscript; title: ; notranslate">  function loadContent(id) {
$(&quot;#contenPan&quot;).hide();
$(&quot;#contenPan&quot;).load(&quot;php-loader.php?cPub=&quot;+id+&quot;&quot;, '', callback);
}
function callback() {
$(&quot;#contenPan&quot;).show();
}</pre>
<p>php-loader.php adalah file PHP yang bertugas memberikan value dalam bentuk HTML, value ini akan direquest oleh jQuery Ajax untuk di load ke contentPan Div</p>
<p>Kalo lu liat pada akhir variable GET na berupa variable cPub, maka kita bakalan bikin file PHP yang menggunakan kondisi pemilihan variable GET, ni code na:</p>
<pre class="brush: php; title: ; notranslate">&lt;?
$allCount = 60; //just to simulation for data ready
if($_GET['cPub'] == 2)
{
echo &quot;&lt;h2&gt;Photoshop&lt;/h2&gt;&quot;;
echo &quot;&lt;p align=justify&gt;&lt;img src='images/psdremi-logo130.gif' width='130' height=44'&gt;&quot;;
for($i=0;$i&lt;=$allCount;$i++)
{
echo &quot;This is Photoshop Content. &quot;;
}
echo &quot;&lt;/p&gt;&quot;;
sleep(2);
}
elseif($_GET['cPub'] == 3)
{
echo &quot;&lt;h2&gt;CSS&lt;/h2&gt;&quot;;
echo &quot;&lt;p align=justify&gt;&lt;img src='images/psdremi-logo130.gif' width='130' height=44'&gt;&quot;;
for($i=0;$i&lt;=$allCount;$i++)
{
echo &quot;This is CSS Content. &quot;;
}
echo &quot;&lt;/p&gt;&quot;;
sleep(2);
}
elseif($_GET['cPub'] == 4)
{
echo &quot;&lt;h2&gt;PHP&lt;/h2&gt;&quot;;
echo &quot;&lt;p align=justify&gt;&lt;img src='images/psdremi-logo130.gif' width='130' height=44'&gt;&quot;;
for($i=0;$i&lt;=$allCount;$i++)
{
echo &quot;This is PHP Content. &quot;;
}
echo &quot;&lt;/p&gt;&quot;;
sleep(2);
}
elseif($_GET['cPub'] == 5)
{
echo &quot;&lt;h2&gt;AJAX&lt;/h2&gt;&quot;;
echo &quot;&lt;p align=justify&gt;&lt;img src='images/psdremi-logo130.gif' width='130' height=44'&gt;&quot;;
for($i=0;$i&lt;=$allCount;$i++)
{
echo &quot;This is AJAX Content. &quot;;
}
echo &quot;&lt;/p&gt;&quot;;
sleep(2);
}
else
{
echo &quot;&lt;h2&gt;Home&lt;/h2&gt;&quot;;
echo &quot;&lt;p&gt;&lt;a href=''&gt;this is a link&lt;/a&gt;&lt;/p&gt;&quot;;
echo &quot;&lt;p align=justify&gt;&lt;img src='images/psdremi-logo130.gif' width='130' height=44'&gt;&quot;;
for($i=0;$i&lt;=$allCount;$i++)
{
echo &quot;Welcome back friend ! this tutorial explain about how to designing web layout with Photoshop+CSS and then using Ajax jQuery to implementad how to Load PHP Content. &quot;;
}
echo &quot;&lt;/p&gt;&quot;;
}
?&gt;</pre>
<p>Gw pake sleep(2) bwat mensimulasikan loading content yang cukup lama</p>
<p>Kayakna smua udah lengkap, tinggal lu upload ke webserver biar PHP na bekerja. ni screen shoot na</p>
<div id="img"><a href="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs44.png" target="_blank"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs44400.png" border="0" alt="" width="400" height="256" /></a></div>
<div id="img"><a href="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs45.png" target="_blank"><img src="http://i409.photobucket.com/albums/pp172/psdremi/Web%20Design%20Layout%20Plus%20jQuery%20Tab%20Content/web-design-layout-jquery-tabs45400.png" border="0" alt="" width="400" height="266" /></a></div>
<p>Tutorial ini gw input juga dalam bahasa inggris di <a href="http://www.psdremi.co.cc/2008/11/web-design-layout-plus-jquery-tab-content.html" target="_blank">PSDREMI.CO.CC</a> dan <a href="http://www.good-tutorials.com/users/hairulazami" target="_blank">Good-tutorials.Com</a></p>
<p>Best Regard, dr.emi</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/web-design-layout-plus-implementasi-jquery-tab-content.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/web-design-layout-plus-implementasi-jquery-tab-content.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=87&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/ou8Y2Nix_8b2F09ds6zJ4YZdsvg/0/da"><img src="http://feedads.g.doubleclick.net/~a/ou8Y2Nix_8b2F09ds6zJ4YZdsvg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ou8Y2Nix_8b2F09ds6zJ4YZdsvg/1/da"><img src="http://feedads.g.doubleclick.net/~a/ou8Y2Nix_8b2F09ds6zJ4YZdsvg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/kFfQJnPTozQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/photoshop/web-design-layout-plus-implementasi-jquery-tab-content.html/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/photoshop/web-design-layout-plus-implementasi-jquery-tab-content.html</feedburner:origLink></item>
		<item>
		<title>dreFileBrowser v.1.0 – Make a beautifull File Browser with jQuery File Tree and EditArea</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/l2SvdnNv7Xw/drefilebrowser-v10-make-a-beautifull-file-browser-with-jquery-file-tree-and-editarea.html</link>
		<comments>http://www.dremi.info/articles/drefilebrowser-v10-make-a-beautifull-file-browser-with-jquery-file-tree-and-editarea.html#comments</comments>
		<pubDate>Sun, 23 Nov 2008 19:47:53 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[file manager]]></category>
		<category><![CDATA[IT job]]></category>
		<category><![CDATA[product demo]]></category>
		<category><![CDATA[relationship]]></category>
		<category><![CDATA[web articles]]></category>
		<category><![CDATA[web tips]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=77</guid>
		<description><![CDATA[Make a beautifull File Browser with jQuery File Tree and EditArea. Setelah sukses dengan produk gw sebelumnya dreDSync V.1.0, kali ini gw melaunching sebuha open source sederhana dreFileBrowser V.1.0 &#160; dreFileBrowser v.1.0 Make a beautifull File Browser with jQuery File Tree and EditArea © dreFileBrowser V.1.0 2008 Developped by dr.emi Setelah sukses dengan produk gw [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/drefilebrowser.png" alt="" />Make a beautifull File Browser with jQuery File Tree and EditArea. Setelah sukses dengan produk gw sebelumnya dreDSync V.1.0, kali ini gw melaunching sebuha open source sederhana dreFileBrowser V.1.0 <span id="more-164"></span></p>
<div class="clear">&nbsp;</div>
<h2><span class="style1">dre</span><span class="style5">File</span><span class="style4">Browser</span> <span class="style6">v.1.0</span></h2>
<p>Make a beautifull File Browser with jQuery File Tree and EditArea</p>
<p>© dreFileBrowser V.1.0 2008 Developped by dr.emi</p>
<p>Setelah  sukses dengan produk gw sebelumnya dreDSync V.1.0, kali ini gw  melaunching sebuah open source sederhana dreFileBrowser V.1.0</p>
<p>Ini merupakan open source, dimana lu boleh memodif script na, selama lu mencantumkan author na:</p>
<p>Author: hairul azami a.k.a dr.emi<br />
Author Link: http://www.dremi.info<br />
Author Contact: webmaster@dremi.info</p>
<p>Menggunakan dreFileBrowser:</p>
<p><img src="http://i175.photobucket.com/albums/w126/hairulazami/logo.gif" alt="" width="290" height="82" /></p>
<p>Extract paket RAR ini ke dalam root webserver lu, lalu ubah setting configurasi pada dfb-config.php</p>
<p>_ABSOLUTE_PATH = defini base path untuk instalasi dreFileBrowser<br />
_ROOT_TREE     = folder mana yang akan di scan ?<br />
_MODEM_SPEED   = definisi untuk modem speed, menentukan transfer rate</p>
<p>$allowed_extensions_to_preview = var array untuk extensi file yang dapat di preview<br />
$allowed_extensions_to_edit    = var array untuk extensi file yang dapat di edit</p>
<p>Gw  sadar script di dalamnya sangat jelek <img src='http://www.dremi.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  tapi marilah berfikir  bagaimana mengimplementasikan sebuah Aplikasi yang berguna untuk orang  banyak.</p>
<p>Pada versi berikutnya gw bakalan nambahin beberapa fiture  nya, kaya Upload, download, me remove, dan mengeksekusi perintah  command line layaknya bekerja pada DOS Operating System.</p>
<p>Sebenernye  gw saat ini sibuk banget, udah ga smpet lagi bikin bikin tutorial, tapi  gw masih inget kalian, fun, member, dan pecinta www.dremi.info. Jadi gw  kasi lu suprise aplikasi dreFileBrowser V.1.0</p>
<p>ENJOY IT !!!! KEEP LEARN AND SHARE, DO NOT EXPOSE BUT PROVE YOUR SKILL !!!</p>
<p><strong>Best Regard, dr.emi</strong></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/drefilebrowser-v10-make-a-beautifull-file-browser-with-jquery-file-tree-and-editarea.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/drefilebrowser-v10-make-a-beautifull-file-browser-with-jquery-file-tree-and-editarea.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=164&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/l-P9KGBQA-etQ45VhIVY0lzgoHw/0/da"><img src="http://feedads.g.doubleclick.net/~a/l-P9KGBQA-etQ45VhIVY0lzgoHw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/l-P9KGBQA-etQ45VhIVY0lzgoHw/1/da"><img src="http://feedads.g.doubleclick.net/~a/l-P9KGBQA-etQ45VhIVY0lzgoHw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/l2SvdnNv7Xw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/articles/drefilebrowser-v10-make-a-beautifull-file-browser-with-jquery-file-tree-and-editarea.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.dremi.info/articles/drefilebrowser-v10-make-a-beautifull-file-browser-with-jquery-file-tree-and-editarea.html</feedburner:origLink></item>
		<item>
		<title>Memperkenalkan dreDSync V.1.0 Produk Terbaru dr.emi</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/rtRXaaiWCEY/memperkenalkan-dredsync-v10-produk-terbaru-dremi.html</link>
		<comments>http://www.dremi.info/articles/memperkenalkan-dredsync-v10-produk-terbaru-dremi.html#comments</comments>
		<pubDate>Sun, 02 Nov 2008 11:19:58 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[data syncronizer]]></category>
		<category><![CDATA[data transfer]]></category>
		<category><![CDATA[IT job]]></category>
		<category><![CDATA[product demo]]></category>
		<category><![CDATA[relationship]]></category>
		<category><![CDATA[security system]]></category>
		<category><![CDATA[web articles]]></category>
		<category><![CDATA[web tips]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=73</guid>
		<description><![CDATA[dreDSync V.1.0 merupakan karya gw ke-sekian kalinya untuk dunia IT, berfungsi sebagai Data Syncronizer yang berbasis pada komunikasi Flat File TXT dan Socket Detection. Gw bikin menggunakan bahasa pemrograman PHP dan terinspirasi dari project terbaru gw CBT of TNI. &#160; Memperkenalkan dreDSync V.1.0 Produk Terbaru dr.emi What is dreDSync V.1.0 ? baca (DE-ER-E DE-SYNC) dreDSync [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/dredsync.png" alt="" />dreDSync V.1.0 merupakan karya gw ke-sekian kalinya untuk dunia IT, berfungsi sebagai Data Syncronizer yang berbasis pada komunikasi Flat File TXT dan Socket Detection. Gw bikin menggunakan bahasa pemrograman PHP  dan terinspirasi dari project terbaru gw CBT of TNI.<span id="more-160"></span></p>
<div class="clear">&nbsp;</div>
<h3>Memperkenalkan <span class="style1">dre</span><span class="style2">DSync</span> V.1.0 Produk Terbaru dr.emi</h3>
<p align="justify">
<p align="justify"><strong>What is dreDSync V.1.0 ?</strong></p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsync-logo-v10.png" alt="" width="170" height="60" /></p>
<p>baca (DE-ER-E DE-SYNC)</p>
<p align="justify">dreDSync V.1.0 merupakan karya gw ke-sekian kalinya untuk dunia IT, berfungsi sebagai Data Syncronizer yang berbasis pada komunikasi Flat File TXT dan Socket Detection. Gw bikin menggunakan bahasa pemrograman PHP dan terinspirasi dari project terbaru gw CBT of TNI.</p>
<p align="justify">
<p align="justify"><strong>What for dreDSync V.1.0 ?</strong></p>
<p align="justify">dreDSync V.1.0 diciptakan untuk mensyncronkan data pada server dan client, yang dalam hal ini di implementasikan pada project CBT of TNI</p>
<p align="justify">
<p align="justify"><strong>What is the main Concept ?</strong></p>
<p align="justify">Konsep utamanya gw peroleh dari Andyka GloboCode.Com saat CBT of TNI project mengalami kendala penghematan bandwidth, karena menggunakan File file Multimedia.</p>
<p align="justify">Kami baru saja mendapat project dari TNI, membuat System Pembelajaran Multimedia Berbasis Web, yang diperuntukkan bagi siswa siswa TNI-AD seindonesia. Tentunya karena berupa System Pembelajaran Multimedia, file file nya terdiri dari file multimedia dan file file lainnya, yang kedepannya sudah pasti akan memakan banyak bandwidth kalo lagi dipake !</p>
<p align="justify">Dan inilah strategi kami :</p>
<p align="justify">CBT memiliki struktur file yang terdiri dari 2 jenis:</p>
<p align="justify"><strong>First</strong>, Multimedia files (ie: audio, video, and another big filesize) yang akan ditempatkan pada Server dan Client sebagai File Permanent</p>
<p><strong>Second</strong>,   Miscleneous files (ie: JPG, PNG, ZIP, XML anf TXT). File file ini akan di update sesuai jadwal kulikulum yang telah ditetapkan</p>
<p align="justify">Dari keterangan singkat diatas, gw perlu sebuah skrip downloader otomatis, untuk mendeteksi Last Modified File file Miscleneous yang ter update saat mendatang. Secara teknis dapat digambarkan sebagai berikut:</p>
<p align="justify">Saat Administrator CBT membuat schedule baru update data, dia harus membuat schedule pada Administrator dreDSync V.1.0 yang telah disediakan. Dengan demikian fungsi scanning all directories pada aplikasi dreDSync V.1.0 akan mendata keberadaan lokasi source file terbaru yang telah diupdate sebelum menginput schedule. Pendataan ini dilakukan oleh server dengan menempatkan log download list nya pada sebuah file TXT, untuk kemudian akan &#8220;menembaki&#8221; seluruh client menggunakan Socket Connection, sebagai pertanda File Update terbaru telah siap di download oleh masing masing client. Dengan demikian proses Syncronisasi data dapat dimulai.</p>
<p align="justify"><a href="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/flowchart-syncronizing-data.jpg"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/flowchart-syncronizing-data400.jpg" alt="" width="400" height="286" /></a></p>
<p align="justify">
<p align="justify"><strong>Error handling while Syncronizing Data</strong></p>
<p class="style3" align="justify">Kasus DisConnect</p>
<p align="justify">Sebuah aplikasi tentunya akan selalu memiliki Bug, dengan demikian error handling pun gw siapkan, menjaga suatu saat terjadi. Dalam kasus ini yang dikhawatirkan adalah putus koneksi dan mati lampu/Client nost respon, sehingga saat terjadi syncronisasi data besar kemungkinan belum selesai diproses.</p>
<p align="justify">Untuk itu gw memberikan catatan kecil untuk setiap client, jika data nya masih belum sama dengan downloadlist pada server maka pesan not complete akan dituliskan client pada system lognya, dengan demikian saat client kembali di running, maka secara otomatis proses syncronisasi data akan dilanjutkan mengacu kepada downloadlist yang tersedia sebelumna. Sehingga pada dreDSync V.1.0 ini gw tidak menghapus system log pada server untuk 1 minggu kedepan, dan hal ini akan berdampak positif bagi client yang belum selesai mendownload data masih punya kesempatan untuk mendownload nya kembali. Tapi jika keadaan baik baik saja, client akan menuliskan pesan complete pada system lognya.</p>
<p align="justify">
<p align="justify"><strong>Processing Screen Shoot</strong></p>
<p align="justify">Running on server</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv102.png" alt="" width="302" height="421" /></p>
<p align="justify">Running on Client</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv105.png" alt="" width="294" height="427" /></p>
<p align="justify">Syncronizing Data on Progress</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv101.png" alt="" width="297" height="429" /></p>
<p align="justify">jQuery Panel Menu Administrator</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv103.png" alt="" width="400" height="183" /></p>
<p align="justify">jQuery Block UI for Login Form</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv104.png" alt="" width="400" height="422" /></p>
<p align="justify">CPanel Administrator for Schedule</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv106.png" alt="" width="400" height="487" /></p>
<p align="justify">CPanel Administrator for SysLog and Config</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv107.png" alt="" width="400" height="386" /></p>
<p align="justify">CPanel Administrator for Client Register</p>
<p align="justify"><img src="http://i175.photobucket.com/albums/w126/hairulazami/dreDSync%20V1/dredsyncv10400.jpg" alt="" width="400" height="450" /></p>
<p align="justify">
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/memperkenalkan-dredsync-v10-produk-terbaru-dremi.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/memperkenalkan-dredsync-v10-produk-terbaru-dremi.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=160&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/I1Ol-dEmq0kkTDJoA6yaFmFwLUY/0/da"><img src="http://feedads.g.doubleclick.net/~a/I1Ol-dEmq0kkTDJoA6yaFmFwLUY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/I1Ol-dEmq0kkTDJoA6yaFmFwLUY/1/da"><img src="http://feedads.g.doubleclick.net/~a/I1Ol-dEmq0kkTDJoA6yaFmFwLUY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/rtRXaaiWCEY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/articles/memperkenalkan-dredsync-v10-produk-terbaru-dremi.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dremi.info/articles/memperkenalkan-dredsync-v10-produk-terbaru-dremi.html</feedburner:origLink></item>
		<item>
		<title>Membuat Web Photo Album dengan FlatFile TXT</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/cPm4CYwT5b0/membuat-web-photo-album-dengan-flatfile-txt.html</link>
		<comments>http://www.dremi.info/tutorials/php/membuat-web-photo-album-dengan-flatfile-txt.html#comments</comments>
		<pubDate>Wed, 20 Aug 2008 05:22:36 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Flat File tutorial]]></category>
		<category><![CDATA[PHP Newbie]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=770</guid>
		<description><![CDATA[dalam tutorial ini, gw bikin web photo album menggunakan file text (flatfile). untuk me load data gambar ke halamana browser. ada empta fungsi php yang bakalan kita gunakan, sederhana kok: &#160; Code: code na ke gini : Code: pertama file text bakalan di tntuin dlu sebagai photo.txt, tros pembacaan file photo.txt dimulai, baru masing2 string [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/web-photo-album.png" alt="" />dalam tutorial ini, gw bikin web photo album menggunakan file text (flatfile). untuk me load data gambar ke halamana browser.</p>
<p>ada empta fungsi php yang bakalan kita gunakan, sederhana kok:<span id="more-770"></span></p>
<div class="clear">&nbsp;</div>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
array() //menampung data gambar di fiel text ke dalam sebuah rentetan data beruntun

file()
//sama dengan readfile(), bedanya kalo readfile() menggunakan buffer,
//kalo file() menggunakan tampungan data array

explode()
//menghancurkan string pemisah, pada file text, bisa lu tentuin sendiri
//nantina string pemisah ini akan dihilangkan

foreach()
//artinya untuk setiap
//jadi setiap string dalam file txt bakalan di proses sesuai eksekusi perintah selanjutnya

echo //mencetak hasil keluaran proses data
</pre>
<p>code na ke gini :</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?
$filename = &quot;photos.txt&quot;;
$photodata = array();

$file=file($filename);
foreach($file as $line)
{
// ilangin pemisah, disini tidak perlu lagi menggunakan array
$photodata = explode('|',$line);
echo &quot;
&lt;a href='&quot;.$photodata[0].&quot;' title='&quot;.$photodata[2].&quot;'&gt;&lt;img style='border: solid 4px #C0C0C0; padding: 2px;' src='&quot;.$photodata[1].&quot;' alt='&quot;.$photodata[2].&quot;' /&gt;&lt;/a&gt;&quot;;
}
?&gt;
</pre>
<p>pertama file text bakalan di tntuin dlu sebagai photo.txt, tros pembacaan file photo.txt dimulai, baru masing2 string dalam file di pisahkan melalui fungsi foreach, menjadi $line. $line merupakan variable single setelah di pecah.</p>
<p>kalo string na dah dipecah, maka pemisah di hilangkan untuk mengambil data aslina, yakni: thumb1.jpg s/d thumb4.jpg dan file1.jpg s/d file4.jpg</p>
<p>baru kemudian di cetak oleh perintah echo !</p>
<p>DONE .. SELESAI .. <img src='http://www.dremi.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   <img src='http://www.dremi.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  </p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/membuat-web-photo-album-dengan-flatfile-txt.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/membuat-web-photo-album-dengan-flatfile-txt.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=770&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/Ws39nqlezlyN5xF4E_EYYC2NwuM/0/da"><img src="http://feedads.g.doubleclick.net/~a/Ws39nqlezlyN5xF4E_EYYC2NwuM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Ws39nqlezlyN5xF4E_EYYC2NwuM/1/da"><img src="http://feedads.g.doubleclick.net/~a/Ws39nqlezlyN5xF4E_EYYC2NwuM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/cPm4CYwT5b0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/membuat-web-photo-album-dengan-flatfile-txt.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/membuat-web-photo-album-dengan-flatfile-txt.html</feedburner:origLink></item>
		<item>
		<title>PHP Mailer Advance [mengirim email per jam]</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/DuT6SK3tZak/php-mailer-advance-mengirim-email-per-jam.html</link>
		<comments>http://www.dremi.info/tutorials/php/php-mailer-advance-mengirim-email-per-jam.html#comments</comments>
		<pubDate>Tue, 05 Aug 2008 10:40:46 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[microtime]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[PHP mail]]></category>
		<category><![CDATA[sleep function]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=788</guid>
		<description><![CDATA[Bagaimana mensiasati hosting yang membatasi pngirimana email newsletter dalam satu jam Huh? misalna saja, kita hanya diizinkan mengirmkan email sejumlah 600 email dalam 1 jam&#8230; dengan bantuan perhitungan microtime dan sleep functions dalam PHP, kita dapat melakukanna &#160; Start DatTime Code: Code: fungsi diatas berfungsi untuk mengambil timing awal saat pengiriman email dimulai dan ini [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/phpmailer.png" alt="" />Bagaimana mensiasati hosting yang membatasi pngirimana email newsletter dalam satu jam Huh?</p>
<p>misalna saja, kita hanya diizinkan mengirmkan email sejumlah 600 email dalam 1 jam&#8230;</p>
<p>dengan bantuan perhitungan microtime dan sleep functions dalam PHP, kita dapat melakukanna<span id="more-788"></span></p>
<div class="clear">&nbsp;</div>
<p>Start DatTime Code:</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
function getStartTime()
{
$mtime = microtime();
$mtime = explode(&quot; &quot;,$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
}
</pre>
<p>fungsi diatas berfungsi untuk mengambil timing awal saat pengiriman email dimulai</p>
<p>dan ini mailer na:</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
$maxmsgs = 10; // kirim max 10 email pe menit, jadi kalo 1jam berarti 10 x 60 = 600 email perjam

for($i=1; $i&lt;$_POST[jumlah]; $i++)
{
global $starttime, $maxmsgs;

$a=$i.$_POST['dari'];

@mail($_POST['dari'], $_POST['subjek'], $_POST['pesan'],
&quot;Return-path: &lt; $_POST[kepada] &gt;\n&quot;.
&quot;Received: Server Penjahat\n&quot;.
&quot;From: $a &lt; $a &gt;\n&quot;.
&quot;To: Yang Gw Sikat &lt; $_POST[kepada] &gt;\n&quot;.
&quot;Date: &quot;. date(&quot;D, M d Y H:i:s&quot;).&quot; +0700\n&quot;.
&quot;X-Mailer: BlackCat Hacker\n&quot;.
&quot;X-Priority: 1\n&quot;.
&quot;Message-Id:&quot;.rand().&quot;&quot;);

$mtime = microtime();
$mtime = explode(&quot; &quot;,$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);

if($i%$maxmsgs==0)
{
$sleeptime = 60-$totaltime;
// menunggu dalam beberapa detik
sleep($sleeptime);
getStartTime();
continue;
}
elseif(($totaltime&gt;=60) &amp;&amp; ($i%$maxmsgs!=0))
{
// dalam 1 menit terkirim 10 email, lalu script emailer akan distirahatkan selama 15 detik, baru diset ulang perhitungan waktu kirim email
sleep(15);
getStartTime();
continue;
}
}

echo &quot;&lt;p&gt;Beres Bos !!! &lt;a href='$_SERVER[PHP_SELF]'&gt;Kembali&lt;/a&gt;&lt;/p&gt;&quot;;
</pre>
<p>jadi lengkapna kalo dah make form bisa ke gini:</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;!doctype html public &quot;-//W3C//DTD HTML 4.0 //EN&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Kirim email jumlah tertentu dalam satu jam&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;H2&gt;Kirim Email&lt;/H2&gt;
&lt;form name=&quot;emailku&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
Dari:&lt;BR&gt;
&lt;input type=&quot;text&quot; name=&quot;dari&quot;&gt;
&lt;BR&gt;&lt;BR&gt;
Kepada:&lt;BR&gt;
&lt;input type=&quot;text&quot; name=&quot;kepada&quot;&gt;
&lt;BR&gt;&lt;BR&gt;
Jumlah:&lt;BR&gt;
&lt;input type=&quot;text&quot; name=&quot;jumlah&quot;&gt;
&lt;BR&gt;&lt;BR&gt;
Subjek:&lt;BR&gt;
&lt;input type=&quot;text&quot; name=&quot;subjek&quot;&gt;
&lt;BR&gt;&lt;BR&gt;
Isi Pesan:&lt;BR&gt;
&lt;textarea name=&quot;pesan&quot;&gt;&lt;/textarea&gt;
&lt;BR&gt;&lt;BR&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Kirim !!!&quot;&gt;
&lt;/form&gt;

&lt;?
if(isset($_POST['submit']))
{

echo &quot;&lt;p&gt;&lt;img src='images/ajax-loader.gif'&gt;&lt;/p&gt;&quot;;

function getStartTime()
{
$mtime = microtime();
$mtime = explode(&quot; &quot;,$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
}

$maxmsgs = 10; // kirim max 10 email pe menit, jadi kalo 1jam berarti 10 x 60 = 600 email perjam

for($i=1; $i&lt;$_POST[jumlah]; $i++)
{
global $starttime, $maxmsgs;

$a=$i.$_POST['dari'];

@mail($_POST['dari'], $_POST['subjek'], $_POST['pesan'],
&quot;Return-path: &lt; $_POST[kepada] &gt;\n&quot;.
&quot;Received: Server Penjahat\n&quot;.
&quot;From: $a &lt; $a &gt;\n&quot;.
&quot;To: Yang Gw Sikat &lt; $_POST[kepada] &gt;\n&quot;.
&quot;Date: &quot;. date(&quot;D, M d Y H:i:s&quot;).&quot; +0700\n&quot;.
&quot;X-Mailer: BlackCat Hacker\n&quot;.
&quot;X-Priority: 1\n&quot;.
&quot;Message-Id:&quot;.rand().&quot;&quot;);

$mtime = microtime();
$mtime = explode(&quot; &quot;,$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);

if($i%$maxmsgs==0)
{
$sleeptime = 60-$totaltime;
// menunggu dalam beberapa detik
sleep($sleeptime);
getStartTime();
continue;
}
elseif(($totaltime&gt;=60) &amp;&amp; ($i%$maxmsgs!=0))
{
// dalam 1 menit terkirim 10 email, lalu script emailer akan distirahatkan selama 15 detik, baru diset ulang perhitungan waktu kirim email
sleep(15);
getStartTime();
continue;
}
}

echo &quot;&lt;p&gt;Beres Bos !!! &lt;a href='$_SERVER[PHP_SELF]'&gt;Kembali&lt;/a&gt;&lt;/p&gt;&quot;;

}
?&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>bijimane Huh?? dicoba yakk&#8230;.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/php-mailer-advance-mengirim-email-per-jam.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/php-mailer-advance-mengirim-email-per-jam.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=788&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/sI9j5_53Z6Q8tmgiVV2YOm2Q9Qc/0/da"><img src="http://feedads.g.doubleclick.net/~a/sI9j5_53Z6Q8tmgiVV2YOm2Q9Qc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/sI9j5_53Z6Q8tmgiVV2YOm2Q9Qc/1/da"><img src="http://feedads.g.doubleclick.net/~a/sI9j5_53Z6Q8tmgiVV2YOm2Q9Qc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/DuT6SK3tZak" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/php-mailer-advance-mengirim-email-per-jam.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/php-mailer-advance-mengirim-email-per-jam.html</feedburner:origLink></item>
		<item>
		<title>BAD Word Filter with PHP</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/Qt8EDuF8XNc/bad-word-filter-with-php.html</link>
		<comments>http://www.dremi.info/tutorials/php/bad-word-filter-with-php.html#comments</comments>
		<pubDate>Mon, 28 Jul 2008 06:13:52 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bad word filter]]></category>
		<category><![CDATA[PHP Advance]]></category>
		<category><![CDATA[str_replace]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=783</guid>
		<description><![CDATA[bad word mang nyEbelin kalo di komen2 ada karakter2 berbahaya kaya petik dua petik satu dan slash. Sebenernye kalo nyang pernah gw baca di forum phpbuilder.com dengan menggunakan strip tags aja dah aman, tapi ada baikna kalo security form di lipatgandakan. mudah2an si berguna walopun fungsi bwatan gw ni cuma beberapa baris &#160; Code: contoh [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/bad-word.png" alt="" />bad word mang nyEbelin kalo di komen2 ada karakter2 berbahaya kaya petik dua petik satu dan slash.</p>
<p>Sebenernye kalo nyang pernah gw baca di forum phpbuilder.com</p>
<p>dengan menggunakan strip tags aja dah aman, tapi ada baikna kalo security form di lipatgandakan. mudah2an si berguna walopun fungsi bwatan gw ni cuma beberapa baris<span id="more-783"></span></p>
<div class="clear">&nbsp;</div>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
function wordFilter($strToFilter)
{
$strToFilter = str_replace(&quot;'&quot;, &quot;&quot;, $strToFilter);
$strToFilter = str_replace(&quot;  &quot;, &quot; &quot;, $strToFilter);
$strToFilter = str_replace('&quot;', &quot;&quot;, $strToFilter);
$strToFilter = str_replace(&quot;|&quot;, &quot;&quot;, $strToFilter);
$strToFilter = str_replace(&quot;\'&quot;, &quot;&quot;, $strToFilter);
$strToFilter = str_replace(&quot;\&quot;&quot;, &quot;&quot;, $strToFilter);
$strToFilter = str_replace(&quot;\\&quot;, &quot;&quot;, $strToFilter);
$strToFilter = str_replace(&quot;/&quot;, &quot;&quot;, $strToFilter);

return $strToFilter;
}
</pre>
<p>contoh penggunaan:</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
echo 'String lu: ';
echo $str = &quot;Thank\&quot;s   'Brother' !&quot;;
echo '&lt;BR&gt; Dengan Filter akan menjadi: ';
echo wordFilter($str); //hasilna: Thanks Brother !
</pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/bad-word-filter-with-php.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/bad-word-filter-with-php.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=783&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/KSF1HXChVX_-lXHLhS73OMnQ1eE/0/da"><img src="http://feedads.g.doubleclick.net/~a/KSF1HXChVX_-lXHLhS73OMnQ1eE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KSF1HXChVX_-lXHLhS73OMnQ1eE/1/da"><img src="http://feedads.g.doubleclick.net/~a/KSF1HXChVX_-lXHLhS73OMnQ1eE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/Qt8EDuF8XNc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/bad-word-filter-with-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/bad-word-filter-with-php.html</feedburner:origLink></item>
		<item>
		<title>Membuat Auto Surf dengan PHP</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/iwXUFFRDTR0/membuat-auto-surf-dengan-php.html</link>
		<comments>http://www.dremi.info/tutorials/php/membuat-auto-surf-dengan-php.html#comments</comments>
		<pubDate>Wed, 09 Jul 2008 05:39:25 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Array Random]]></category>
		<category><![CDATA[PHP Advance]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=775</guid>
		<description><![CDATA[Pernah denger autosurf kan ? nyang kaya web ini ni: http://www.trafficracer.com/auto-surf.php?user=31251 nah ntu bisa dibikin sederhana pake META REFRESH, tapi kali in igw gabungin make PHP untuk merandom halaman na&#8230; Simak yak. &#160; Kita ga pake Database, langsung make Array untuk halaman yang bersangkutan ajah. Disini gw pake Frame bwatmenampilkan halaman hasil random na: ni [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/auto-surf.png" alt="" />Pernah denger autosurf kan ? nyang kaya web ini ni:</p>
<p>http://www.trafficracer.com/auto-surf.php?user=31251</p>
<p>nah ntu bisa dibikin sederhana pake META REFRESH, tapi kali in igw gabungin make PHP untuk merandom halaman na&#8230;</p>
<p>Simak yak.<span id="more-775"></span></p>
<div class="clear">&nbsp;</div>
<p>Kita ga pake Database, langsung make Array untuk halaman yang bersangkutan ajah. Disini gw pake Frame bwatmenampilkan halaman hasil random na:</p>
<p>ni bwat index.html na</p>
<p>Code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;Tutorial Photoshop, SEO, CSS&lt;/title&gt;
&lt;/head&gt;

&lt;frameset rows=&quot;120,*&quot; frameborder=&quot;yes&quot; border=&quot;0&quot; framespacing=&quot;0&quot;&gt;
&lt;frame src=&quot;top.php&quot; name=&quot;topFrame&quot; scrolling=&quot;No&quot; noresize=&quot;noresize&quot; id=&quot;topFrame&quot; title=&quot;topFrame&quot; /&gt;
&lt;frame src=&quot;target.html&quot; name=&quot;mainFrame&quot; id=&quot;mainFrame&quot; title=&quot;mainFrame&quot; /&gt;
&lt;/frameset&gt;
&lt;noframes&gt;&lt;body&gt;
&lt;/body&gt;
&lt;/noframes&gt;&lt;/html&gt;
</pre>
<p>tros bikin masing masing source bwat frame top dan target.</p>
<p>File top.php</p>
<p>Code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;html&gt;
&lt;?
function recoverPass($length)
{
$temp_recpass=&quot;&quot;;
srand ((float) microtime() * 10000000);
$input = array (
&quot;http://dremi468.blogspot.com&quot;,
&quot;http://www.csslovers.co.cc&quot;,
&quot;http://www.dremi.info/tutorial/photoshop/merancang-website-full-abis.html&quot;,
&quot;http://www.dremi.info/tutorial/photoshop/sony-ericsson-logo.html&quot;
);
$rand_keys = array_rand ($input, 24);
for ($i=0; $i&lt;$length; $i++)
{
$temp_recpass = $temp_recpass . $input[$rand_keys[$i]];
}
return $temp_recpass;
}
$temp_recpass = recoverPass(1);
if($temp_recpass=='') { $pageLoad = &quot;http://dremi468.blogspot.com&quot;; } else  { $pageLoad = $temp_recpass; }
$randRefreshTop = rand(60, 120);
$randRefreshBot = rand(30, 60);
?&gt;
&lt;head&gt;
&lt;title&gt;Refresh JavaScript Example&lt;/title&gt;
&lt;META HTTP-EQUIV=&quot;refresh&quot; CONTENT=&quot;&lt;? echo $randRefreshTop; ?&gt;&quot;&gt;
&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
&lt;!--
function refreshFrame() {
parent.mainFrame.location.href = '&lt;? echo $pageLoad; ?&gt;';
setTimeout('refreshFrame()',1000*&lt;? echo $randRefreshBot; ?&gt;);
}

refreshFrame();
//--&gt;
&lt;/SCRIPT&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
}
body {
background-color: #FFFFFF;
margin-left: 0px;
margin-top: 11px;
margin-right: 0px;
margin-bottom: 0px;
}
--&gt;
&lt;/style&gt;&lt;/head&gt;

&lt;!--
Use the &quot;onload&quot; event to start the refresh process.
--&gt;
&lt;body&gt;
&lt;center&gt;
Page Load: &lt;strong style=&quot;color:#0099FF&quot;&gt;&lt;? echo $pageLoad; ?&gt;&lt;/strong&gt; Top: &lt;strong style=&quot;color:#0099FF&quot;&gt;&lt;? echo $randRefreshTop; ?&gt;&lt;/strong&gt; &amp; Bottom: &lt;strong style=&quot;color:#0099FF&quot;&gt;&lt;? echo $randRefreshBot; ?&gt;&lt;/strong&gt;
&lt;br&gt;
&lt;?

if ($HTTP_SERVER_VARS[&quot;HTTP_X_FORWARDED_FOR&quot;] != &quot;&quot;){

// for proxy

$IP = $HTTP_SERVER_VARS[&quot;HTTP_X_FORWARDED_FOR&quot;];

$proxy = $HTTP_SERVER_VARS[&quot;REMOTE_ADDR&quot;];

$host = @gethostbyaddr($HTTP_SERVER_VARS[&quot;HTTP_X_FORWARDED_FOR&quot;]);

}else{

// for normal user

$IP = $HTTP_SERVER_VARS[&quot;REMOTE_ADDR&quot;];

$host = @gethostbyaddr($HTTP_SERVER_VARS[&quot;REMOTE_ADDR&quot;]);

}

echo &quot;IP: $IP | PROXY: $proxy | HOST: $host &lt;BR&gt;&quot;;

?&gt;
&lt;br&gt;

&lt;a href=&quot;http://dremi468.blogspot.com/2008/06/creating-corporate-writing-style.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i175.photobucket.com/albums/w126/hairulazami/banner%20468/seo-articles468.gif&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;&gt;&lt;/a&gt;

&lt;/center&gt;
&lt;/body&gt;

&lt;/html&gt;
</pre>
<p>contoh diatas array halaman URL lu bisa tambahin sendiri.</p>
<p>nah ni bwat target.html</p>
<p>Code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>kalo lu liat target.html halaman na kosong melompong, nah itu memang tugasnya hanya bwat nerima hasil load halaman yang ditampung dalam array pada Top Frame.</p>
<p>Cobain yak&#8230; asik kok.. <img src='http://www.dremi.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/membuat-auto-surf-dengan-php.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/php/membuat-auto-surf-dengan-php.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=775&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/DK62G5x3qePU2oe4zsfkpN353KE/0/da"><img src="http://feedads.g.doubleclick.net/~a/DK62G5x3qePU2oe4zsfkpN353KE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DK62G5x3qePU2oe4zsfkpN353KE/1/da"><img src="http://feedads.g.doubleclick.net/~a/DK62G5x3qePU2oe4zsfkpN353KE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/iwXUFFRDTR0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/php/membuat-auto-surf-dengan-php.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/php/membuat-auto-surf-dengan-php.html</feedburner:origLink></item>
		<item>
		<title>Art Fantasy</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/T1lzG_kgfz4/art-fantasy.html</link>
		<comments>http://www.dremi.info/tutorials/photoshop/art-fantasy.html#comments</comments>
		<pubDate>Sat, 19 May 2007 01:31:45 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[abstract design]]></category>
		<category><![CDATA[layer mask]]></category>
		<category><![CDATA[photo retouch]]></category>
		<category><![CDATA[photoshop design]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web layout]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=30</guid>
		<description><![CDATA[Hmmm gue inget sama orang2 terdeket gue, pengennya sih waktu kecil dulu gue dapet kasih sayang yang cukup&#8230;cuma masa itu terlalu sulit bagi gue..hihi.. Nah nih ada tutorial yang sedikit menyentuh perasaan kaum hawa..hakhak Ambil gambar objek yang sesuai / nuansa kelembutan&#8230;hihi &#160; Gue rapiin bagian pinggirnya pake eraser tool biar agak lembut dan menyatu [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/art-fantasy.png" alt="" />Hmmm gue inget sama orang2 terdeket gue, pengennya sih waktu kecil dulu gue dapet kasih sayang yang cukup&#8230;cuma masa itu terlalu sulit bagi gue..hihi..</p>
<p>Nah nih ada tutorial yang sedikit menyentuh perasaan kaum hawa..hakhak</p>
<p>Ambil gambar objek yang sesuai / nuansa kelembutan&#8230;hihi<span id="more-30"></span></p>
<div class="clear">&nbsp;</div>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/Untitleddremi_001.png" alt="" width="400" height="422" /></div>
<p>Gue rapiin bagian pinggirnya pake eraser tool biar agak lembut dan menyatu dengan backgroundnya.</p>
<p>Nah ubah warna latar menjadi Pink</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/Untitleddremi_002.png" alt="" width="401" height="394" /></div>
<p>Ouke buat seleksi seperti pada gambar dibawah:</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/Adobedremi_001.png" alt="" width="424" height="423" /></div>
<p>Kasi gradient dengan warna pink muda ke putih</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/Untitleddremi_005.png" alt="" width="435" height="428" /></div>
<p>Masih pada seleksi area, Pilih Filter &gt; Distort &gt; ZigZag. Kasi nilai seprti pada gambar:</p>
<div id="img"> <img src="http://localhost/drev8-01/images/ZigZagdremi_002.png" alt="" width="353" height="400" /></div>
<p>Tekan [CTRL+F] sekali jika efek filter zig zag nya masih kurang.</p>
<p>Hapus pada area pembatas gradasi untuk merapihkan nya</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/artdremi_001.png" alt="" width="413" height="404" /></div>
<p class="style1">Bikin Brush kupu &#8211; kupu</p>
<p>Nah untuk hiasannya, bikinin aja brush preset kupu &#8211; kupu..hihi</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/dremi_004.png" alt="" width="244" height="185" /></div>
<p>Ouke langkahnya:</p>
<p>&#8211;o~o&#8211; Bwat dokumen baru ukuran nya kira-kira 200 X 190 Pixels</p>
<p>&#8211;o~o&#8211; Dengan Shape Tool ciptakan gambar hati dan kasi sedikit bevel style dengan gradasi pink tua ke pink muda.</p>
<p>&#8211;o~o&#8211; Pilih [CTRL+A] untuk select-All. Pada menu Edit pilih Define Brush Preset.</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/Adobedremi_002copy.png" alt="" width="260" height="475" /></div>
<p>Ketik naanya misalkan my heart.. hihi</p>
<p>Nah balik lagi ke dokumen utama nya, perhatikan pada bagian bawah listing Brush akan ditambahkan brush preset baru bernama &#8220;my heart&#8221;.</p>
<p>Tekan [F5] untuk pengaturan setting brushnya.</p>
<p>Atur seperti pada gambar:</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/dremi_001.png" alt="" width="359" height="450" /></div>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/dremi_002.png" alt="" width="363" height="452" /></div>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/dremi_003.png" alt="" width="360" height="446" /></div>
<p>Nah tinggal lu atur aja ukuran brushnya dan tarik / grab pada bagian yang lu suka,mainkan imajinasi lu.. hehe</p>
<p>Nah ni hasil jadina..</p>
<div id="img"> <img src="http://i175.photobucket.com/albums/w126/hairulazami/Art%20Fantasy/art-fantasy.png" alt="" width="420" height="420" /></div>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/art-fantasy.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/art-fantasy.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=30&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/SOqgc2dqKo2AXRpdEyaFH36WCjk/0/da"><img src="http://feedads.g.doubleclick.net/~a/SOqgc2dqKo2AXRpdEyaFH36WCjk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/SOqgc2dqKo2AXRpdEyaFH36WCjk/1/da"><img src="http://feedads.g.doubleclick.net/~a/SOqgc2dqKo2AXRpdEyaFH36WCjk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/T1lzG_kgfz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/photoshop/art-fantasy.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/photoshop/art-fantasy.html</feedburner:origLink></item>
		<item>
		<title>Birunya Logoku</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/SNfJE5XYRr4/birunya-logoku.html</link>
		<comments>http://www.dremi.info/tutorials/photoshop/birunya-logoku.html#comments</comments>
		<pubDate>Mon, 07 May 2007 08:00:32 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[gradient style]]></category>
		<category><![CDATA[photoshop design]]></category>
		<category><![CDATA[shapping]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=25</guid>
		<description><![CDATA[Seneng rasanya setelah sekian lama menghilang, ga ngasi tutor selama kira2 2 minggu. Gue sibuk di kantor, lembur teruzz.. Ya wess&#8230;nyonge balik lagi..hekhehkkkkkkkk..wakakakaakakawww Kita akan mendesign sebuah logo yang cool dan artistik..warna biru wabeeessss&#8230; &#160; Lu bikin dulu gih dokumen barunya..backgroundnya #586b7f Bikin path dengan rectangle tool, kemudian klik path nya dengan path selection tool [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/birunya-logoku.png" alt="" />Seneng rasanya setelah sekian lama menghilang, ga ngasi tutor selama kira2 2 minggu. Gue sibuk di kantor, lembur teruzz..<br />
Ya wess&#8230;nyonge balik lagi..hekhehkkkkkkkk..wakakakaakakawww<br />
Kita akan mendesign sebuah logo yang cool dan artistik..warna biru wabeeessss&#8230;<span id="more-25"></span></p>
<div class="clear">&nbsp;</div>
<p align="justify">Lu bikin dulu gih dokumen barunya..backgroundnya #586b7f</p>
<p align="justify">Bikin path dengan rectangle tool, kemudian klik path nya dengan path selection tool <img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_009.png" alt="" width="28" height="24" /> sehingga titik2 pathnya keliatan.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_001.jpg" alt="" width="400" height="313" /></div>
<p align="justify">Nah lu ilangin / delete salah satu titik pathnya (titik path kanan atas) dengan delete Anchor point tool <img src="http://i175.photobucket.com/albums/w126/hairulazami/Merancang%20Website%20Full%20Abis/webdremi_002dremi_001.png" alt="" width="31" height="27" /> , lalu tambahkan satu titik dengan menggunakan Add anchor point <img src="http://i175.photobucket.com/albums/w126/hairulazami/Merancang%20Website%20Full%20Abis/webdremi_002dremi_002.png" alt="" width="31" height="28" /> pada garis datar yang terbentuk setelah mendelete titik kanan atasnya. Lalu tarik titik nya ke kanan atas, sehingga terbentuk lengkungan path baru.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_003.jpg" alt="" width="360" height="243" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_004.jpg" alt="" width="370" height="260" /></div>
<p align="justify">Nah dengan menggunakan Convert point tool <img src="http://i175.photobucket.com/albums/w126/hairulazami/Merancang%20Website%20Full%20Abis/Adobedremi_002.png" alt="" width="30" height="27" />, edit lah sisa titik path lainnya. Sehingga terbentuk lengkungan oval seperti pada gambar.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Adobedremi_002.jpg" alt="" width="400" height="271" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_006.jpg" alt="" width="437" height="314" /></div>
<p align="justify">Kalo belum sesuai dengan imaginasi lu, tinggal di geser2 aja titik pathnya, kalo masih kegedean tinggal lu transform aja yak. Ato kalo salah tinggal di undo [CTRL+ALT+Z], sampai bentuk seperti ini.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_007.jpg" alt="" width="394" height="261" /></div>
<p align="justify">Ubah nama layernya , misalkan &#8220;dasar logo&#8221; . Lalu kasi Layer &gt; Layer Style</p>
<p align="justify">Gradient Overlay</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Gradientdremi_002copy.png" alt="" width="302" height="168" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Gradientdremi_001.jpg" alt="" width="397" height="181" /></div>
<p align="justify">Inner Glow</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_001.jpg" alt="" width="256" height="248" /></div>
<p align="justify">Drop Shadow</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_002copy.png" alt="" width="267" height="291" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Adobedremi_003.jpg" alt="" width="379" height="258" /></div>
<p align="justify">Kasi sedikit gradient transparent putih di bagian atasnya,<br />
ubah layer opacitynya menjadi 10 %</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Adobedremi_004.jpg" alt="" width="351" height="244" /></div>
<p align="justify">Bikin bidang baru dengan Elips Tool di tengah bidang dasar Oval, dengan nama layer &#8220;Elips&#8221;. Kasi Layer Style</p>
<p align="justify">Gradient Overlay</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_003copy.png" alt="" width="271" height="193" /></div>
<p align="justify">Bevel &amp; Emboss</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_004.jpg" alt="" width="260" height="382" /></div>
<p align="justify">Inner Glow</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_005.jpg" alt="" width="256" height="242" /></div>
<p align="justify">Outer Glow</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_001-1.png" alt="" width="278" height="219" /></div>
<p align="justify">Inner Shadow</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_002.png" alt="" width="259" height="267" /></div>
<p align="justify">Tambahin tranparent Gradient putih di bagian atas nya (Elips).</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Adobedremi_003-1.png" alt="" width="164" height="161" /></div>
<p align="justify">Tambahkan satu gradient transparent putih lagi , tapi kali ini bidang gradienntnya lebih kecil, kira2 setengan dari transparent sebelumnya. Lalu kasi Layer Style Gradient Overlay</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/Layerdremi_004copy.png" alt="" width="261" height="197" /></div>
<p align="justify">Tambahin Text huruf &#8220;e&#8221; di tengah layer dasar logo. Dengan jenis font <a href="COLONNA.TTF">COLONNA MT</a>.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_001-1.png" alt="" width="167" height="161" /></div>
<p align="justify">Lanjut ke bagian cincin overlay. Bikin layer baru dengan nam &#8220;cincin overlay&#8221; di bawah layer Elips.</p>
<p align="justify">Dengan Eliptical Marquee Tool Buat lah Stroke 4 pixels  berwarna putih.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyadremi_002.png" alt="" width="204" height="170" /></div>
<p align="justify">Ubah Mode Layer ke Overlay 100 %, Duplikat Layer cincin overlay 1 x.</p>
<p align="justify">Nah jadi dah!!</p>
<div id="img"><a href="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyalogoku.png" target="_blank"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Birunya%20Logoku/birunyalogoku400.png" border="0" alt="Klik untuk memperbesar" width="400" height="286" /></a></div>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/birunya-logoku.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/birunya-logoku.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=25&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/aqNJKTruUYeeAJy2p1-ZC_D5LOY/0/da"><img src="http://feedads.g.doubleclick.net/~a/aqNJKTruUYeeAJy2p1-ZC_D5LOY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/aqNJKTruUYeeAJy2p1-ZC_D5LOY/1/da"><img src="http://feedads.g.doubleclick.net/~a/aqNJKTruUYeeAJy2p1-ZC_D5LOY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/SNfJE5XYRr4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/photoshop/birunya-logoku.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/photoshop/birunya-logoku.html</feedburner:origLink></item>
		<item>
		<title>Green Alien Player</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/UnXGH2nx3Ug/green-alien-player.html</link>
		<comments>http://www.dremi.info/tutorials/photoshop/green-alien-player.html#comments</comments>
		<pubDate>Sun, 08 Apr 2007 11:38:58 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[gradient style]]></category>
		<category><![CDATA[green style]]></category>
		<category><![CDATA[layer style photoshop]]></category>
		<category><![CDATA[photoshop design]]></category>
		<category><![CDATA[shapping]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=23</guid>
		<description><![CDATA[Terinspirasi setelah mimpi ketemu alien .. wakakakakaaa.. ga mirip-mirip banget sii .. tapi bisa lu pake bwat belajar. Lu mulai dee bwat dokumen barunya.. Bikin bidang oval, ukuran sesuai selera lu.. &#160; Kasi Metal layer style &#8230; dan Stroke Color #000000 , 2 pixels Langkah selanjutnya, Lu [CTRL+Click] pada layer oval lu untuk membentuk seleksi&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p><img class="imgheader" src="http://i175.photobucket.com/albums/w126/hairulazami/images-header200/green-alien-player.png" alt="" />Terinspirasi setelah mimpi ketemu alien .. wakakakakaaa.. <img src='http://www.dremi.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ga mirip-mirip banget sii .. tapi bisa lu pake bwat belajar.</p>
<p>Lu mulai dee bwat dokumen barunya..</p>
<p>Bikin bidang oval, ukuran sesuai selera lu..<span id="more-23"></span></p>
<div class="clear">&nbsp;</div>
<p>Kasi Metal layer style &#8230;</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_001.png" alt="" width="242" height="222" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_002.png" alt="" width="246" height="246" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_003.png" alt="" width="262" height="382" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_004.png" alt="" width="230" height="92" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_005.png" alt="" width="248" height="200" /></div>
<p>dan Stroke Color #000000 , 2 pixels</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_002.png" alt="Ukuran Sebenarnya" width="400" height="358" /></div>
<p>Langkah selanjutnya, Lu [CTRL+Click] pada layer oval lu untuk membentuk seleksi&#8230;</p>
<p>Setelah tercipta seleksi, Pilih eliptical selection tool, atur setting nya :</p>
<p>&#8211; Mode : &#8220;Substract from Selection&#8221;</p>
<p>&#8211; Style : Fixed Size 150 pixels</p>
<p>Nah lu tinggal klik 2 aja deh bagian 2 seperti gbr dibwah ini:</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Untitleddremi_001.png" alt="" width="400" height="290" /></div>
<p>Nah nantinya akan terbentuk seleksi seperti dibawah ini:</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Untitleddremi_002%20copy.png" alt="" width="400" height="433" /></div>
<p>Tekan [CTRL+C] dan beralih ke Panel Channel, Bikin Channel baru dengan mengklik icon Create New Channel, ubah nama channelnya misalkan &#8220;alphaku&#8221; &#8211; dan Tekan [CTRL+V] untuk mempaste objek seleksi.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/alphadremi_001.png" alt="" width="192" height="36" /></div>
<p>Ikon Create New Channel Pada Panel Channel</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/alpha%20copy.png" alt="" width="202" height="142" /></div>
<p>Alpha Baru yang tercipta</p>
<p>Nah lu Tekan dulu deh [CTRL+D] untuk deselect area.</p>
<p>Masih pada channel alphaku<br />
Pilih Filter &gt; Blur &gt; Gaussian Blur : 15 px</p>
<p>Lanjut lagi, tekan [CTRL+L] untuk mengatur Levelnya, kasi setting sesuai gambar  :</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Levelsdremi_001%20copy.png" alt="" width="400" height="569" /></div>
<p>Kalo udah klik OK.</p>
<p>Nah sekarang lu [CTRL+Click] pada layer Alpha Channel &#8220;alphaku&#8221; untuk mendapatkan seleksi channel..</p>
<p>Tekan [CTRL+C], lalu berpindah ke Panel Layer biasa. Buat Layer baru dengan nama &#8220;layout bg&#8221;, Pilih Select &gt; Modify &gt; Contract : 10 px. OK</p>
<p>Lalu   Pilih Edit &gt; Paste Into.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_005.png" alt="" width="390" height="278" /></div>
<p>Pada layer &#8220;layout bg&#8221; kasi layer Stye</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_007.png" alt="" width="230" height="184" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_008.png" alt="" width="240" height="184" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_009%20copy.png" alt="" width="240" height="100" /></div>
<p>Hasil sementara &#8230;</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_006.png" alt="" width="392" height="268" /></div>
<p>Lanjut, Tekan [CTRL+Click] pada Layer &#8220;layout bg&#8221; , bikin layer baru dengan nama layer &#8220;metal panel&#8221;, pilih Select &gt; Modify &gt; Contract 2 px. Tekan [ALT+Backspace] untuk mewarnai bidang dengan warna putih..</p>
<p>Kasi style pada layer &#8220;metal panel&#8221;</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_010.png" alt="" width="232" height="278" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_011.png" alt="" width="252" height="380" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_012.png" alt="" width="226" height="96" /></div>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_013.png" alt="" width="222" height="204" /></div>
<p>Hasilnya ..</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_014.png" alt="" width="390" height="268" /></div>
<p>Nah kalo layout dasarnya dah lu bikin..sekarang tinggal lu tambah2in pake pen tool untuk atribut2 lainnya..</p>
<p>Pilih. Rounded Rectangle tool, bikin bidang persegi..di bagiian atas untuk panel display..Gunakan Pen tool selection</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_009.png" alt="" width="28" height="24" /></div>
<p>untuk menampilkan area path vectornya..</p>
<p>Dengan Add Anchor Point tool</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_010.png" alt="" width="30" height="26" /></div>
<p>tambahkan titik &#8211; titik path pada bagian yang ditanda merah.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_011.png" alt="" width="104" height="71" /></div>
<p>Dan tarik keatas mengikuti arah panah.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_012%20copy.png" alt="" width="105" height="130" /></div>
<p>Perhatikan: Setelah menambah titik path pertama (atas) , langsung digeser ke atas sesuai arah panah , nah baru lu bikin titik path yang kedua (bawah).</p>
<p>Ok kasi aja layer style..nya: sama kaya layer style pada layer &#8220;layout bg&#8221; , cuman lu ganti gradient overlaynya dengan settign dibawah:</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Layerdremi_014%20copy.png" alt="" width="236" height="184" /></div>
<p>Kasi text &#8220;FUCK M I L I T E R I S M E&#8221; pada layer panel display. (terispirasi dari kebencian penulis pada sistem yang ada di sekolah pemerintahaan yang baru2 ini kembali memakan korban.</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/Adobedremi_015.png" alt="" width="132" height="86" /></div>
<p>Nah kembangkan kreativitas lu..untuk membuat tombol2 lainnya..</p>
<p>Gue pake selection tool untuk bikin tombol2nya dan   dengan Font style Visitor 2 (<a href="http://localhost/drev8-01/photoshop/Merancang%20Website%20%28%20Full%20Abis%20%29/visitor2.ttf">download disini</a>)</p>
<p>Hasil nya kaya gini niii..</p>
<div id="img"><img src="http://i175.photobucket.com/albums/w126/hairulazami/Green%20Alien%20Player/green-player%20copy.png" alt="Hasil Akhir" width="396" height="283" /></div>
<p>Woke 2 dah selesai , semoga bermanfaat..</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/green-alien-player.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/tutorials/photoshop/green-alien-player.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=23&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/e4W7QTxM_PI0eSARINpBgaC0q9c/0/da"><img src="http://feedads.g.doubleclick.net/~a/e4W7QTxM_PI0eSARINpBgaC0q9c/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/e4W7QTxM_PI0eSARINpBgaC0q9c/1/da"><img src="http://feedads.g.doubleclick.net/~a/e4W7QTxM_PI0eSARINpBgaC0q9c/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/UnXGH2nx3Ug" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/tutorials/photoshop/green-alien-player.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.dremi.info/tutorials/photoshop/green-alien-player.html</feedburner:origLink></item>
		<item>
		<title>Date Function dalam PHP – Cara untuk nampilin jam &amp; tanggal Ala PHP</title>
		<link>http://feedproxy.google.com/~r/tutorial-php/~3/Qq_KF38UGwk/date-function-dalam-php-cara-untuk-nampilin-jam-tanggal-ala-php.html</link>
		<comments>http://www.dremi.info/articles/date-function-dalam-php-cara-untuk-nampilin-jam-tanggal-ala-php.html#comments</comments>
		<pubDate>Wed, 31 Jan 2007 23:55:45 +0000</pubDate>
		<dc:creator>"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP datetime]]></category>
		<category><![CDATA[web articles]]></category>
		<category><![CDATA[web tips]]></category>

		<guid isPermaLink="false">http://www.dremi.info/?p=14</guid>
		<description><![CDATA[Date Function dalam PHP &#8211; Cara untuk nampilin jam &#038; tanggal Ala PHP Date Function dalam PHP Cara untuk nampilin jam &#38; tanggal Ala PHP Halo netter semuanya, khususnya buat yang ngisi komen trus nanyain cara nampilin jam &#38; tgl di web (chairuddin). untuk selanjutnya bagaimana kalo kita bisa ngobrol di Forum aja , setuju [...]]]></description>
			<content:encoded><![CDATA[<p>Date Function dalam PHP &#8211; Cara untuk nampilin jam &#038; tanggal Ala PHP <span id="more-101"></span> </p>
<p class="style11"><span class="style10"><span class="style16">Date</span> <span class="style14">Function</span> <span class="style15">dalam</span></span> <span class="style18">PHP</span><br />
<span class="style12">Cara untuk nampilin jam &amp; tanggal Ala PHP</span></p>
<p>Halo netter semuanya, khususnya buat yang ngisi komen trus nanyain cara nampilin jam &amp; tgl di web (<strong>chairuddin</strong>). untuk selanjutnya bagaimana kalo kita bisa ngobrol di Forum aja , setuju ? </p>
<p>Caranya sederhana saja, aku pake bahasa pemrograman PHP (Personal Home Page) aja. </p>
<p>Buka PHP Editor kamu, buat dokumen php baru.</p>
<p>Pendahuluan: <br />
Dalam PHP ada fungsi yang telah disediakan yakni fungsi date(_date_string_format);</p>
<p>coba ketik baris ini di php editor kamu:</p>
<p>Nama File: misalkan &quot;tanggal_dan_jam.php&quot;</p>
<p>Skripnya:</p>
<p class="style1"><span class="style2">&lt;HTML&gt;<br />
  &lt;HEAD&gt;</span><br />
  <span class="style2">&nbsp;&nbsp;&nbsp;&lt;TITLE&gt;</span><br />
  <span class="style2">&nbsp;&nbsp;&nbsp;</span>Aku sedang Belajar menampilakn fungsi tanggal &amp; waktu dalam PHP<span class="style2"><br />
  &nbsp;&nbsp;&nbsp;&lt;/TITLE&gt;</span><br />
   <span class="style2">&lt;/HEAD&gt;<br />
   &lt;BODY&gt;</span></p>
<p class="style1"><span class="style8">&lt;?</span> <span class="style6">echo</span> <span class="style2">date</span>(<span class="style10">&quot;d-m-Y H:i:s&quot;</span>); <span class="style8">?&gt;</span></p>
<p class="style4">&lt;/BODY&gt;<br />
&lt;/HTML&gt;</p>
<p>Sederhana bukan?</p>
<p>Kamus nya:</p>
<p>&#8211; &lt;? tag pembuka skrip PHP, bisa juga pake &lt;?PHP</p>
<p>&#8211; ?&gt; tag penutup skrip PHP  </p>
<p>&#8211; echo &#8211;&gt;&gt; perintah menampilkan hasil keluaran yang disusun dalam halaman, diadopsi dari perintah print dalam bahasa C++</p>
<p>&#8211; date(&quot;d-m-Y H:i:s&quot;) &#8211;&gt;&gt; fungsi bawaan yang telah disediakan bahasa PHP.</p>
<p>&#8211; d &#8211;&gt;&gt; karakter hari</p>
<p>&#8211; m &#8211;&gt;&gt; karakter bulan</p>
<p>&#8211; Y &#8211;&gt;&gt; karakter tahun (empat digit, misalkan: 2008), kalo mau dua digit: pake y kecil, contoh date(&quot;d-m-y&quot;);</p>
<p>&#8211; H &#8211;&gt;&gt; karakter jam (Hour) dengan format 24 jam, kalo pake format 12 jam gunakan h kecil, contoh date(&quot;d-m-Y h:i:s&quot;);</p>
<p>&#8211; i &#8211;&gt;&gt; karakter menit (minute)</p>
<p>&#8211; s &#8211;&gt;&gt; karakter detik (second)  </p>
<p>&#8211; ; tanda titik koma merupakan pointer dalam kompiler untuk mengetaui batas akhir seuah perintah skrip.    </p>
<p>Kalo ada yg ditanyakan silahkan replay Tips ini di forum sederhana dremi.info : <br />
  <a class="bodLink" href="http://www.dremi.info/ses_forum.php?cPub=viewTopic&amp;id=28">http://www.dremi.info/ses_forum.php?cPub=viewTopic&amp;id=28</a></p></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/date-function-dalam-php-cara-untuk-nampilin-jam-tanggal-ala-php.html" target="_blank"><img src="http://www.dremi.info/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.dremi.info/articles/date-function-dalam-php-cara-untuk-nampilin-jam-tanggal-ala-php.html" target="_blank" title="Share on Facebook">Share on Facebook</a></p><img src="http://www.dremi.info/?ak_action=api_record_view&id=101&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/6qPKVAJVbfpGtER_rE831IfTelo/0/da"><img src="http://feedads.g.doubleclick.net/~a/6qPKVAJVbfpGtER_rE831IfTelo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6qPKVAJVbfpGtER_rE831IfTelo/1/da"><img src="http://feedads.g.doubleclick.net/~a/6qPKVAJVbfpGtER_rE831IfTelo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/tutorial-php/~4/Qq_KF38UGwk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dremi.info/articles/date-function-dalam-php-cara-untuk-nampilin-jam-tanggal-ala-php.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.dremi.info/articles/date-function-dalam-php-cara-untuk-nampilin-jam-tanggal-ala-php.html</feedburner:origLink></item>
	<copyright>Copyright dremi.info - Semua efek, teknik, dan demonstrasi pembelajaran yang dijelaskan dalam tutorial dapat digunakan siapapun, dimanapun, dan untuk kepentingan apapun. Anda tidak diperbolehkan untuk mengkopi keseluruhan konten tutorial untuk kepentingan apapun, dalam bentuk apapun, sekalipun diterjemahkan ke dalam bahasa apapun. </copyright><media:credit role="author">"Hairul Azami" a.k.a "dr.emi" a.k.a "The BlackCat"</media:credit><media:rating>nonadult</media:rating><media:description type="plain">Tutorial PHP - dremi.info</media:description></channel>
</rss>

