<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Technology . Business . Life</title>
	<atom:link href="http://azwan.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://azwan.net/blog</link>
	<description>azwan.net</description>
	<pubDate>Mon, 01 Mar 2010 21:47:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Replace line break with </title>
		<link>http://azwan.net/blog/programming/replace-line-break-with/</link>
		<comments>http://azwan.net/blog/programming/replace-line-break-with/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:47:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[database]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=205</guid>
		<description><![CDATA[This code is used to replace line break saved in database to  in html display

$astring = str_replace(chr(13) . chr(10), "", $astring);

]]></description>
			<content:encoded><![CDATA[<p>This code is used to replace line break saved in database to <br /> in html display</p>
<pre lang="php" num="1">
$astring = str_replace(chr(13) . chr(10), "", $astring);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/replace-line-break-with/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Edit bulk images</title>
		<link>http://azwan.net/blog/software/edit-bulk-images/</link>
		<comments>http://azwan.net/blog/software/edit-bulk-images/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 15:10:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[software]]></category>

		<category><![CDATA[faststone]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[image editing]]></category>

		<category><![CDATA[image editor]]></category>

		<category><![CDATA[photo]]></category>

		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=199</guid>
		<description><![CDATA[If you have to update especially resize and watermark multiple images fast, this tool is useful.
FastStone Image Viewer
The best part is it is free (for personal use)  
]]></description>
			<content:encoded><![CDATA[<p>If you have to update especially resize and watermark multiple images fast, this tool is useful.<br />
<a href="http://www.faststone.org/FSResizerDetail.htm">FastStone Image Viewer</a></p>
<p>The best part is it is free (for personal use) <img src='http://azwan.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/software/edit-bulk-images/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript jump box</title>
		<link>http://azwan.net/blog/programming/javascript-jump-box/</link>
		<comments>http://azwan.net/blog/programming/javascript-jump-box/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 09:08:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[combo box]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jump box]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=193</guid>
		<description><![CDATA[Sometime you want to automatically do something when people selecting an option from a combo box. Here is the HTML + js code

1
2
3
4
5
6
7
&#60;form name=&#34;form&#34;&#62;
&#60;select name=&#34;mybox&#34; onchange=&#34;window.location.href=this.options[this.selectedIndex].value;&#34;&#62;
     &#60;option selected&#62;Please Select
     &#60;option value=&#34;http://www.example.com/&#34;&#62;example site
     &#60;option value=&#34;http://www.google.com/&#34;&#62;google site
&#60;/select&#62;
&#60;/form&#62;

If want to open it in new window just [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime you want to automatically do something when people selecting an option from a combo box. Here is the HTML + js code</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;form name=&quot;form&quot;&gt;
&lt;select name=&quot;mybox&quot; onchange=&quot;window.location.href=this.options[this.selectedIndex].value;&quot;&gt;
     &lt;option selected&gt;Please Select
     &lt;option value=&quot;http://www.example.com/&quot;&gt;example site
     &lt;option value=&quot;http://www.google.com/&quot;&gt;google site
&lt;/select&gt;
&lt;/form&gt;</pre></td></tr></table></div>

<p>If want to open it in new window just change the window.location.href to window.open(xxx)</p>
]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/javascript-jump-box/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to handle checkbox in PHP</title>
		<link>http://azwan.net/blog/money/how-to-handle-checkbox-in-php/</link>
		<comments>http://azwan.net/blog/money/how-to-handle-checkbox-in-php/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 18:00:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[money]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[checkbox]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=189</guid>
		<description><![CDATA[Check box handling is bit different compared to other form objects because it can receive multiple values. Here is the HTML code for the form

1
2
&#60;input type=&#34;checkbox&#34; name=&#34;fruit[]&#34; value=&#34;a&#34; /&#62;Apple&#60;br /&#62;
&#60;input type=&#34;checkbox&#34; name=&#34;fruit[]&#34; value=&#34;o&#34; /&#62;Orange&#60;br /&#62;

and PHP code to handle the checkbox values.

1
2
3
4
5
6
7
8
9
$fruit = $_POST&#91;'fruit'&#93;;
  if&#40;!empty&#40;$fruit&#41;&#41; 
  &#123;
    foreach&#40;$fruit as $value&#41;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Check box handling is bit different compared to other form objects because it can receive multiple values. Here is the HTML code for the form</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;fruit[]&quot; value=&quot;a&quot; /&gt;Apple&lt;br /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;fruit[]&quot; value=&quot;o&quot; /&gt;Orange&lt;br /&gt;</pre></td></tr></table></div>

<p>and PHP code to handle the checkbox values.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$fruit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fruit'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fruit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fruit</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/money/how-to-handle-checkbox-in-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript date picker</title>
		<link>http://azwan.net/blog/programming/javascript-date-picker/</link>
		<comments>http://azwan.net/blog/programming/javascript-date-picker/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 07:19:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[date picker]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery date picker]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=185</guid>
		<description><![CDATA[I&#8217;ve been looking for a simple and clean date picker for few of my applications. I found this website very useful, listing 10 javascript date picker you can choose on.
21 Excellent Date Picker
One of my favorite one is this jQuery date picker
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for a simple and clean date picker for few of my applications. I found this website very useful, listing 10 javascript date picker you can choose on.</p>
<p><a href="http://www.bitrepository.com/a-collection-of-free-javascript-date-pickers.html" target="_self">21 Excellent Date Picker</a></p>
<p>One of my favorite one is this <a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html" target="_blank">jQuery date picker</a></p>
]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/javascript-date-picker/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Problem uploading big sql file via phpMyAdmin</title>
		<link>http://azwan.net/blog/database/problem-uploading-big-sql-file-via-phpmyadmin/</link>
		<comments>http://azwan.net/blog/database/problem-uploading-big-sql-file-via-phpmyadmin/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:04:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[database]]></category>

		<category><![CDATA[bigdump]]></category>

		<category><![CDATA[cpanel]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[mysqldumper]]></category>

		<category><![CDATA[phpmyadmin]]></category>

		<category><![CDATA[sqldump]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=182</guid>
		<description><![CDATA[I faced problem uploading a huge sql file to my shared hosting server. The size was not that big. It was only 1.8MB in size with about 30,000 records but phpMyAdmin (provided in cpanel) still failed to fully upload and run the file.
I then googled for a solution.
One of the solutions suggest to use SSH [...]]]></description>
			<content:encoded><![CDATA[<p>I faced problem uploading a huge sql file to my shared hosting server. The size was not that big. It was only 1.8MB in size with about 30,000 records but phpMyAdmin (provided in cpanel) still failed to fully upload and run the file.</p>
<p>I then googled for a solution.</p>
<p>One of the solutions suggest to use SSH but I&#8217;m not familiar with it.</p>
<p>Another solution is by using <a href="http://www.mysqldumper.net/" target="_blank">mysqldumper</a> but the configuration seems quite tedious.</p>
<p>Then I found another solution called <a href="http://www.ozerov.de/bigdump.php" target="_blank">BigDump</a> which is very straight forward. You upload a PHP script together with your huge sql file via FTP. Then just run the PHP script as usual. In a second all the data has been restored in your database.</p>
]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/database/problem-uploading-big-sql-file-via-phpmyadmin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Post to twitter with PHP</title>
		<link>http://azwan.net/blog/programming/post-to-twitter-with-php/</link>
		<comments>http://azwan.net/blog/programming/post-to-twitter-with-php/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 05:20:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=171</guid>
		<description><![CDATA[Automate is the key. If you have a dynamic site, you can use this code to post to your twitter account automatically (can use cron job or trigger by certain event). By doing this, you can have your twitter account updated automatically and become your external marketing tool with content rich.
PHP code:

1
2
3
4
5
6
7
8
9
10
11
12
13
&#60;?php
include_once 'twitterlib.php';
$t= new twitter&#40;&#41;;
$t-&#62;username='xxxxxxxx';
$t-&#62;password='xxxxxxxxx';
$res [...]]]></description>
			<content:encoded><![CDATA[<p>Automate is the key. If you have a dynamic site, you can use this code to post to your twitter account automatically (can use cron job or trigger by certain event). By doing this, you can have your twitter account updated automatically and become your external marketing tool with content rich.</p>
<p>PHP code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'twitterlib.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$t</span><span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> twitter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$t</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'xxxxxxxx'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$t</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'xxxxxxxxx'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$t</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">update</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'testing post via php code'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #339933;">===</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;ERROR&lt;hr/&gt;&quot;</span><span style="color: #339933;">;</span>   
   <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">responseInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
 <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
   <span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;SUCCESS.&lt;hr/&gt;Status Posted&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Class: (<a href="http://twitter.slawcup.com/twitter.class.phps">original source</a>)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">///////////////////////////////////////////</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// twitterPHP</span>
<span style="color: #666666; font-style: italic;">// version 0.1</span>
<span style="color: #666666; font-style: italic;">// By David Billingham</span>
<span style="color: #666666; font-style: italic;">// david [at] slawcup [dot] com</span>
<span style="color: #666666; font-style: italic;">// http://twitter.slawcup.com/twitter.class.phps</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Example 1:</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// $t= new twitter();</span>
<span style="color: #666666; font-style: italic;">// $res = $t-&gt;publicTimeline();</span>
<span style="color: #666666; font-style: italic;">// if($res===false){</span>
<span style="color: #666666; font-style: italic;">//   echo &quot;ERROR&lt;hr/&gt;&quot;;</span>
<span style="color: #666666; font-style: italic;">//   print_r($t-&gt;responseInfo);</span>
<span style="color: #666666; font-style: italic;">// }else{</span>
<span style="color: #666666; font-style: italic;">//   echo &quot;SUCCESS&lt;hr/&gt;&quot;;</span>
<span style="color: #666666; font-style: italic;">//   print_r($res);</span>
<span style="color: #666666; font-style: italic;">// }</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Example 2:</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// $t= new twitter();</span>
<span style="color: #666666; font-style: italic;">// $t-&gt;username='username';</span>
<span style="color: #666666; font-style: italic;">// $t-&gt;password='password';</span>
<span style="color: #666666; font-style: italic;">// $res = $t-&gt;update('i am testing twitter.class.php');</span>
<span style="color: #666666; font-style: italic;">// if($res===false){</span>
<span style="color: #666666; font-style: italic;">//   echo &quot;ERROR&lt;hr/&gt;&quot;;</span>
<span style="color: #666666; font-style: italic;">//   print_r($t-&gt;responseInfo);</span>
<span style="color: #666666; font-style: italic;">// }else{</span>
<span style="color: #666666; font-style: italic;">//   echo &quot;SUCCESS&lt;hr/&gt;Status Posted&quot;;</span>
<span style="color: #666666; font-style: italic;">// }</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//////////////////////////////////////////</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> twitter<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$username</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$password</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$user_agent</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">///////////////</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// I don't know if these headers have become standards yet</span>
    <span style="color: #666666; font-style: italic;">// but I would suggest using them.</span>
    <span style="color: #666666; font-style: italic;">// more discussion here.</span>
    <span style="color: #666666; font-style: italic;">// http://tinyurl.com/3xtx66</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">///////////////</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$headers</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'X-Twitter-Client: '</span><span style="color: #339933;">,</span>
                                            <span style="color: #0000ff;">'X-Twitter-Client-Version: '</span><span style="color: #339933;">,</span>
                                            <span style="color: #0000ff;">'X-Twitter-Client-URL: '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$responseInfo</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> twitter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
    <span style="color: #666666; font-style: italic;">/////////////////////////////////////////</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// Twitter API calls</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;update($status)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;publicTimeline($sinceid=false)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;friendsTimeline($id=false,$since=false)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;userTimeline($id=false,$count=20,$since=false)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;showStatus($id)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;friends($id=false)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;followers()</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;featured()</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;showUser($id)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;directMessages($since=false)</span>
    <span style="color: #666666; font-style: italic;">// $this-&gt;sendDirectMessage($user,$text)</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// If SimpleXMLElement exists the results will be returned as a SimpleXMLElement</span>
    <span style="color: #666666; font-style: italic;">// otherwise the raw XML will be returned for a successful request.  If the request</span>
    <span style="color: #666666; font-style: italic;">// fails a FALSE will be returned.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">/////////////////////////////////////////</span>
&nbsp;
&nbsp;
    <span style="color: #666666; font-style: italic;">// Updates the authenticating user's status.  </span>
    <span style="color: #666666; font-style: italic;">// Requires the status parameter specified below.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// status. (string) Required.  The text of your status update.  Must not be</span>
    <span style="color: #666666; font-style: italic;">//                             more than 160 characters and should not be</span>
    <span style="color: #666666; font-style: italic;">//                             more than 140 characters to ensure optimal display.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/update.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$postargs</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'status='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">,</span><span style="color: #000088;">$postargs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns the 20 most recent statuses from non-protected users who have</span>
    <span style="color: #666666; font-style: italic;">// set a custom user icon.  Does not require authentication.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// sinceid. (int) Optional.  Returns only public statuses with an ID greater</span>
    <span style="color: #666666; font-style: italic;">//                           than (that is, more recent than) the specified ID.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> publicTimeline<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sinceid</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sinceid</span><span style="color: #339933;">!==</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'?since_id='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sinceid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/public_timeline.xml'</span><span style="color: #339933;">.</span><span style="color: #000088;">$qs</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns the 20 most recent statuses posted in the last 24 hours from the</span>
    <span style="color: #666666; font-style: italic;">// authenticating user and that user's friends.  It's also possible to request</span>
    <span style="color: #666666; font-style: italic;">// another user's friends_timeline via the id parameter below.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// id. (string OR int) Optional.  Specifies the ID or screen name of the user for whom</span>
    <span style="color: #666666; font-style: italic;">//                                to return the friends_timeline. (set to false if you</span>
    <span style="color: #666666; font-style: italic;">//                                want to use authenticated user).</span>
    <span style="color: #666666; font-style: italic;">// since. (HTTP-formatted date) Optional.  Narrows the returned results to just those</span>
    <span style="color: #666666; font-style: italic;">//                                         statuses created after the specified date.  </span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> friendsTimeline<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$since</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #339933;">!==</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'?since='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">===</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/friends_timeline.xml'</span><span style="color: #339933;">.</span><span style="color: #000088;">$qs</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
            <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/friends_timeline/'</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xml'</span><span style="color: #339933;">.</span><span style="color: #000088;">$qs</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns the 20 most recent statuses posted in the last 24 hours from the</span>
    <span style="color: #666666; font-style: italic;">// authenticating user.  It's also possible to request another user's timeline</span>
    <span style="color: #666666; font-style: italic;">// via the id parameter below.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// id. (string OR int) Optional.  Specifies the ID or screen name of the user for whom</span>
    <span style="color: #666666; font-style: italic;">//                                to return the user_timeline.</span>
    <span style="color: #666666; font-style: italic;">// count. (int) Optional.  Specifies the number of statuses to retrieve.  May not be</span>
    <span style="color: #666666; font-style: italic;">//                         greater than 20 for performance purposes.</span>
    <span style="color: #666666; font-style: italic;">// since. (HTTP-formatted date) Optional.  Narrows the returned results to just those</span>
    <span style="color: #666666; font-style: italic;">//                                         statuses created after the specified date.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> userTimeline<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$count</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span><span style="color: #000088;">$since</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'?count='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #339933;">!==</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$qs</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&amp;since='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">===</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/user_timeline.xml'</span><span style="color: #339933;">.</span><span style="color: #000088;">$qs</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
            <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/user_timeline/'</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xml'</span><span style="color: #339933;">.</span><span style="color: #000088;">$qs</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns a single status, specified by the id parameter below.  The status's author</span>
    <span style="color: #666666; font-style: italic;">// will be returned inline.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// id. (int) Required.  Returns status of the specified ID.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> showStatus<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/show/'</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Returns the authenticating user's friends, each with current status inline.  It's</span>
    <span style="color: #666666; font-style: italic;">// also possible to request another user's friends list via the id parameter below.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// id. (string OR int) Optional.  The ID or screen name of the user for whom to request</span>
    <span style="color: #666666; font-style: italic;">//                                a list of friends.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> friends<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">===</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/friends.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
            <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/friends/'</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns the authenticating user's followers, each with current status inline.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> followers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/followers.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns a list of the users currently featured on the site with their current statuses inline.</span>
    <span style="color: #000000; font-weight: bold;">function</span> featured<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/statuses/featured.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns extended information of a given user, specified by ID or screen name as per the required</span>
    <span style="color: #666666; font-style: italic;">// id parameter below.  This information includes design settings, so third party developers can theme</span>
    <span style="color: #666666; font-style: italic;">// their widgets according to a given user's preferences.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// id. (string OR int) Required.  The ID or screen name of a user.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> showUser<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/users/show/'</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Returns a list of the direct messages sent to the authenticating user.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// since. (HTTP-formatted date) Optional.  Narrows the resulting list of direct messages to just those</span>
    <span style="color: #666666; font-style: italic;">//                                         sent after the specified date.  </span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> directMessages<span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #339933;">!==</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$qs</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'?since='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$since</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/direct_messages.xml'</span><span style="color: #339933;">.</span><span style="color: #000088;">$qs</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Sends a new direct message to the specified user from the authenticating user.  Requires both the user</span>
    <span style="color: #666666; font-style: italic;">// and text parameters below.</span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #666666; font-style: italic;">// user. (string OR int) Required.  The ID or screen name of the recipient user.</span>
    <span style="color: #666666; font-style: italic;">// text. (string) Required.  The text of your direct message.  Be sure to URL encode as necessary, and keep</span>
    <span style="color: #666666; font-style: italic;">//                           it under 140 characters.  </span>
    <span style="color: #666666; font-style: italic;">//</span>
    <span style="color: #000000; font-weight: bold;">function</span> sendDirectMessage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">,</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/direct_messages/new.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$postargs</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'user='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;text='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">process</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">,</span><span style="color: #000088;">$postargs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
    <span style="color: #666666; font-style: italic;">// internal function where all the juicy curl fun takes place</span>
    <span style="color: #666666; font-style: italic;">// this should not be called by anything external unless you are</span>
    <span style="color: #666666; font-style: italic;">// doing something else completely then knock youself out.</span>
    <span style="color: #000000; font-weight: bold;">function</span> process<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #000088;">$postargs</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> curl_init<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$postargs</span> <span style="color: #339933;">!==</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            curl_setopt <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            curl_setopt <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$postargs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span> <span style="color: #339933;">!==</span> <span style="color: #000000; font-weight: bold;">false</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span> <span style="color: #339933;">!==</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
            curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_USERPWD<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_VERBOSE<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_NOBODY<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_USERAGENT<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_agent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HTTPHEADER<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> curl_exec<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">responseInfo</span><span style="color: #339933;">=</span>curl_getinfo<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        curl_close<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">responseInfo</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'http_code'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SimpleXMLElement'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$response</span><span style="color: #339933;">;</span>    
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/post-to-twitter-with-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript code to prompt delete</title>
		<link>http://azwan.net/blog/programming/javascript-code-to-prompt-delete/</link>
		<comments>http://azwan.net/blog/programming/javascript-code-to-prompt-delete/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 05:55:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=161</guid>
		<description><![CDATA[This simple javascript code can be used to prompt user whether they want to proceed with an action or not. Usually be used when user click on delete or remove button/link. 
The javascript code

1
2
3
4
5
6
7
8
9
10
11
12
&#60;script LANGUAGE=&#34;JavaScript&#34;&#62;
&#60;!--
function confirmSubmit&#40;&#41;
&#123;
var agree=confirm&#40;&#34;Are you sure you want to DELETE this record?&#34;&#41;;
if &#40;agree&#41;
	return true ;
else
	return false ;
&#125;
// --&#62;
&#60;/script&#62;

The HTML code

1
&#60;a href=&#34;?act=delete&#38;id=1234&#34; onClick=&#34;return [...]]]></description>
			<content:encoded><![CDATA[<p>This simple javascript code can be used to prompt user whether they want to proceed with an action or not. Usually be used when user click on delete or remove button/link. </p>
<p>The javascript code</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script LANGUAGE<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span>
<span style="color: #003366; font-weight: bold;">function</span> confirmSubmit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> agree<span style="color: #339933;">=</span><span style="color: #000066;">confirm</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Are you sure you want to DELETE this record?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>agree<span style="color: #009900;">&#41;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">else</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// --&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>The HTML code</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;?act=delete&amp;id=1234&quot; onClick=&quot;return confirmSubmit()&quot;&gt;Delete&lt;/a&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/javascript-code-to-prompt-delete/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP code for xml parser (rss)</title>
		<link>http://azwan.net/blog/programming/php-code-for-xml-parser-rss/</link>
		<comments>http://azwan.net/blog/programming/php-code-for-xml-parser-rss/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 02:43:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[blog fee]]></category>

		<category><![CDATA[feed]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[php code]]></category>

		<category><![CDATA[rss]]></category>

		<category><![CDATA[rss reader]]></category>

		<category><![CDATA[xml parser]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=155</guid>
		<description><![CDATA[I&#8217;ve been looking for PHP code to read RSS feed from blog. It is a simple XML reader code actually and can use a ready class available on the net.
I found this class magpierss which is quite easy to use. You just need to include one file in your code and that one file will [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for PHP code to read RSS feed from blog. It is a simple XML reader code actually and can use a ready class available on the net.</p>
<p>I found this class <a href="http://magpierss.sourceforge.net/">magpierss</a> which is quite easy to use. You just need to include one file in your code and that one file will call few other library files.</p>
<p>The PHP code you need to use to get the XML data is just like this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MAGPIE_DIR'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rssreader/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>MAGPIE_DIR<span style="color: #339933;">.</span><span style="color: #0000ff;">'rss_fetch.inc'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.azwan.net/blog/feed/'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$url</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> fetch_rss<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$url</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Channel: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;p&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">items</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$href</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>	
		<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&lt;a href=<span style="color: #006699; font-weight: bold;">$href</span>&gt;<span style="color: #006699; font-weight: bold;">$title</span>&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a href="http://azwan.net/download/rssreader.zip">Download code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/php-code-for-xml-parser-rss/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A dynamic header</title>
		<link>http://azwan.net/blog/programming/a-dynamic-header/</link>
		<comments>http://azwan.net/blog/programming/a-dynamic-header/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 19:44:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[html header]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://azwan.net/blog/?p=149</guid>
		<description><![CDATA[This is a dynamic header if you use include &#8216;header.php&#8217; in your programming.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
echo '&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=iso-8859-1&#34; /&#62;';
&#160;
// set title
if &#40;$title == ''&#41; 
	$title = 'My home page'; // default title	
$title .= ' - mydomain.com'; // append branding (e.g. your domain name)
echo '&#60;title&#62;'.$title.'&#60;/title&#62;';
&#160;
// set description if any
if [...]]]></description>
			<content:encoded><![CDATA[<p>This is a dynamic header if you use include &#8216;header.php&#8217; in your programming.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&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;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// set title</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'My home page'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// default title	</span>
<span style="color: #000088;">$title</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">' - mydomain.com'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// append branding (e.g. your domain name)</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;title&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/title&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// set description if any</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$description</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;meta name=&quot;description&quot; content=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$description</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// set keyword</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$keywords</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;meta name=&quot;keywords&quot; content=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$keywords</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// insert css if any</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$css</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$css</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;link rel=&quot;stylesheet&quot; href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; type=&quot;text/css&quot; /&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// can have static if only one css available</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// insert javascript if any</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$js</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$js</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;script language=&quot;javascript&quot; src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;/head&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>From the file you include, you can set something like this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #666666; font-style: italic;">//set variables</span>
	<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'My home page'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$keyword</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$js</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'formvalidation.js'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'datecalc.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//include javascript</span>
	<span style="color: #000088;">$css</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'style.css'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'form.css'</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// include css</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//include header</span>
	<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'header.php'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://azwan.net/blog/programming/a-dynamic-header/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
