<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-15469637</id><updated>2012-02-02T04:58:03.643+07:00</updated><title type='text'>PHP for YOU</title><subtitle type='html'>PHP for YOU - tutorials, news, tips...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15469637.post-114914040934870996</id><published>2006-06-01T12:30:00.000+07:00</published><updated>2006-06-01T12:40:51.686+07:00</updated><title type='text'>Google Search prefixes</title><content type='html'>Some Google Search prefixes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; &lt;span style="color:red;"&gt;link:url&lt;/span&gt; Shows other pages with links to that url.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;related:url&lt;/span&gt; same as "what's related" on serps.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;site:domain&lt;/span&gt; restricts search results to the given domain.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;allinurl:&lt;/span&gt; shows only pages with all terms in the url.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;inurl:&lt;/span&gt; like allinurl, but only for the next query word.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;allintitle:&lt;/span&gt; shows only results with terms in title.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;intitle:&lt;/span&gt; similar to allintitle, but only for the next word. "intitle:imagesh Free image hosting" finds only pages with webmasterworld in the title, and google anywhere on the page.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;cache:url&lt;/span&gt; will show the Google version of the passed url.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;info:url&lt;/span&gt; will show a page containing links to related searches, backlinks, and pages containing the url. This is the same as typing the url into the search box.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;spell:&lt;/span&gt; will spell check your query and search for it.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;stocks:&lt;/span&gt; will lookup the search query in a stock index.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;filetype:&lt;/span&gt; will restrict searches to that filetype. "-filetype:doc" to remove Microsoft word files.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;daterange:&lt;/span&gt; is supported in Julian date format only. 2452384 is an example of a Julian date.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;maps:&lt;/span&gt; If you enter a street address, a link to Yahoo Maps and to MapBlast will be presented.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;phone:&lt;/span&gt; enter anything that looks like a phone number to have a name and address displayed. Same is true for something that looks like an address (include a name and zip code)&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;site:www.somesite.net&lt;/span&gt; (tells you how many pages of your site are indexed by google)&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;allintext:&lt;/span&gt; searches only within text of pages, but not in the links or page title&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="color:red;"&gt;allinlinks:&lt;/span&gt; searches only within links, not text or title &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-114914040934870996?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/114914040934870996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=114914040934870996' title='32 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/114914040934870996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/114914040934870996'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2006/06/google-search-prefixes.html' title='Google Search prefixes'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>32</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-114899549593365801</id><published>2006-05-30T20:17:00.000+07:00</published><updated>2006-05-30T20:32:34.840+07:00</updated><title type='text'>Little PHP tip: to get a shorter string.</title><content type='html'>It's simple, but helpful to get the shorter string (for abstract,...)&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;   &lt;span style="color: rgb(0, 102, 0);"&gt; $num_words=10; // No. of words to get&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    $i=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    $array=explode(" ",$longString);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    $new_array=array();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    $total=count($array);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    while (($i&lt;$num_words) &amp;&amp;amp; ($i&lt;$total))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;       $new_array[]=$array[$i];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;       $i++;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;    $shortString = implode(" ",$new_array);&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;You can then make a function for reusing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(0, 102, 0);"&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;  function shortString($longString,$num_words)&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;  {&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    $i=0;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    $array=explode(" ",$longString);&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    $new_array=array();&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    $total=count($array);&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    while (($i&lt;$num_words) &amp;&amp;amp; ($i&lt;$total))&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    {&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;       $new_array[]=$array[$i];&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;       $i++;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    }&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;   &lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:100%;"  &gt;    return implode(" ",$new_array);&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;Cheer!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-114899549593365801?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/114899549593365801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=114899549593365801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/114899549593365801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/114899549593365801'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2006/05/little-php-tip-to-get-shorter-string.html' title='Little PHP tip: to get a shorter string.'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-114715442423444393</id><published>2006-05-09T12:55:00.000+07:00</published><updated>2006-05-09T13:00:24.246+07:00</updated><title type='text'>A new image hosting site will soon be launched!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/4963/1433/1600/imagesh_logo_alpha.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/4963/1433/320/imagesh_logo_alpha.gif" alt="" border="0" /&gt;&lt;/a&gt;It's a website that allow you upload images free. You don't need to registered an account to upload, but they recommended that there are a lot of benefit register one. Still they are on alpha (development) stage but this seems to be a promissing website that will contribute to the sharing image community soon.&lt;br /&gt;- It's concept is not new. But It seem&lt;br /&gt;Link: &lt;a href="http://imagesh.net/"&gt;ImageSH.net&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-114715442423444393?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://imagesh.net/' title='A new image hosting site will soon be launched!'/><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/114715442423444393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=114715442423444393' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/114715442423444393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/114715442423444393'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2006/05/new-image-hosting-site-will-soon-be.html' title='A new image hosting site will soon be launched!'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112744153863481558</id><published>2005-09-23T09:02:00.000+07:00</published><updated>2005-09-23T09:22:38.443+07:00</updated><title type='text'>Apress's Mandelbrot Generator Contest Result!</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/4963/1433/1600/13.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 155px; CURSOR: hand; HEIGHT: 118px" height="194" alt="" src="http://photos1.blogger.com/blogger/4963/1433/320/13.jpg" width="252" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;After carefully examining and testing numerous submissions for the fractal contest, Appress have selected three winners; one winner per language group. The speedy execution of their codes have earned each of them the prize of an Ipod Shuffle. Well, except for Mr. David Coakley (program in C, 1.08 seconds): his code runs the fastest among all the submissions and he wins the grand prize of a Playstation Portable!&lt;br /&gt;&lt;br /&gt;The winner for PHP group is Mathias Helm, which generation time is 2 minutes 28.7 seconds. You see, the PHP is somehow more than 100 times slower than C. My subscription entry is slower: 3 minutes 2.5 seconds. To tell the true, I could optimize it a little more, but I was disappointed with the slow run so I just sent the second or third optimized version of it. Anyway, I was quite happy to do it. Recall an old saying: "If something is worth doing, it's worth doing the best" or some thing like that. If someone had submitted the contest, please post your result and experience here?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.apress.com/promo/fractal/result.html"&gt;http://www.apress.com/promo/fractal/result.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112744153863481558?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.apress.com/promo/fractal/result.html' title='Apress&apos;s Mandelbrot Generator Contest Result!'/><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112744153863481558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112744153863481558' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112744153863481558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112744153863481558'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/09/apresss-mandelbrot-generator-contest.html' title='Apress&apos;s Mandelbrot Generator Contest Result!'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112489132808077347</id><published>2005-08-25T15:44:00.000+07:00</published><updated>2005-08-25T15:31:28.086+07:00</updated><title type='text'>PHP/MySQL List By Alphabet</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/4963/1433/1600/song_abc1.gif"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/4963/1433/320/song_abc1.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This simple tutorials will show you how to create a alphabet index to grabs data from a mysql database.&lt;br /&gt;Let's go on...&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. The alphabet index - how to create a cool one?&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong style="FONT-WEIGHT: 400"&gt;The first thing is list character from a to&lt;br /&gt;z. How to do this? In a I've read, the author did it by doing a loop like&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style="FONT-WEIGHT: 400"&gt;&lt;code&gt;for ($i=$start ;$i&amp;lt;=$end; $i++);&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style="FONT-WEIGHT: 400"&gt;Where $start and $end is the ASCII code of a&lt;br /&gt;and z. However, It's sometimes quite hard to remember this value. Actually, I&lt;br /&gt;cannot at the moment ;) So I solve the problem like this:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;$list[]='0-9';&lt;br /&gt;for ($ch=ord('a');$ch&lt;=ord('z');$ch++)&lt;br /&gt;&lt;/code&gt;&lt;code&gt;{&lt;br /&gt;   $list[]=chr($ch);&lt;br /&gt;} &lt;/code&gt;&lt;/p&gt;&lt;p&gt;Now that we have the list for the index. The next step is&lt;br /&gt;simple. You will define the number of items per row, for example: &lt;p&gt;&lt;code&gt;define('num_per_row','6');&lt;/code&gt; &lt;p&gt;The open a table, lop through the character set.&lt;br /&gt;Check if an item is the first cell -&amp;gt; open the row, or the last cell -&amp;gt; close a&lt;br /&gt;row: &lt;p&gt;&lt;code&gt;$num_rows=count($list);&lt;br /&gt;define ("TB_COLOR_LIGHT","#EEF7FA");&lt;br /&gt;define ("TB_COLOR_DARK","#DBE9EF");&lt;br /&gt;$width=(100/num_per_row).'%';&lt;br /&gt;echo '&amp;lt;table bgcolor="'.TB_COLOR_DARK.'" width="100%"&amp;gt;';&lt;br /&gt;for ($i=0;$i&amp;lt;$num_rows;$i++)&lt;br /&gt;{&lt;br /&gt;   if (0==$i%num_per_row)&lt;br /&gt;   {&lt;br /&gt;      echo '&amp;lt;tr align="center" valign="middle"&amp;gt;'; &lt;span style="color:#008000;"&gt;&lt;i&gt;// open the row&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;   $url=append_sid('your_result_page&amp;type=abc&amp;amp;keys='.$list[$i]);&lt;br /&gt;   echo '&amp;lt;td bgcolor="'.TB_COLOR_LIGHT.'" height="20" width="'.$width.'" nowrap&amp;gt;';&lt;br /&gt;   if (is_song_abc($list[$i])) &lt;span style="color:#008000;"&gt;&lt;i&gt;// show only necessary items, see bellow&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;   {&lt;br /&gt;     echo'&amp;lt;a href="'.$url.'"&amp;gt;&amp;lt;b&amp;gt;'.$list[$i].'&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;';&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;      echo $list[$i];&lt;br /&gt;   }&lt;br /&gt;   echo '&amp;lt;/td&amp;gt;';&lt;br /&gt;   if ((num_per_row-1)==$i%num_per_row) &lt;span style="color:#008000;"&gt;&lt;i&gt;// close the row&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;      echo '&amp;lt;/tr&amp;gt;';&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;echo '&amp;lt;/table&amp;gt;';&lt;/code&gt; &lt;p&gt;&lt;br /&gt;&lt;strong&gt;2. The search code &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The function is_abc($item) is to check if there is result which begin&lt;br /&gt;with that item, for example, we search song_name from table TB_SONGS&lt;/p&gt;&lt;code&gt;function is_song_abc($keywords)&lt;br /&gt;{&lt;br /&gt;   $where="song_name REGEXP '^[$keywords]'";&lt;br /&gt;   $sql ='SELECT count(*) as total&lt;br /&gt;          FROM '.TB_SONGS."&lt;br /&gt;          WHERE $where";&lt;br /&gt;   $result = sql_query($sql);&lt;br /&gt;   return mysql_result($result,'total');&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;p&gt;&lt;strong style="FONT-WEIGHT: 400"&gt;The search code is totally similiar, you can&lt;br /&gt;select what ever you want from the database with the WHERE condition is:&lt;/strong&gt;&lt;/p&gt;&lt;code&gt;$where="song_name REGEXP '^[$keywords]'";&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;3. Conclusion &lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;This tutorial is simple, yet useful to who new to mysql database search. In the next article, I intend to discuss more about mysql database search problem and some solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112489132808077347?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112489132808077347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112489132808077347' title='45 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112489132808077347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112489132808077347'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/phpmysql-list-by-alphabet.html' title='PHP/MySQL List By Alphabet'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>45</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112489163160608887</id><published>2005-08-24T20:52:00.000+07:00</published><updated>2005-08-24T20:54:42.083+07:00</updated><title type='text'>Oops, please re-comment me!</title><content type='html'>Today I found that I seem to have disable the comment of almost my post. That's so bad. So if you have some idea on my previous post, please comment for me.&lt;br /&gt;Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112489163160608887?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112489163160608887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112489163160608887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112489163160608887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112489163160608887'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/oops-please-re-comment-me.html' title='Oops, please re-comment me!'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112468428580030844</id><published>2005-08-22T11:11:00.000+07:00</published><updated>2005-08-24T20:51:32.333+07:00</updated><title type='text'>More on File Upload Handle In PHP</title><content type='html'>Some problem with PHP file upload handle:&lt;br /&gt;Make sure the file size not exceed desired value&lt;br /&gt;allow certain fype type: to prevent user upload harmful content.&lt;br /&gt;In my current project. I have to solve it all. In this artice, I will share you some of the trick. If you like to know more, feel free to ask question by commenting.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Make a Upload function:&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;////////////////////&lt;br /&gt;function upload_file($user_file,&lt;br /&gt;                     $dest_dir,&lt;br /&gt;                     $max_file_size,&lt;br /&gt;                     $to_file_name='')&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    $file_name=(empty($to_file_name))&lt;br /&gt;               ? $_FILES[$user_file]['name']&lt;br /&gt;               : $to_file_name;&lt;br /&gt;    $file_size=$_FILES[$user_file]['size'];&lt;br /&gt;    $temp_file=$_FILES[$user_file]['tmp_name'];&lt;br /&gt;    $upload_file="$dest_dir/$file_name";&lt;br /&gt;    $err='';&lt;br /&gt;    if ($_FILES[$user_file]['error'])&lt;br /&gt;    {&lt;br /&gt;       $err=upload_error_message(&lt;br /&gt;             $_FILES[$user_file]['error']&lt;br /&gt;             );&lt;br /&gt;       message_warning($err);&lt;br /&gt;       return false;&lt;br /&gt;    }&lt;br /&gt;    echo "&lt;br /&gt;Uploading file $file_name...";&lt;br /&gt;    if (DEBUG)&lt;br /&gt;    {&lt;br /&gt;       echo  "to $upload_file";&lt;br /&gt;    }&lt;br /&gt;    if (is_uploaded_file($temp_file))&lt;br /&gt;    { //check size&lt;br /&gt;       if ($file_size&gt;$max_file_size)&lt;br /&gt;       {&lt;br /&gt;          message_warning("&lt;br /&gt;          File size too large: $file_size&lt;br /&gt;          ");&lt;br /&gt;          unlink($temp_file);&lt;br /&gt;          return false;&lt;br /&gt;       }&lt;br /&gt;       if (file_exists($upload_file))&lt;br /&gt;       {&lt;br /&gt;          message_warning('File Existed');&lt;br /&gt;          unlink($temp_file);&lt;br /&gt;          return false;&lt;br /&gt;       }&lt;br /&gt;       if (move_uploaded_file($temp_file,$upload_file))&lt;br /&gt;       {&lt;br /&gt;          echo "&lt;br /&gt;File uploaded: &lt;b&gt;$file_name&lt;/b&gt;!";&lt;br /&gt;          return true;&lt;br /&gt;       }&lt;br /&gt;       else&lt;br /&gt;       {&lt;br /&gt;          message_warning('Cannot copy file!');&lt;br /&gt;          return false;&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        message_warning('Upload Failed!');&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Upload form valiate:&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function validate_upload_form($update=false)&lt;br /&gt;{&lt;br /&gt;   global $file_name;&lt;br /&gt;   global $tempfile;&lt;br /&gt;   global $err_file;&lt;br /&gt;&lt;br /&gt;   $ok=true;&lt;br /&gt;   if (empty($file_name))&lt;br /&gt;   {&lt;br /&gt;      $err_songfile='&lt;br /&gt;       &lt;span style="font-size:+0;"&gt;No file specified!&lt;/span&gt;';&lt;br /&gt;      $ok=false;&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;       $ext=get_ext($file_name);&lt;br /&gt;       if (!is_ext_allowed($ext))&lt;br /&gt;       {&lt;br /&gt;           $err_file='&lt;br /&gt;           &lt;span style="font-size:+0;"&gt;Exentions not allow&lt;/span&gt;';&lt;br /&gt;           $ok=false;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   if ( (!$ok)&amp;&amp;amp;amp;(!empty($tempfile)) )&lt;br /&gt;   {&lt;br /&gt;       delete_file($tempfile);&lt;br /&gt;   }&lt;br /&gt;   return $ok;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Get File extension:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function get_ext($filename)&lt;br /&gt;{&lt;br /&gt;    if (!empty($filename))&lt;br /&gt;    {&lt;br /&gt;       $pathinfo=pathinfo($filename);&lt;br /&gt;       return $pathinfo['extension'];&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;       return 'Unkown';&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Is an extension allow?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;//&lt;br /&gt;define ("EXT_ALLOWED",'mp3,wma,rm,mov,mid,swf,wmv');&lt;br /&gt;function is_ext_allowed($ext)&lt;br /&gt;{&lt;br /&gt;   $EXT_ALLOWED=explode(',',EXT_ALLOWED);&lt;br /&gt;   return in_array(strtolower($ext),$EXT_ALLOWED);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Upload error message:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function upload_error_message($err_code)&lt;br /&gt;{&lt;br /&gt;   switch ($err_code)&lt;br /&gt;   {&lt;br /&gt;      case UPLOAD_ERR_OK:&lt;br /&gt;         return 'No error';&lt;br /&gt;      case UPLOAD_ERR_INI_SIZE:&lt;br /&gt;         $max_size=return_bytes(&lt;br /&gt;                   ini_get('upload_max_filesize')&lt;br /&gt;                   );&lt;br /&gt;         return 'The uploaded file exceeds&lt;br /&gt;                 the upload_max_filesize directive&lt;br /&gt;                 in php.ini: '.$max_size.' bytes';&lt;br /&gt;      case UPLOAD_ERR_FORM_SIZE:&lt;br /&gt;         return 'The uploaded file exceeds&lt;br /&gt;                 the MAX_FILE_SIZE directive that&lt;br /&gt;                 was specified in the HTML form.';&lt;br /&gt;      case UPLOAD_ERR_PARTIAL:&lt;br /&gt;         return 'The uploaded file&lt;br /&gt;                 was only partially uploaded';&lt;br /&gt;      case UPLOAD_ERR_NO_FILE:&lt;br /&gt;         return 'No file was uploaded';&lt;br /&gt;      case UPLOAD_ERR_NO_TMP_DIR:&lt;br /&gt;         return 'Missing a temporary folder';&lt;br /&gt;      case UPLOAD_ERR_CANT_WRITE:&lt;br /&gt;         return 'Failed to write file to disk';&lt;br /&gt;      default:&lt;br /&gt;         return 'Unkown error';&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Upload Processing...&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   switch ($_action)&lt;br /&gt;   {&lt;br /&gt;      case 'upload':&lt;br /&gt;         if(validate_upload_form())&lt;br /&gt;         {&lt;br /&gt;            upload_processing();&lt;br /&gt;         }&lt;br /&gt;         else&lt;br /&gt;         {&lt;br /&gt;            show_upload_form();&lt;br /&gt;         }&lt;br /&gt;         break;&lt;br /&gt;      default:&lt;br /&gt;         show_upload_form();&lt;br /&gt;         break;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112468428580030844?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112468428580030844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112468428580030844' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112468428580030844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112468428580030844'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/more-on-file-upload-handle-in-php.html' title='More on File Upload Handle In PHP'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112450839539314292</id><published>2005-08-20T09:40:00.000+07:00</published><updated>2005-08-24T20:51:21.040+07:00</updated><title type='text'>File Upload Handle In PHP: Some tricky functions</title><content type='html'>&lt;span style="font-family:arial;"&gt;I try to say few words here. I Just want to show some problem and Ideas on File Upload Hanlde in PHP and some samples – asap (as simple as possible): &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Upload Limit Size There are 3 kind of limits:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;Limit Specified in HTML code &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;Limit specified by you-PHP program &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;Limit specified of upload_max_filesize in PHP Configuration Directives. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;The Limit by HTML form is useful to fast check upload file. But this can be trick if someone modifies the value in HTML code. So it's better recheck the value in PHP. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;But in some cases, the value you specified exceeds the value upload_max_filesize. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The question is how to check this value?&lt;br /&gt;You can use the following functions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#ff9900;"&gt;function return_bytes($val) &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#ff9900;"&gt;{&lt;br /&gt;$val = trim($val);&lt;br /&gt;$last = strtolower($val{strlen($val)-1});&lt;br /&gt;switch($last) &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#ff9900;"&gt;{&lt;br /&gt;case 'g':&lt;br /&gt;$val *= 1024;&lt;br /&gt;case 'm':&lt;br /&gt;$val *= 1024;&lt;br /&gt;case 'k':&lt;br /&gt;$val *= 1024;&lt;br /&gt;}&lt;br /&gt;return $val;&lt;br /&gt;} &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#ff9900;"&gt;&lt;br /&gt;function upload_max_filesize()&lt;br /&gt;{&lt;br /&gt;return return_bytes(ini_get(\'upload_max_filesize\'));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff9900;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112450839539314292?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112450839539314292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112450839539314292' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112450839539314292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112450839539314292'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/file-upload-handle-in-php-some-tricky.html' title='File Upload Handle In PHP: Some tricky functions'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112444264029565461</id><published>2005-08-19T15:54:00.001+07:00</published><updated>2005-08-24T20:51:44.510+07:00</updated><title type='text'>PHP Users authorization - some ideas?</title><content type='html'>User management is always a problem with web developers. You can see everywhere, that a visitor must sign up for several times in order to use different service in one website. That is boring and makes a lot of people run away. If you are the one who create a full website for yourself, I think you will unite the user management. That is true for some famous open source like php-nuke, xoops.&lt;br /&gt;Basically, the user management involves 2 database tables, say, tb_users and tb_groups. tb_users contains user_id, user_name, user_password, group_id and other information.&lt;br /&gt;tb_groups contains group_id, group_name and some authority like: auth_view, auth_post, auth_upload,...&lt;br /&gt;Whenever a user is logged and try to use a service, the php code will check the database to see if he have right or not.&lt;br /&gt;The following is a proposal function to it conveniently&lt;br /&gt;&lt;pre&gt;&lt;p&gt;function check_auth($user_id,$auth)&lt;br /&gt;////For example check_auth('upload')&lt;br /&gt;{ &lt;br /&gt;global $_CONNECTION; &lt;br /&gt;$group_id=get_group($user_id);&lt;br /&gt;$field="auth_$auth";&lt;br /&gt;$sql="SELECT $field                &lt;br /&gt;      FROM ".TB_GROUPS."     &lt;br /&gt;      WHERE group_id=$group_id"; &lt;br /&gt;if ($result=mysql_query($sql,$_CONNECTION))&lt;br /&gt;{  &lt;br /&gt;     if  (mysql_num_rows($result)) &lt;br /&gt;     { &lt;br /&gt;           return mysql_result($result,0,$field);       &lt;br /&gt;     }&lt;br /&gt;     else   &lt;br /&gt;     {&lt;br /&gt;          return 0; &lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;      return 0;&lt;br /&gt;}&lt;br /&gt;}//end function&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;If you have other ideas, please share ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112444264029565461?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112444264029565461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112444264029565461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112444264029565461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112444264029565461'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/php-users-authorization-some-ideas.html' title='PHP Users authorization - some ideas?'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112437399921419407</id><published>2005-08-18T20:43:00.000+07:00</published><updated>2005-08-24T20:51:56.373+07:00</updated><title type='text'>About Apress Contest and PHP Fractal Generator</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/4963/1433/1600/mand_output_0.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 115px; CURSOR: hand; HEIGHT: 89px" height="135" alt="" src="http://photos1.blogger.com/blogger/4963/1433/320/mand_output_0.jpg" width="139" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Apress has announced a Programming Contest on mandelbrot Fractal Generation.&lt;br /&gt;There are there proramming groups:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;C++, C&lt;/li&gt;&lt;li&gt;Perl, PHP, Python, Common Lisp&lt;/li&gt;&lt;li&gt;Java, C#, VB.NET&lt;/li&gt;&lt;/ul&gt;The fastest program in each group will win a SONY Playstation, the second will win a iPod Shuffle.&lt;br /&gt;I feel excited because one can use PHP to do it. Since I am not used to C++, I choose PHP and start coding.&lt;br /&gt;The result was quite dissapointed. For an image of 320x200, with number of itterations is 200, it take &gt; 20 second. (!) The same code written in C++ has much larger speed, though I cannot calculate exact number. I tried to optimized a lot, and the speed may increase nearly two times, but still too slow. I wonder what wrong with PHP loop and not sure about the performance of other languge in the group (perl, phython,...)&lt;br /&gt;At last, I submit the program althogh I can optimize it a litle more. Anyway, as the rule, I will expose the code after the contest finish.&lt;br /&gt;If anyone interested, you can still apply, since the deadline is August 31.&lt;br /&gt;Go to &lt;a href="http://www.apress.com/promo/fractal/"&gt;the website &lt;/a&gt;for more information&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112437399921419407?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112437399921419407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112437399921419407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112437399921419407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112437399921419407'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/about-apress-contest-and-php-fractal.html' title='About Apress Contest and PHP Fractal Generator'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112419123634758035</id><published>2005-08-16T18:09:00.000+07:00</published><updated>2005-08-16T18:28:31.540+07:00</updated><title type='text'>How to add the RSS feed to your Blogs/Site?</title><content type='html'>&lt;p&gt;You have little time to update your site/blogs frequently?&lt;br /&gt;You want to read latest news from a reliable source?&lt;br /&gt;One of the solution is the rss feed. &lt;/p&gt;&lt;p&gt;This is the simple tutorials of how to add rss feed to your blogs. &lt;/p&gt;&lt;ul&gt;&lt;li&gt;The first step is to get the rss source. You can find anywhere. For example, you can go to &lt;a href="http://google.com/"&gt;google&lt;/a&gt; and type few keywords then search. In this tutorials, you can go to &lt;a href="http://news.yahoo.com/"&gt;news.yahoo.com&lt;/a&gt;, type the keywords you want and see the result. On the bottom-right corner, you'll see a RSS icon. Right click, copy shortcut.&lt;/li&gt;&lt;li&gt;Then go to &lt;a href="http://jade.mcli.dist.maricopa.edu/feed/index.php?s=build"&gt;http://jade.mcli.dist.maricopa.edu/feed/index.php?s=build&lt;/a&gt; and paste the link into rss feed box. Choose some options and click preview to fit your needs. &lt;/li&gt;&lt;li&gt;Once you satisfied, click generate JavaScript code. Copy the code and past into you page/blog template. &lt;/li&gt;&lt;li&gt;Preview and Republish if you like, &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Enjoy,&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112419123634758035?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112419123634758035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112419123634758035'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/how-to-add-rss-feed-to-your-blogssite.html' title='How to add the RSS feed to your Blogs/Site?'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-15469637.post-112418434118121945</id><published>2005-08-16T16:12:00.000+07:00</published><updated>2005-08-16T18:27:17.483+07:00</updated><title type='text'>Starting Blogs - Continuing the Hobbies</title><content type='html'>&lt;blockquote&gt;&lt;p&gt;echo 'Hello the world';&lt;/p&gt;&lt;p align="left"&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;I am a big fan of PHP. Or should I say PHP is one if my biggest hobbies, although the number of mine is numerous. So, like the big fan of anything, one should have a lot of ideas around the objects. I intended to make a whole website for it. But it still in the plan. &lt;/p&gt;&lt;p&gt;A &lt;a href="http://vnindex.blogspot.com/"&gt;friend &lt;/a&gt;of mine told me that I should use a blog to keep track of myself, or to share my ideas. &lt;/p&gt;&lt;p&gt;I agree, "An unrecorded idea is an idea that often lost" - Zig Ziglar&lt;/p&gt;&lt;p&gt;So I set up this. The purpose is clear: to keep track of myself, share the ideas, practice my writing, etc. &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15469637-112418434118121945?l=php4u.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://php4u.blogspot.com/feeds/112418434118121945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15469637&amp;postID=112418434118121945' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112418434118121945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15469637/posts/default/112418434118121945'/><link rel='alternate' type='text/html' href='http://php4u.blogspot.com/2005/08/starting-blogs-continuing-hobbies.html' title='Starting Blogs - Continuing the Hobbies'/><author><name>Bui Hoang Hai</name><uri>http://www.blogger.com/profile/02391720997091308873</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-Ktr8UxB4pDQ/TV0K2OsR-4I/AAAAAAAARq4/YSV6M3PEMDU/s220/follow-the-sun.jpg'/></author><thr:total>8</thr:total></entry></feed>
