<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>php &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/php/</link>
	<description>Feed of posts on WordPress.com tagged "php"</description>
	<pubDate>Fri, 16 May 2008 17:20:05 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[php ile grafik(resim) oluşturma]]></title>
<link>http://gokhanaygun.wordpress.com/?p=6</link>
<pubDate>Fri, 16 May 2008 17:19:28 +0000</pubDate>
<dc:creator>gokhanaygun</dc:creator>
<guid>http://gokhanaygun.wordpress.com/?p=6</guid>
<description><![CDATA[Merhabalar arkadaşlar php nin bir çok güzel özelliğinin yanında birde grafik oluşturma özell]]></description>
<content:encoded><![CDATA[<p>Merhabalar arkadaşlar php nin bir çok güzel özelliğinin yanında birde grafik oluşturma özelliğide mevcut.<br />
Peki ne için kullanabiliriz oluşturduğumuz grafikleri ?</p>
<ul>
<li>eleman Forum bilgi girişlerinde güvenlik resimini oluşturmada</li>
<li>eleman Sitemizde istatistik veya grafiksel tablo çiziminde</li>
<li>eleman Matematiksel işlemleri ifade etmek için foksiyon, parabol vs. çizmek için</li>
</ul>
<p>php 4 .. ten sonra grafik çizmek için ek bir şey yapmanıza gerek yok serverinizin  php dizininde mevcut gd grafik kütühanesi dosyaları .</p>
<p>Png , jpeg, wpneg dosya tiplerini destekliyor gif ' dosyalarınıda destekliyordu ancak lisans sorunlarından dolayı artık desteklemiyor.<br />
Bu arada serveri c 'sürücüsüne kurduğunuz varsayıyorum<br />
c:windows/php.ini  içinde    ;extension=php_bz2.dll   bulun  ve önündeki ;  kaldırın . Artık grafik oluşturabiliriz veya bi resim üzerinde değişiklikte yapabiliriz.</p>
<p>Şimdi .php sayfamızı açıyoruz tertemiz bi sayfa olması gerekiyo :)<br />
Sayfamızın grafik çizeceğini belirtmemiz gerekiyor en başında;</p>
<p>jpeg için</p>
<p><code><span style="color:#ff6600;">header("Content-type:image/jpeg")</span></code></p>
<p>png için</p>
<p><code><span style="color:#ff6600;">header("Content-type:image/png")</span></code></p>
<p>şeklinde bir tanım yapıyoruz sayfamızın en başına</p>
<p>Şimdi ise grafik alanını belirlemimiz gerekiyor bunuda</p>
<p><code><span style="color:#ff6600;">imagecreate(x,y)</span></code></p>
<p>bu şekilde oluşturuyoruz <br />
ve ekranda gosteriyoruz jpeg için  <code>imagejpeg</code><br />
png için <code>imagepng </code>ve bu bilgilerimiz şimdi bi grafik oluşturalım</p>
<p>&#60;?<br />
<code><!--r--><span style="color:#ff6600;">header("Content-type:image/jpeg");<br />
$my_img=imagecreate(100,100);<br />
imagejpeg($my_img);<br />
?&#62;</span></code><br />
Oluşan grafik<br />
<img style="vertical-align:middle;border:black 1px solid;" src="http://pic1.resimupload.com/r9/thumb_195277478.bmp" alt="siyah grafik" width="104" height="103" /></p>
<p>///////////////////////////////////////////////////////////////<br />
<code><span style="color:#ff6600;">imagecolorallocate($resim_degiskeni,rgb)</span></code></p>
<p>rgb değeri (red,green,blue)kırmızı,yeşil ve mavi nin reng değerleridir.<br />
her bir renk değer 0 ile 255 kadar alır ,eğer biz herhangi bir renk değeri<br />
vermemişsek grafiğimize ,standart olarak rgb(0,0,0) yanı siyah değerini alır<br />
örneğin</p>
<p> <br />
<code><span style="color:#ff6600;">$red=imagecolorallocate($resim_degiskeni,255,0,0);<br />
$green=imagecolorallocate($resim_degiskeni,0,255,0);<br />
$blue=imagecolorallocate($resim_degiskeni,0,0,255);</span></code><br />
 <br />
 sizce kendi hayal gücünüz ile istediğiniz renkleri bekala oluşurabilirsiniz<br />
 örneğin turuncuya yakın bi rengi oluşturalım</p>
<p> <code><span style="color:#ff6600;">$turuncu=imagecolorallocate($resim_degiskeni,255,200,0);</span></code></p>
<p>sıra güzel bir yapmakta ;<br />
bu örneğimiz jpeg dosya formatında 200*200 boyutunda ve turunce olsunmu :)</p>
<p><code><span style="color:#ff6600;"><!--r-->header("Content-type:image/jpeg");<br />
$my_img=imagecreate(200,200);<br />
$turuncu=imagecolorallocate($my_img,255,200,0);<br />
imagejpeg($my_img);<br />
imagedestroy($my_img);//bu fonksiyon sunucudaki resmi siler yanı sunucu boşuna yormaz .<br />
?&#62;;<br />
</span></code><br />
Oluşan grafik</p>
<p><img style="border:black 1px solid;" src="http://pic1.resimupload.com/r1/thumb_606413261.bmp" alt="Turuncu grafik" width="159" height="160" /></p>
<p>imagefill(x,y,$boya_rengi) // imagefill($resim_deigkeni,100,200,$turuncu) gibi</p>
<p>dikdortgen çizgen için</p>
<p><span style="color:#ff6600;">imagefilledrectangle ( $resim_degiskeni, x1,y1,x2,y2,$renk );</span></p>
<p>elips çizmek için</p>
<p><span style="color:#ff6600;">imagefilledellipse($resim;degiskeni,x,y,z,v,$renk);</span></p>
<p>çizgi çizmek için</p>
<p><span style="color:#ff6600;">imageline ( $resim, x1,y1,x2,y2,$renk);</span></p>
<p>ve en önemlilerinden yazı yazmak, mesela form post butonun ustundeki veya yanındaki güvenlik resimleri için<br />
çok ideal</p>
<p><span style="color:#ff6600;">imagestring($resim_degiskeni,x,y,z,$yazi,$renk);</span></p>
<p>tabi bu görüdklerimiz grafik olayının sadece üst kısmı yanı görünen kısmı eğer grafik hoşunuza gittiyse, çok daha ileri derecede<br />
şeyleri , neden yapmayasınız ki mesela bir sitenin belirli zamanlar ziyaretçi grafiği , veya güzel şekilli yazılar ,parabol çizimleri<br />
ve daha niceleri bunun için php.net i incelemizi tavsiye ederim .</p>
<p>Şimdide tüm bu gördüklerimizi küçük bir uygulama ile yazalım  ve makalemizi birelim isterseniz. :)</p>
<p><code>&#60;?<br />
<!--r--><span style="color:#888888;"><!--r-->header("Content-type: image/jpeg");<br />
$my_img =imagecreate(430,400);<br />
$kirmizi =imagecolorallocate($my_img,00,220,0);<br />
$koyu_mavi =imagecolorallocate($my_img, 0,0,100);<br />
$beyaz=imagecolorallocate($my_img,255,255,255);<br />
$sari=imagecolorallocate($my_img,150,200,0);<br />
$dolgu=imagefill($my_img,700,500,$beyaz);<br />
$gol=imagecolorallocate($my_img,0,0,255);<br />
$golgeli=imagecolorallocate($my_img,0,255,0);<br />
$dikdortgen=imagerectangle($my_img,50,200,300,100,$koyu_mavi);<br />
$yazi1=imagestring($my_img,40,60,100,"NOktAlI VirGÜl",$beyaz);<br />
$cati_1=imageline($my_img,190,0,51,100,$sari);<br />
$cati_2=imageline($my_img,190,0,300,100,$sari);<br />
for($i=190; $i&#60;300; $i++){<br />
$c1=imageline($my_img,190,0,$i,100,$sari);</span></code></p>
<p><span style="color:#888888;">}<br />
for($j=51; $j&#60;200; $j++){<br />
$c2=imageline($my_img,190,0,$j,100,$golgeli);<br />
}<br />
$dd=imageline($my_img,200,200,200,20,$sari);</span></p>
<p><span style="color:#888888;">$pencere1=imagerectangle($my_img,55,150,100,120,$beyaz);<br />
$pencere2=imagerectangle($my_img,230,150,280,120,$beyaz);<br />
$pencere2=imagerectangle($my_img,200,150,150,120,$beyaz);<br />
$kapi=imagerectangle($my_img,110,198,135,160,$beyaz);<br />
for($art=0; $art&#60;100; $art++){<br />
// $basamak1=imagerectangle($my_img,135,300,10+$art,250+$eksi,$beyaz);<br />
for($eksi=0; $eksi&#60;100; $eksi++){<br />
$basamak=imagerectangle($my_img,200,500+$eksi,200+$art,350,$sari);</span></p>
<p><span style="color:#888888;">$dsa2=imagefilledellipse($my_img,$art,400,150,50,$beyaz);</span></p>
<p><span style="color:#888888;">$havuz=imagefilledellipse($my_img,250,350,$eksi+50,50,$gol);</span></p>
<p><span style="color:#888888;">}<br />
}<br />
$ressam=imagestring($my_img,200,0,380,"noktalivurgul.com",$sari);</span></p>
<p><span style="color:#888888;">imagejpeg($my_img);<br />
imagedestroy($my_img);<br />
?&#62;</span></p>
<p><span style="color:#888888;">oluşan grafik</span></p>
<p><img style="border:white 1px solid;" src="http://programci13.googlepages.com/php_grafik.jpg" alt="php grafik,graph" width="431" height="403" /></p>
<p>Makale burda bitmiştir. Her türlü olumlu, olumsuz eleştiriye açığım ,unutmamalıdır ki olumluz eleştiriler insanı daima geliştirir yeni bir şeyler öğrenmeye sevk eder, olumlu eleştiriler ise insana bir morel olur :) . Her ne kadarda eksiksik olmasına gayret ettiysem ,mutlaka eksiklerim olacaktır bundan tüm okurlardan özür dilerim . Okuduğunuz için teşekkür ederim</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Digg API: Showing latest stories from your site/URL/domain]]></title>
<link>http://wuwei2k2.wordpress.com/?p=8</link>
<pubDate>Fri, 16 May 2008 16:43:42 +0000</pubDate>
<dc:creator>wuwei2k2</dc:creator>
<guid>http://wuwei2k2.wordpress.com/?p=8</guid>
<description><![CDATA[To do: To show a list of the latest stories from your site/URL/domain using the Digg API.
Solution:
]]></description>
<content:encoded><![CDATA[<p>To do: To show a list of the latest stories from your site/URL/domain using the Digg API.</p>
<p>Solution:</p>
<p>The following PHP code will display the latest 20 stories from the domain of your choice. Thanks a heap to <a href="http://www.earn-web-cash.com/2008/02/16/digg-api-random-story/" target="_blank">Web Cash's entry on grabbing a random Digg story</a> as well as the <a href="http://apidoc.digg.com/ListStories" target="_blank">Digg Story API</a> which helped with this code.</p>
<p><!--more--></p>
<p>[sourcecode language="php"]</p>
<p><?php<br />
//  Takes an array of arguments and returns a query string<br />
//  Each parameter's name is its key in the array<br />
function buildQuery ($args) {<br />
  $query = '?';<br />
  foreach ($args as $key => $val) {<br />
    if ( $query != '?' )<br />
      $query .= '&';</p>
<p>    $query .= $key . '=' . urlencode($val);<br />
  }</p>
<p>  return $query;<br />
}</p>
<p>// Digg specifies that user agent must be set<br />
ini_set('user_agent', 'My domain stories/1.0');</p>
<p>$baseurl = 'http://services.digg.com';<br />
$endpoint = '/stories';<br />
$url = $baseurl . $endpoint;<br />
// Number of stories to display<br />
$numberStories = 20;<br />
// Your domain of choice - CHANGE THIS<br />
$domainName = 'your.domain.com'; </p>
<p>//  Parameters to fetch latest articles<br />
$params = array();<br />
$params['appkey'] = 'http://' . $domainName;<br />
$params['domain'] = $domainName;<br />
$params['type'] = 'xml';</p>
<p>$params['count'] = '' . $numberStories;<br />
// The following displays the newest items first<br />
// This can be changed using the parameters in the Digg API<br />
$params['sort'] = 'submit_date-desc'; </p>
<p>//  Reuse the $url created above<br />
$query = buildQuery($params);<br />
$reqUrl = $url . $query;</p>
<p>// Display the URL. Uncomment for troubleshooting.<br />
// echo $reqUrl . "\n";</p>
<p>$xml = simplexml_load_file($reqUrl);</p>
<p>//  Output the stories<br />
for ($i=0; $i<$numberStories;$i++) {<br />
  $numberDiggs = intval($xml->story[$i]['diggs']);<br />
  echo '
<p>';<br />
  echo '<br />
<h2><a href="' . $xml->story[$i]['href'] . '">'<br />
    . $xml->story[$i]->title . '</a></h2>
<p>';</p>
<p>  // Number of Diggs<br />
  echo '<b>Diggs: ' . $xml->story[$i]['diggs'] . ' ' ;<br />
  // If you don't have an image for number of diggs,<br />
  // then uncomment the following line<br />
  for ($j=0; $j<$numberDiggs; $j++) echo '<img src="digg.gif"> ';<br />
  echo '</b><br />';</p>
<p>  echo 'Date: ' . date('m-d-Y, H:i:s', (int) $xml->story[$i]['submit_date']) . '<br />';<br />
  echo 'Link: <a href="' . $xml->story[$i]['link'] . '">'<br />
    . $xml->story[$i]['link'] . '</a><br />';<br />
  echo 'Topic: ' . $xml->story[$i]->topic['name'] . '<br />';<br />
  echo 'Container: ' . $xml->story[$i]->container['name'] . '<br />';<br />
  echo 'Desc: ' . $xml->story[$i]->description . "</p>
<p>\n";<br />
}<br />
?><br />
[/sourcecode]</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Taşındık..]]></title>
<link>http://frixe.wordpress.com/?p=17</link>
<pubDate>Fri, 16 May 2008 13:04:03 +0000</pubDate>
<dc:creator>noone18</dc:creator>
<guid>http://frixe.wordpress.com/?p=17</guid>
<description><![CDATA[Merhaba sevgili blog okuyucularım artık burada değilde blogger’de barındırılan blogumda yazm]]></description>
<content:encoded><![CDATA[<p>Merhaba sevgili blog okuyucularım artık burada değilde blogger’de barındırılan blogumda yazmaya devam edeceğim.  Neden oraya gidiyorsun ya burada iyiydik diyenler varsa bunun en önemli sebebi wordpress.com’un Türkiye’de uzun süre banlanmış olması bu yüzden belki ileride ne olur bilemem ama şu anda diğer blogumda yazmaya başlayacağım. Diğer siteme nasıl ulaşırsınız</p>
<p style="text-align:center;"><a href="http://noertz.blogspot.com/"><strong><span style="color:#515151;">http://noertz.blogspot.com</span></strong></a><strong> </strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Taşındık...]]></title>
<link>http://yusufislamkara.wordpress.com/?p=52</link>
<pubDate>Fri, 16 May 2008 13:00:40 +0000</pubDate>
<dc:creator>noone18</dc:creator>
<guid>http://yusufislamkara.wordpress.com/?p=52</guid>
<description><![CDATA[Merhaba sevgili blog okuyucularım artık burada değilde blogger&#8217;de barındırılan blogumda ]]></description>
<content:encoded><![CDATA[<p>Merhaba sevgili blog okuyucularım artık burada değilde blogger'de barındırılan blogumda yazmaya devam edeceğim.  Neden oraya gidiyorsun ya burada iyiydik diyenler varsa bunun en önemli sebebi wordpress.com'un Türkiye'de uzun süre banlanmış olması bu yüzden belki ileride ne olur bilemem ama şu anda diğer blogumda yazmaya başlayacağım. Diğer siteme nasıl ulaşırsınız</p>
<p style="text-align:center;"><a href="http://noertz.blogspot.com"><strong>http://noertz.blogspot.com</strong></a><strong> </strong></p>
<p> </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ตารางเรียนปีสามเทอมหนึ่ง(ภาค1)]]></title>
<link>http://ammiiam.wordpress.com/?p=28</link>
<pubDate>Fri, 16 May 2008 12:59:27 +0000</pubDate>
<dc:creator>Ammii*</dc:creator>
<guid>http://ammiiam.wordpress.com/?p=28</guid>
<description><![CDATA[ที่พูดว่า &#8220;ภาคหนึ่ง&#8221; เพราะเชื่อ(]]></description>
<content:encoded><![CDATA[<p style="text-align:left;">ที่พูดว่า "ภาคหนึ่ง" เพราะเชื่อ(ลึกๆ)ว่าต้องมีภาคสองแน่นอน 555<br />
ตอนนี้ตารางเรียนยังออกไม่ครบ ออกมาแค่ 3 ตัวเท่านั้น แต่แค่สามตัวก็สร้างความโศกเศร้าให้กับใครหลายๆคน เพราะเทอมนี้ไอทีปีสามมีเรียน "วันเสาร์"!!!</p>
<p style="text-align:center;">TU110 			Integrated Humanities( EM(2),CS(3),IT(3))	<span style="color:#ff0000;">SA</span>09:00-12:00 BKD 3207</p>
<p style="text-align:left;">เป็นครั้งแรกที่เรียนวันเสาร์ที่บางกะดี แย่จริงๆ ถ้าเรียนรังสิตก็คงพอทำใจได้ แต่นี่อะไร เรียนบางกะดี ให้ตายเถิด แย่จริงๆ แถมเซคชั่นนี้ดูท่าจะใช่พอตัว มีตั้งสามภาคทั้ง EM2 CS3 IT3 ไม่เคยเรียนกับCS3 แบบเป็นทางการมาก่อนเลย แต่ก็นะ พอตอนตัดเกรดก็ไม่ค่อยอยากนึกถึงหรอก 555+</p>
<p style="text-align:left;">ตอนนี้ก็พอทำใจได้แล้ว ส่วนวิชาอื่นๆที่ออกมาก็มี...</p>
<p style="text-align:left;">GTS231 		Law and Technology ( IT(3))		WE09:00-12:00 TBA<br />
EL210 			English for Engineering I ( IT(3))		MO09:00-12:00 BKD 3206<br />
EL210 			English for Engineering I ( IT(3))		MO13:00-16:00 BKD 3206</p>
<p>Law ตัวนี้แอบเครียดคะ ฮ่าๆๆ แต่เนมบอกว่าอาจารย์สอนสนุก เอ้า จะเชื่อดู ไหนๆก็มีรูมเมทเป็นเด็กนิติอยู่แล้วนี่ 555+<br />
EL ก็คงไม่มีไรมาก แต่ถ้าดันโชคร้ายต้องเรียนจันทร์เช้าขึ้นมาก็คงจะเศร้า ตารางคงจะโหดร้ายอย่าแน่นอน T-T</p>
<p style="text-align:left;">เมื่อวานคุยกับเนส ไม่อยากเชื่อว่ามีคนคิดเหมือนเราว่า ยิ่งเรียนทำไมกุยิ่งอ่านชื่อวิชาไม่ออกวะ 555+ ไม่ใช่ว่า "อ่านไม่ได"้ นะ แต่ "ไม่เข้าใจความหมาย" ต่างหาก วิชาที่เหลือที่จะลงนอกจากที่บอกไว้ข้างบนก็ได้แก่</p>
<p style="text-align:left;">ITS322 Database Management Systems<br />
ITS323 Introduction to Data Communications<br />
ITS326 Compiler Design (Required ITS222)<br />
ITS331 Information Technology I Laboratory<br />
ITS425 Management Information Systems</p>
<p style="text-align:left;">เป็นข้อสรุปว่า เทอมนี้เรียน 8 ตัวคะ พี่น้องขา แต่เชื่อว่าอาจจะมี 9 คาบ เพราะเมื่อกี้ search google ใช้คีย์เวิร์ด Compiler Design แต่ไฉนได้เจอ <a href="http://cholwich.org/" target="_blank">บล็อกของ Dr.Cholwich Natee</a> เขียนเกี่ยวกับวิชา "<a href="http://cholwich.org/wordpress/2008/05/15/its331-information-technology-i-laboratory/"><a href="http://cholwich.org/wordpress/2008/05/15/its331-information-technology-i-laboratory/" target="_blank">ITS</a>331 Information Technology I Laboratory</a>" ซะงั้น (ต่อไปจะเรียกว่าวิชา "ดาต้าเบส") ก็เลยได้รู้ว่าวิชานี้คืออะไร(อย่างน้อยตอนนี้ก็พอเข้าใจ 5 วิชาแล้วนะ 555+) แต่แบบ พอได้อ่านแผนคร่าวๆของวิชานี้แล้วแอบดีใจ เป็นเรื่องที่ตั้งใจจะค้นคว้าหาอ่านอยู่พอดีเลย แต่เพราะไม่มีคอมส่วนตัว(ตอนนี้แชร์กับพี่อยู่ โน้ตบุ๊คพ่อเอาไปใช้ - -")และเวลา(ที่ว่างนั่งหาหนังสือของพ่อ)เลยยังไม่ได้เริ่มต้นซักที ความจริงก่อนนี้ก็เคยจับ PHP แบบ อ่านอย่างเดียวนะ ไม่เคยปฏิบัติ เคยโหลด Apache มาเหมือนกันแต่มันลงไม่ได้ ก็เลยล้มเลิกไป แล้วที่อ่าน ก็อ่านแค่คู่มือเล่มเล็กที่มากับCDสอน ก็รู้สึกว่า มันก็คือ C มาเปลี่ยน Systax ดีๆนี่เอง ฮ่าๆๆๆ แต่มันก็มีอะไรที่แตกต่างมากกว่านั้นนะแหละ แต่ถ้าคนได้ C แม่น C มาเรียน PHP รับรอง สบาย อีกอย่างที่เคยจับคือ MS SQL (แต่ที่จะได้เรียนเป็น MySQL) มันก็เกี่ยวกับดาต้าเบสทั้งคู่แหละ แต่แค่คนละค่าย เคยลองเล่นๆ VB.NET + MS SQL แต่ตอนนี้ก็จำไม่ได้แล้วละ 555+ คงต้องเริ่มใหม่ (เป็นคนขี้ลืมง่ายสมองปลาทองก็งี้แหละ) แต่ตอนนี้อยากเล่น PHP+MySQL+phpAdminอย่างแรงอะ อยากทำ <a href="http://ammiiam.wordpress.com">ammiiam</a> แบบ Advance อะ ^^</p>
<p style="text-align:left;">และนี้ก็เป็นแผนคร่าวๆของดาต้าเบสนะคะ</p>
<ul>
<li>Linux Installation + Tutorials</li>
<li>HTML + CSS</li>
<li>Javascript</li>
<li>JQuery</li>
<li>Introduction to PHP</li>
<li>MySQL</li>
<li>PHP with mySQL</li>
<li>Cookie and Sessions</li>
<li>Ajax with JQuery</li>
<li>Project Development</li>
</ul>
<p style="text-align:left;">อยากอ่าน CSS มานานแล้ว Javascript นี่ก็อยากเขียนเป็นมาตั้งแต่สมัยม.1ม.2(เมื่อก่อนทำเป็นแต่ก๊อบโค้ดชาวบ้านเค้า ฮ่าๆๆ) PHP/MySQL ก็อย่างที่บอกไปก่อนนี้ Cookie ก็เคยคิดอยากหาอ่านเหมือนกัน Ajax อันนี้อยากเล่นมากๆ แต่ PHP ยังไม่รอดก็นะ จะไปเล่นได้ยังไง 555+ ดีใจมากมายที่ได้เรียนวิชานี้ ^^ แถมพอรู้ว่าจะได้เรียนกับอาจารย์Cholwichก็ยิ่งรู้สึกสนใจมากขึ้น เหมือนกับว่าอาจารย์เค้าดูเชี่ยวชาญอะ 555+ พูดไม่ถูก แต่ความรู้สึกมันพาไป ^ ^"</p>
<p style="text-align:left;">จะว่าไปSIITเราเค้าไม่มีสอบ Pythonบ้างเหรอ วันก่อนไปสอบโทเฟิลคณะมา แหม ไอ้เราก็สงสัยอยู่นาน ที่แท้ก็เคยทำแล้ว โทเฟิลตัวนี้ เคยทำตอนไปสอบเข้ามหิดล อินเตอร์ ชื่อย่อของมัน(แบบofficialจริงๆ)คือ TOEFL-ITP (คุ้นๆว่า ITP น่าจะย่อมาจาก Institutional Test Paper) ไปก็สาย คำนวณเวลาผิดจริงๆ แย่เลย สายไปห้านาที แถามยังต้องมานังฝนกระดาษคำตอบแบบมโหฬาร ชื่อ นามสกุล บลาๆๆ แย่จริงๆ แล้วดันคิดว่าสอบเสร็จ 12.00 แต่ที่ไหนได้ เค้าสอบเสร็จกันตอน 11.30 จะเป็นยังไงละคะ ก็ทำไม่ทัน 15 ข้อ ถ้าผ่านก็บ้าละ - -" จะถึงซัก 450 ไหมเนี้ย = = ถ้าต่ำกว่านี่ได้เวลาไป take course ไม่ก็หาหนังสือมาอ่านอย่างจริงจังแล้ว ไม่ก็รอพินนี่มาติว เดี่ยวพรุ่งนี้เป็นวันสุดท้ายที่พินนี่สอบไฟนอล ฮ่าๆๆๆ น่าจะมีเวลามาติวให้เพื่อนตาดำๆคนนี้ได้แล้วน้าาาา ^ ^</p>
<p style="text-align:left;">อื้มมม คาดการณ์ว่า จันทร์นี้ตารางสอนน่าจะออกหมด แต่ก็นะ เดี่ยวเราก็จะไปจันทร์วันอาทิตย์นี้แล้ว เพราะงั้นก็คงรู้อีกทีประมาณ26-27 พค นั่นแหละ แต่ก็นะ เทอมหน้าไม่รู้ชีวิตในห้องเรียนของเราจะเป็นยังไงบ้าง ตอนนี้ก็พอจะปลงอะไรหลายๆอย่างได้แล้ว ก็อย่างว่านั่นแหละ</p>
<p style="text-align:center;"><em>"บางทีคนเราก็มีการเปลี่ยนแปลงกันได้"</em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Validate site pages to follow W3C standards]]></title>
<link>http://ssonawa.wordpress.com/?p=5</link>
<pubDate>Fri, 16 May 2008 12:54:41 +0000</pubDate>
<dc:creator>ssonawa</dc:creator>
<guid>http://ssonawa.wordpress.com/?p=5</guid>
<description><![CDATA[After developing the pages for a website, following link can be used to find out if web pages follo]]></description>
<content:encoded><![CDATA[<p>After developing the pages for a website, following link can be used to find out if web pages follow the W3C standards, like CSS, Markup (HTML, XHTML etc). Its very useful and no need to upload files only specify link in the input box and errors will get listed.</p>
<p><a href="http://validator.w3.org/">http://validator.w3.org/</a></p>
<p> </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Syntax heredocs pada PHP]]></title>
<link>http://denisantana.wordpress.com/?p=38</link>
<pubDate>Fri, 16 May 2008 12:45:02 +0000</pubDate>
<dc:creator>denibudhisantana</dc:creator>
<guid>http://denisantana.wordpress.com/?p=38</guid>
<description><![CDATA[Disclaimer:
Ini adalah tulisan dri seorang pemula untuk teman2 yang juga pemula, tetapi juga tidak h]]></description>
<content:encoded><![CDATA[<p>Disclaimer:<br />
Ini adalah tulisan dri seorang pemula untuk teman2 yang juga pemula, tetapi juga tidak haram bagi yg dah advance :)</p>
<p>OK langsung aja ya.</p>
<p>Pada PHP ada satu syntak yang dapat digunakan untuk mempersingkat menuliskan tag-tag html (tidak untuk semua kasus tentunya). Syntak yang dimaksud bernama "heredocs" (tanpa tanda koma).</p>
<p>Fungsi dari syntak ini adalah untuk menggantikan penulisan tag html satu-persatu dengan menggunakan syntaks 'echo' atau 'print' ataupun untuk mengapit string secara umum.</p>
<p>Tanda heredocs syntax adalah "&#60;&#60;&#60;" (tanpa tanda kutip). Setelah operator &#60;&#60;&#60; dideklarasikan, sebuah identifier diperlukan, kemudian syntak atau pernyataan yang kita inginkan ditulis pada garis baru. Jangan lupa untuk menutup dengan idenfier yang sama dan tanda ";" (titik koma tanpa tanda ")</p>
<p>contoh:</p>
<p><a href="http://denisantana.wordpress.com/files/2008/05/heredoc1.jpg"><img class="size-medium wp-image-39" style="vertical-align:middle;" src="http://denisantana.wordpress.com/files/2008/05/heredoc1.jpg?w=300" alt="contoh 1" width="328" height="131" /></a></p>
<p>contoh tersebut sangat sederhana, anda dapat mencobanya dengan pernyataan yang lebih kompleks tentunya, seperti contoh berikut:</p>
<p><a href="http://denisantana.files.wordpress.com/2008/05/heredoc2.jpg"><img class="size-medium wp-image-40" style="vertical-align:middle;" src="http://denisantana.wordpress.com/files/2008/05/heredoc2.jpg?w=300" alt="contoh 2" width="324" height="228" /></a></p>
<p>Maka output yang akan ditampilkan oleh browser adalah:</p>
<p>Nama saya adalah "deni". Saya sedang mencetak foo.<br />
Saat ini, Saya sedang mencetak Bar2.<br />
yang akan mencetak huruf kapital 'A': \x41</p>
<p>Harus diingat bahwa Identifier penutup harus berada pada baris tersendiri, dan tidak boleh diawali oleh selainnya, juga penamaannya harus mengikuti aturan penamaan pada PHP: hanya boleh menggunakan huruf, angka dan underscore; dimulai dengan huruf ataupun underscore tetapi tidak boleh dimulai dengan angka.</p>
<p>semoga bermanfaat.</p>
<p>Referensi:<br />
1. <a href="http://www.onlamp.com/pub/a/php/2003/04/10/php_heredocs.html">disini</a> dan<br />
2. <a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc">disini</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Putting SugarCRM working on top of Microsoft technologies]]></title>
<link>http://susanavilaca.wordpress.com/?p=16</link>
<pubDate>Fri, 16 May 2008 11:25:52 +0000</pubDate>
<dc:creator>susanavilaca</dc:creator>
<guid>http://susanavilaca.wordpress.com/?p=16</guid>
<description><![CDATA[Yesterday I was with Marcos Santos from Microsoft at SugarCRM 2008 event presenting SugarCRM worki]]></description>
<content:encoded><![CDATA[<p>Yesterday I was with <a href="http://blogs.technet.com/openchoice/default.aspx" target="_blank">Marcos Santos </a>from Microsoft at <a href="http://www.eventocrm.com/" target="_blank">SugarCRM 2008 event</a> presenting <a href="http://www.sugarcrm.com/crm/" target="_blank">SugarCRM </a>working on and with Microsoft Technologies. For my demo I had to put SugarCRM working on Windows Server 2003 with IIS 6.0 and SQL Server 2005 and I have to say it was pretty easy :) .</p>
<p>If you wish to work with SugarCRM on your company or just try it and you wish to use it with Microsoft technolgies wheter because you like it more or because you want to take advantage of the technologies you already have on your system I'll give you here some help.</p>
<p>The first step you have to take is put PHP working with IIS. I found several information on the Internet regarding this subject and I have to highlight the post on <a href="http://www.peterguy.com/" target="_blank">Pete's Place</a> called <a href="http://www.peterguy.com/php/install_IIS6.html" target="_blank">How to install PHP 5.x on Windows Server 2003 with IIS 6</a>. Although I didn't followed all the steps it's a very complete guide. </p>
<p>Ok, so what I did to put PHP working on my IIS was:</p>
<ol>
<li>Unzipp PHP files to a directory (ex: C:/PHP)</li>
<li>Rename php.ini-recommended to php.ini and copy it to C:/Windows
<ol>
<li>edit the php.ini under the Windows folder and enable the following extensions (just uncomment the lines that have extension php_[extension name].php):
<ul>
<li>php_mssql.php</li>
<li>php_imap.php</li>
<li>php_mbstring.php</li>
<li>php_curl.php</li>
<li>php_ldap.dll</li>
</ul>
</li>
</ol>
</li>
<li>Go to IIS Manager, expand "Web Sites" and right click on "Default Web Site" and then click "Properties"</li>
<li>Within "Properties" click on "ISAPI Filters" tab an then on "Add"</li>
<li>Give a filter name (ex: php) and on executable file browse for "php5isapi.dll" on the directory where you unzipped PHP (it should be on the root of the directory), and then click "Ok"</li>
<li>Next go to "Home Directory" tab and click on "Configuration" button and then on "Add"</li>
<li>Browse again for php5isapi.dll for executable file and on extension type ".php". click "Ok".</li>
<li>Restart IIS service or reboot your PC.</li>
</ol>
<p>So now if everything went ok you have PHP working under IIS. To test it create a file called "phptest.php" on C:/Inetpub/wwwroot and put the following code in there:</p>
<pre style="padding-left:30px;">&#60;?php
   phpinfo();</pre>
<pre style="padding-left:30px;">?&#62;</pre>
<p>On your browser go to <a href="http://localhost/phptest.php">http://localhost/phptest.php</a>. If it worked congratulations, if not try go to php.ini and check if "doc_root" is set to "C:/Inetpub/wwwroot" and on IIS Manager -&#62; Web Extensions if php extension isn't being blocked.</p>
<p>Regarding SQL Server make sure you know you're credentials and enable mix mode authentication. I've created a database named "sugarcrm" but you can create it during SugarCRM installation.</p>
<p>After PHP is working and SQL Server configurated you just have to install SugarCRM. To do that you have to:</p>
<ol>
<li>Unzipp SugarCRM files to C:/Inetpub/wwwroot/SugarCRM</li>
<li>
<div>Set permissions on the following sugar directories and files to be writable by your Web server user (usually with the name of IUSR_[computername]):</div>
<ul>
<li>cache</li>
<li>custom</li>
<li>data</li>
<li>modules</li>
<li>config.php</li>
</ul>
</li>
<li>On your browser go to <a href="http://localhost/SugarCRM/install.php">http://localhost/SugarCRM/install.php</a> and just follow the steps, it should be easy.</li>
</ol>
<p>When the installation finishes you're ready to start using SugarCRM on top of Microsoft technologies.</p>
<p>Hope it was useful. </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Running PHP scripts with Cron Job]]></title>
<link>http://phpbugs.wordpress.com/?p=24</link>
<pubDate>Fri, 16 May 2008 09:47:58 +0000</pubDate>
<dc:creator>phpbugs</dc:creator>
<guid>http://phpbugs.wordpress.com/?p=24</guid>
<description><![CDATA[

Create a PHP info page using these lines : &lt;?php echo phpinfo();?&gt;
Upload to your web server]]></description>
<content:encoded><![CDATA[<div style="text-align:justify;">
<ul>
<li>Create a PHP info page using these lines : &#60;?php echo phpinfo();?&#62;</li>
<li>Upload to your web server and run it on your browser</li>
<li>Look at the item " Server API " : There are two possible values to come here : 1) CGI   2) Apache</li>
<li>In my case it was CGI</li>
<li>Then we have to include the line " #!/usr/bin/php -q " (path to PHP installed directory. This you will get it from phpinfo file with item "Configuration File (php.ini) Path"). This should be your first line of the PHP script you have to run Cron. The PHP tag (&#60;?php) have to come after this line.</li>
<li>Then create the crontab using the command " * * * * * php physical/path/to/your/file.php "</li>
</ul>
<p>Courtesy : <a title="Running PHP Scripts with Cron &#124; HTMLCenter - Web Development Blog" href="http://htmlcenter.com/blog/running-php-scripts-with-cron/" target="_blank">Running PHP Scripts with Cron &#124; HTMLCenter - Web Development Blog</a></p>
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Est-il possible d'obtenir les dimensions d'un tableau sans le parcourir ?]]></title>
<link>http://formatrice.wordpress.com/?p=55</link>
<pubDate>Fri, 16 May 2008 09:03:05 +0000</pubDate>
<dc:creator>Sarah Haïm-Lubczanski</dc:creator>
<guid>http://formatrice.wordpress.com/?p=55</guid>
<description><![CDATA[On connaît la fonction count() en PHP, qui permet de connaître le nombre d&#8217;éléments d]]></description>
<content:encoded><![CDATA[<p>On connaît la fonction count() en PHP, qui permet de connaître le nombre d'éléments d'un tableau. Mais si je veux savoir à quelle profondeur je risque d'être conduit en parcourant récursivement mon tableau, comment faire ?</p>
<p>J'en profite pour vous faire découvrir le deuxième argument de la fonction count(), qui mis à la valeur COUNT_RECURSIVE prendra en compte  les éléments internes du tableau.</p>
<p>Je reprends l'exemple de la doc PHP pour éclairer mon propos.<br />
<code>$food = array(<br />
'fruits' =&#62; array(<br />
'orange', 'banana', 'apple' =&#62; array('verte', 'jaune', 'rouge')<br />
),<br />
'veggie' =&#62; array(<br />
'carrot', 'collard', 'pea'<br />
)<br />
);<br />
// count récursif<br />
echo count($food, COUNT_RECURSIVE); // affiche 8</code></p>
<p>Parmi <a href="http://fr2.php.net/manual/fr/ref.array.php">les fonctions de tableau</a>, il n'en existe aucune qui permet de juste obtenir la profondeur d'un tableau.<br />
La raison, à mon avis,  est qu'un tableau peut-être multi-dimensionnel de manière inégale, comme dans mon exemple ci-dessus.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[membuat konten dalam negeri]]></title>
<link>http://sibak.wordpress.com/?p=116</link>
<pubDate>Fri, 16 May 2008 07:58:59 +0000</pubDate>
<dc:creator>Ronsen</dc:creator>
<guid>http://sibak.wordpress.com/?p=116</guid>
<description><![CDATA[saya agak prihatin melihat software house secara umum di indonesia (eh jakarta ding). saya lihat sof]]></description>
<content:encoded><![CDATA[<p>saya agak prihatin melihat software house secara umum di indonesia (eh jakarta ding). saya lihat software house di sini kebanyakan membangun aplikasi yang itu-itu saja. yang saya maksud yang itu-itu saja seperti membangun sistem keuangan, sistem kepegawaian, sistem barang, dan sistem-sistem lain. secara umum hanya mensupport sistem yang sudah ada.</p>
<p>itu kalau hanya bicara tentang software house tetapi kebanyakan juga orang-orang it yang saya kenal juga bekerja sebagai sistem support sebuah perusahaan. bahkan ada yang ada yang saya kenal dengan bersertifikat sisco kerjanya menginstall windows, anti virus dan menjaga update-annnya, install ini dan itu. sepertinya ada yang salah. biarpun semuanya ahli tapi tetap saja kita hanya sebagai pengguna.</p>
<p>saya berencana membuat web kacangan sekedar melampiaskan ide-ide yang sudah lama dipendam sampai berbau busuk. kendala terbesar ternyata dari bahasa pemrorgaman yang saya kuasai yaitu java. menggunakan java itu tidak murah dan maintenancenya sangatlah melelahkan. untuk hosting saja harus menggunakan dedicated server dengan biaya ratusan sampai jutaan rupiah per bulan. tidak mungkin saya mengeluarkan dana besar seperti itu apalagi setiap bulan.</p>
<p>pilihan saya jatuh ke php karena dukungan web hosting untuk bahasa ini sangat banyak dan tentu saja biayanya sangat murah. bagaimana dengan <a href="http://sibak.wordpress.com/2008/03/06/belajar-ruby-on-rails/">ruby on rails</a>? arrggh.. this one not proven enough.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[reunión]]></title>
<link>http://ragnarok69.wordpress.com/?p=14</link>
<pubDate>Fri, 16 May 2008 04:56:25 +0000</pubDate>
<dc:creator>ragnarok69</dc:creator>
<guid>http://ragnarok69.wordpress.com/?p=14</guid>
<description><![CDATA[Después de casi mes y medio sin hacer nada &#8230;  era tiempo de una reunión para ver qué se hab]]></description>
<content:encoded><![CDATA[<p>Después de casi mes y medio sin hacer nada ... :) era tiempo de una reunión para ver qué se había investigado ... Dicha reunión se efectúo el 30 de abril ... nuevamente no se hizo mucho más que perder el tiempo, mmm bueno no tanto, por que fuímos al <strong>LIDSOL</strong> (<em>el novio de mi compañera de tesis conoce a los de allá</em>) para ver si nos daban <strong>host</strong> para subir el proyecto y trabajar de manera remota ...</p>
<p>Se quedó en un <strong>sí</strong> un tanto flotante ... espero que en verdad se pueda!!</p>
<p>Decidí sacar un libro para que me orientará, uno de <strong>MySQL</strong> con <strong>PHP </strong>... en inglés <em>wahahaha</em>!!!</p>
<p style="text-align:right;"><strong>chido ...</strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Función para Importar archivo (parser) a (from) CSV a variable PHP]]></title>
<link>http://doutdex.wordpress.com/?p=79</link>
<pubDate>Fri, 16 May 2008 03:42:16 +0000</pubDate>
<dc:creator>doutdex</dc:creator>
<guid>http://doutdex.wordpress.com/?p=79</guid>
<description><![CDATA[Este código fue extraído de otro blog que ha sido probado y funciona correctamente.
&#8220;This is]]></description>
<content:encoded><![CDATA[<p>Este código fue extraído de otro blog que ha sido probado y funciona correctamente.</p>
<p>"This is a snippet of code that I had posted on another of my websites and in doing some cleanup it really fits better here. </p>
<p>I spent last evening working on a Comma Separated Values (CSV) list of titles for a project I'm working on. Below is a snippet of code I worked with. The first method from the PHP Cookbook suggests using fgetcsv(). That woks pretty well but the native function in PHP doesn't handle values (fields) that contain separators (commas) very well and doesn't have the concept of multiple values being delimited by a different delimiter within a field. So I whipped up the parser that comes second in the example below."</p>
<p><code><br />
&#60;?php<br />
$fp = fopen('filename','r') or die("can't open file");<br />
print ("<br />
<table>\n");<br />
while($csv_line = fgetcsv($fp,1024, ",", "\"")) {<br />
    print '<br />
<tr>';<br />
    for ($i = 0, $j = count($csv_line); $i &#60; $j; $i++) {<br />
        print '
<td>'. str_replace (";\"", "<br />", $csv_line[$i]).'</td>
<p>';<br />
    }<br />
    print ("</tr>
<p>\n");<br />
}<br />
print ("</table>
<p>\n");*/<br />
fclose($fp) or die("can't close file");<br />
$bas = file_get_contents ("filename");<br />
print ("<br />
<table>\n");<br />
$lines = explode("\n", $bas);<br />
foreach ($lines as $line) {<br />
    print("<br />
<tr>");<br />
    $line = ltrim($line, "\"");<br />
    $line = rtrim($line, "\"");<br />
    $line = rtrim($line);<br />
    $out = str_replace("\";\"", "<br />", $line);<br />
    $out = str_replace("\",\"", "</td>
<td>", $out);<br />
    print ("
<td>") . $out . "</td>
<p>");<br />
        print ("</tr>
<p>\n");<br />
};<br />
print ("</table>
<p>\n");<br />
?&#62;<br />
</code></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[বাংলায় পিএইচপির টিউটোরিয়াল]]></title>
<link>http://justphp.wordpress.com/?p=4</link>
<pubDate>Fri, 16 May 2008 03:41:48 +0000</pubDate>
<dc:creator>hasin</dc:creator>
<guid>http://justphp.wordpress.com/?p=4</guid>
<description><![CDATA[আমি ঠিক করেছি আজকে থেকে এই ব্লগে নিয়মি]]></description>
<content:encoded><![CDATA[<p>আমি ঠিক করেছি আজকে থেকে এই ব্লগে নিয়মিত পিএইচপির উপরে টিউটোরিয়াল লিখব বাংলায়। এতে অনেকেরই উপকার হবে, বিশেষ করে যারা একেবারেই নতুন অথবা ওয়েব অ্যাপ্লিকেশন প্রোগ্রামিং শুরু করতে চাচ্ছে তাদের জন্য। এছাড়া যখন অনেক কিছু নিয়ে লেখা হয়ে যাবে, তখন আমার ইচ্ছা এটাকে বই হিসেবে বের করা, ফলে এই লেখা গুলো পৌছে যাবে আরো অনেকের ঘরে। অনেকেই ব্যবহার করতে পারবে রেফারেন্স হিসেবে। </p>
<p>প্রথমেই শুরু করা যাক পিএইচপি কি এবং কেন। তুমি নিশ্চয় জান যে পিএইচপি একটা প্রোগ্রামিং ল্যাংগুয়েজ, কিন্তু মূলত এটা একটা স্ক্রিপ্টিং ল্যাংগুয়েজ। পিএইচপিতে লেখা প্রোগ্রাম কিন্তু তোমার সি বা অন্য কোন ল্যাংগুয়েজের মত কম্পাইল করা যায় না। পিএইচপি একটি ইন্টারপ্রেটেড ল্যাংগুয়েজ, যার মানে হল তুমি যখন এই কোড এক্সিকিউট করতে যাবে, পিএইচপি প্রোগ্রামটি লাইন বাই লাইন পড়বে এবং এক্সিকিউট করবে। এর ফলে সাধারন কম্পাইল করা প্রোগ্রামের চাইতে পিএইচপি কিছুটা স্লো, কিন্তু সেটা এতই নগন্য যে হাতে গোনার মত নয়। </p>
<p>কোন কাজ শুরু করার আগে চল দেখা যাক কেন আমরা পিএইচপি শিখব। </p>
<p>১. শেখা খুবই সহজ, তোমার যদি আগে থেকে জাভা বা সি জানা থাকে তাহলে তো কেল্লা ফতে<br />
২. বিশাল ইউজার কম্যুনিটি, যার ফলে তোমার যেকোন সমস্যায় কেউ না কেউ এগিয়ে আসবেই তোমাকে সাহায্য করতে<br />
৩. অ্যাপাচি ওয়েবসার্ভারের সাথে ম্যাচ করে, আর বিশ্বের প্রায় ৮০% ওয়েবসার্ভার মূলত অ্যাপাচি বা অ্যাপাচি থেকে তৈরী<br />
৪. ইয়াহু, ফেসবুক, ফ্রেন্ডস্টার এবং ফ্লিকারের মত (আরো অনেক আছে) বিশাল বিশাল সাইট গুলো পিএইচপিতে তৈরী<br />
৫. চমৎকার অবজেক্ট ওরিয়েন্টেড প্রোগ্রামিং<br />
৬. বিভিন্ন কাজের জন্য প্রচুর লাইব্রেরীর সমাহার<br />
৭. জেন্ডের পাশাপাশি  মাইক্রোসফট, আইবিএমের মত বড় বড় কোম্পানীও প্রত্যক্ষ বা পরোক্ষ ভাবে পিএইচপির উন্নয়নে জড়িত</p>
<p>কিছু এক্সটার্নাল লিংক না দিলেই নয় - যেমন<br />
<a href="http://www.php.net/history">পিএইচপির ইতিহাস</a><br />
<a href="http://www.php.net/manual/en/index.php">পিএইচপি ম্যানুয়াল</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Nodes FAQ]]></title>
<link>http://ismywebsite.wordpress.com/?p=37</link>
<pubDate>Fri, 16 May 2008 03:16:57 +0000</pubDate>
<dc:creator>ismywebsite</dc:creator>
<guid>http://ismywebsite.wordpress.com/?p=37</guid>
<description><![CDATA[I&#8217;m getting a lot of questions about how the nodes system will work. Here it is, in a nutshell]]></description>
<content:encoded><![CDATA[<p>I'm getting a lot of questions about how the nodes system will work. Here it is, in a nutshell:</p>
<ol>
<li>You visit http://this.ismywebsite.com/ (or any other subdomain)</li>
<li>One PHP page will process the address you visit and send the right response.</li>
<li>If there's no interest in that subdomain, no account has been created yet, or the account is offline at that time, the appropriate page will be displayed.</li>
<li>Otherwise, you will be redirected to another domain (for example http://this.ismyws.com/ or http://this.isnumberone.org/)</li>
<li>This 'node' will display the proper website.</li>
</ol>
<p>Here's a quick FAQ:</p>
<p><strong>Will my domain be the same?<br />
</strong>Your website will be hosted on a similar but often shorter domain, with the same subdomain. (For example, instead of this.ismywebsite.com, it would be this.ismyws.com). However, this.ismywebsite.com will always function as a redirect to that site.</p>
<p><strong>How do you choose my node?<br />
</strong>Most of them have already been chosen. I am assigning people to nodes where they fit, in the order hosting was requested.</p>
<p><strong>How do I access cPanel?<br />
</strong>Generally, you just go to http://yournode.com:2082/ and login. You will receive all your login details by email once we know things are working.</p>
<p><strong>What features will I get?<br />
</strong>There is no plan to change the features. One of our nodes is run by HostGator, which refuses to enable overselling, so if you need the full 100MB from that node, just request it. Over 95% of our clients don't use it all. (On that note, if you need more than 100MB on any node please ask as well. You earned it through your patience.) On top of this, some of the nodes have different extra features so there may be some pleasant surprises.</p>
<p><strong>What happens if my site goes offline?<br />
</strong>We are monitoring all the nodes and if the downtime is for an extended period, a temporary error page will be displayed on the IsMyWebsite subdomain.</p>
<p><strong>Do domains still work?<br />
</strong>Yes. However, the nameservers are going to be different depending on your node. You should also receive those instructions by email when your account is set up.</p>
<p><strong>I'm using another host now. Can you set up a redirect?<br />
</strong>Sure, just tell us where to direct it to. And remember, you can still place our ads on your site and use our toolbar.</p>
<p><strong>Do I still need to place ads?<br />
</strong>Now more than ever. And you should place them well.</p>
<p><strong>When will things be finished?<br />
</strong>Right now, it's looking to be 4 days before the first accounts will be completely ready to go. (So 4 days plus whatever time it takes to build all the accounts before yours.) We are going as fast as we can.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Installing PECL PS on Mac OS X]]></title>
<link>http://codelemur.wordpress.com/2008/05/15/installing-pecl-ps-on-mac-os-x/</link>
<pubDate>Fri, 16 May 2008 02:33:36 +0000</pubDate>
<dc:creator>codelemur</dc:creator>
<guid>http://codelemur.wordpress.com/2008/05/15/installing-pecl-ps-on-mac-os-x/</guid>
<description><![CDATA[Tags: php, pecl, ps, leopard, os x, osx
The PHP that comes standard with Mac OS X Leopard doesn]]></description>
<content:encoded><![CDATA[<p>Tags: <a rel="tag" href="http://technorati.com/tag/php">php</a>, <a rel="tag" href="http://technorati.com/tag/pecl">pecl</a>, <a rel="tag" href="http://technorati.com/tag/ps">ps</a>, <a rel="tag" href="http://technorati.com/tag/leopard">leopard</a>, <a rel="tag" href="http://technorati.com/tag/os+x">os x</a>, <a rel="tag" href="http://technorati.com/tag/osx">osx</a></p>
<p>The PHP that comes standard with Mac OS X Leopard doesn't come with the PECL <a href="http://pecl.php.net/package/ps">PS extension</a>. PECL PS requires <a href="http://pslib.sourceforge.net/">pslib</a>, and the last version <a href="http://codelemur.wordpress.com/2008/01/29/php-postscript-and-atm-fonts/">I verified to work</a> the PS extension was 0.2.6 (I still have an <a href="http://pecl.php.net/bugs/bug.php?id=12999">outstanding bug</a> for that). There's a minor little bug that prevents it from compiling on OS X, so here are the steps necessary to get PECL PS working on Leopard:</p>
<ol>
<li>Download <a href="http://internap.dl.sourceforge.net/sourceforge/pslib/pslib-0.2.6.tar.gz">PSLib 0.2.6</a>. Unpack to somewhere on your filesystem (I use <code>/usr/src</code>)</li>
<li><code>cd pslib-0.2.6/src</code></li>
<li>Apply <a href="http://www.epsilonthree.com/files/leopard_pslib-0.2.6.patch">this patch</a> to pslib.c (<code>patch pslib.c leopard_pslib-0.2.6.patch</code>)</li>
<li><code>cd ../</code></li>
<li><code>./configure</code></li>
<li><code>make</code></li>
<li><code>make install</code></li>
</ol>
<p>By default this puts it in <code>/usr/local/lib</code>. Now install the PS extension using PECL.</p>
<ol>
<li><code>pecl install ps</code></li>
<li>When it asks for path to pslib installation, <code>/usr/local/lib</code></li>
<li>Once it's done compiling, add the .so to your php.ini. You may have to move the .so or alter extension_dir in your php.ini.</li>
<li><code>sudo apachectl restart</code></li>
</ol>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Proiectul Symfony]]></title>
<link>http://farasens.wordpress.com/?p=89</link>
<pubDate>Thu, 15 May 2008 22:19:13 +0000</pubDate>
<dc:creator>farasens</dc:creator>
<guid>http://farasens.wordpress.com/?p=89</guid>
<description><![CDATA[   Symfony este un framework web pentru PHP . Adică ? Ce este un framework web ? Practic este o a]]></description>
<content:encoded><![CDATA[<p>   Symfony este un <strong>framework web</strong> pentru <strong>PHP</strong> . Adică ? Ce este un <strong>framework</strong> web ? Practic este o aplicaţie care suportă creerea de site-uri dinamic . Acesta încearcă să preia din monotonia scriptingului făcând treburile "murdare" pentru noi . Oferă librării de conectare la baza de date , templating şi management de sesiuni . Mai pe româneşte , nu trebuie să ne mai batem capul cu tot felul de chestii , căci se ocupă Symfony . Într-un fel frameworkul structurează modul în care lucrează progrmatorul ducând teoretic la terminarea mai rapidă a site-ului şi un debugging mai uşor .</p>
<p><strong>   Symfony</strong> asta face . Ne ajută să creem şi să menţinem site-urile mai uşor . Poate la prima vedere pare complicat dar după aceea lucrurile se schimbă radical . Întodeauna am fost adeptul diversităţii şi cunoaşterii , dar cu toţii ştim , că deşi există multe librării şi alte chestii tot trebuie să repetăm codul .. şi tot să-l repetăm . Cu acest framework treaba începe să sune mai "dulceag" .</p>
<p>   La site-urile mici mai te descurci să scrii codul şi să-şi organizezi aplicaţia cu tot felul de chestii . Dar deja la site-urile mari , greul începe să se arate . Cred că Symfony este o soluţie optimă şi nu regret că-l folosesc . Şi este open-source .</p>
<p>   Symfony este scris în totalitate în <strong>PHP5</strong> . Symfony e uşor de instalat şi configurat şi funcţioneză pe majoritatea platformelor . O chestie interesantă este implementarea de templateuri . Practic , împărţim aplicaţia în două părţi ( practic , lăsând la o parte modulele de configurare şi alte cele ) . O parte de cod ( acţiune ) care preia datele ( posibil din baza de date ) şi efectuează acţiunea , încarcă variablele , etc . O altă parte de template ( ce se afişează ) care foloseste datele din acţiune şi afisează . Şi <strong>Smarty</strong> mai foloseşte ceva de genu , dar acolo sunt mai multe chestii .. O să discutăm altă dată . De câte ori aţi lucrat cu formuri <strong>HTML</strong> şi v-aţi chinuit să le validaţi ? Symfony vine cu o chestie drăguţă pentru validarea şi repopularea formularului ( în cazul în care aţi făcut submit dar nu a fost validat ) cât şi afişarea automată de erori . Foloseşte un fişier <strong>YAML</strong> . Validează toate câmpurile odată şi afişează la sfârşit toate erorile ( specificate de noi în fisierul YAML ) . Are suport pentru routare şi URL-uri deştepte care vă vor face viaţa mai uşoara .</p>
<p>Când a fost lansat Symfony ? Prima versiune a fost lansată în octombrie 2005 . Are deasemenea şi o documentaţie interesantă numai bună pentru începători . Fie că eşti începător în ale PHP-ului , fie că eşti expert , poţi folosi Symfony . Conceptele pe care se bazează Symfony sunt :</p>
<ul>
<li><strong>OOP</strong> : n-am să analizez ce înseamnă OOP , cât la ce ne ajută în dezvoltarea aplicaţiilor web . Practic site-ului poate fi privit ca o casă cu încăperi . Fiecare încăpere este o clasă şi de câte ori ne referim la ea ( când o vizităm , amintim ) o înstanţiem , creem un obiect . Folosirea obiectelor în dezvoltarea de site-uri web ( dar nu numai , cât şi în multe aplicaţii ) este benefică deoarece permite structurarea , stilizarea şi mai buna întelegere proiectului ( debugging , update , mai uşoare ) .</li>
<li><strong>PEAR</strong> : este un framework . Ne ajută să downloadăm , instalăm , upgradăm şi să dezinstalăm scripturi PHP . Symfony îl foloseşte pentru încărcarea şi descărcarea de pluginuri ( scripturi care ne ajută să facem diverse chestii fără să mai recreem roata ) .</li>
<li><strong>YAML</strong> : deja discutasem mai sus că putem face validări de formuri HTML prin intermediul fişierelor YAML . Practic , m-am exprimt greşit . Mai corect ar fi fişiere care conţin date organizate după standardele limbajului YAML . YAML este o structură , un mod de a organiza datele . Ceva asemănător face şi XML-ul , HTML-ul . Doar că modul în care se scrie în YAML este mai uşor decât XML-ul . Formatul a apărut cam din 2001 şi este disponibil pentru o varietate de limbaje . Drăguţ este că numele lui înseamnă chiar că el nu este un limbaj . "Nu" este un limbaj căci n-are taguri sau alte chestii .</li>
<li><strong>ORM</strong> : interfaţa care leagă codul de bazele de date . Practic sunt nişte clase prin care putem prelua sau prelucra date din bazale de date . Şi ? Ne ajută când folosim diverse baze de date . Să presupunem că iniţial am construit site-ul cu o bază de date oarecare ( şi codul aferent desigur cu interogarea specifică ei ) apoi schimbăm site-ul pe altă bază de date . Prin intermediul conceptului ORM şi Symfony , pentru noi e necesar să scriem doar codul , restul este generat de framework .</li>
</ul>
<p>   La prima vedere aplicaţia Symfony poate fi ciudată . Conţine multe directoare şi îmbină multe clase PHP , HTML . Symfony se bazează pe arhitectura MVC . <strong>MVC</strong>-ul este un mod de a organiza lucrurile pentru a nu rămâne complicate sau mai bine zis , pentru a nu le complica . Se împarte în trei părţi . O parte model prin care facem abstractizarea bazei de date ( ORM-ul despre care discutam mai devreme , nu contează la ce tip de bază de date ne conectăm cât folosim obiectele "bune") cât şi accesul la date . O a doua parte de arătare ( <strong>templateul</strong> , layout-ul ) , ceea ce vede utilizatorul . Şi ultima şi a treia parte de control , acţiunea . Multe şi mărunte .</p>
<p>   N-are rost să scriu prea mult , pentru început . Doar cât să mestecaţi şi voi într-o seară .</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Extract and compare database schemas]]></title>
<link>http://phpimpact.wordpress.com/?p=178</link>
<pubDate>Thu, 15 May 2008 21:47:52 +0000</pubDate>
<dc:creator>phpimpact</dc:creator>
<guid>http://phpimpact.wordpress.com/?p=178</guid>
<description><![CDATA[Making changes to the database structure is one of the most tedious and routine operations a develop]]></description>
<content:encoded><![CDATA[<p>Making changes to the database structure is one of the most tedious and routine operations a developer of corporate applications faces to. The necessity of frequent updates considerably delays implementation of the project.</p>
<p>eZ Components offers a new solution of this problem: <a href="http://ezcomponents.org/docs/tutorials/DatabaseSchema" target="_blank">DatabaseSchema</a>. First of all, DatabaseSchema it's not an application, it's a PHP component. It provides a unified data structure to describe relational databases. DatabaseSchema can read and write the structure from and to several databases (such as MySQL, SQLite and Oracle) and also read and write in two web language files (XML and PHP).</p>
<p>The main intention of the component is to extract an already existing schema from a database, and compare it with either a predefined schema to check for any changes. Although the component does allow you to create the schema manually through the API, it is often easier to create the schema yourself in a database, and then extract the data from it.</p>
<p><a href="http://ezcomponents.org/docs/tutorials/DatabaseSchema" target="_blank">DatabaseSchema Introduction<br />
</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ghosts of Math Classes Past]]></title>
<link>http://ywanne.wordpress.com/?p=32</link>
<pubDate>Thu, 15 May 2008 20:09:36 +0000</pubDate>
<dc:creator>Ywanne</dc:creator>
<guid>http://ywanne.wordpress.com/?p=32</guid>
<description><![CDATA[All right, I guess I have to admit that modulus (the remainder thing, not the absolute value), which]]></description>
<content:encoded><![CDATA[<p>All right, I guess I have to admit that modulus (the remainder thing, not the absolute value), which was annoying when I had to come up with proofs about it six months ago, is useful to me after all.</p>
<p>I've been asked to make a little links database, and I figured it's time for me to learn PHP instead of spending my work hours hooking together assorted free scripts procured through Google. I've been determined to get tables with alternating colors in the rows (everyone's saying "zebra tables") and there's all these adventures in JavaScript you can have. But then I looked at a list of basic PHP operators and, lo and behold, one of them is the modulus thing, and that's what I used to make zebra tables.</p>
<p>I think that's a widely known method, and probably five-sixths of the other physics majors would pretend they didn't know me if they heard that I just now found out about it, but I'm happy anyways.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Creare Thumbs con PHP]]></title>
<link>http://notturnale.wordpress.com/?p=18</link>
<pubDate>Thu, 15 May 2008 18:42:43 +0000</pubDate>
<dc:creator>notturnale</dc:creator>
<guid>http://notturnale.wordpress.com/?p=18</guid>
<description><![CDATA[In questo breve post vedremo come creare delle miniature di immagini (thumbnails) durante l&#8217;up]]></description>
<content:encoded><![CDATA[<p>In questo breve post vedremo come creare delle miniature di immagini (thumbnails) durante l'upload.</p>
<p>Codice PHP:</p>
<blockquote><p>&#60;?php<br />
define ("MAX_SIZE","100");<br />
define ("WIDTH","150");<br />
define ("HEIGHT","100");</p>
<p>function make_thumb($img_name,$filename,$new_w,$new_h)<br />
{<br />
//ricavo estensione immagine.<br />
$ext=getExtension($img_name);<br />
if(!strcmp("jpg",$ext) &#124;&#124; !strcmp("jpeg",$ext))<br />
$src_img=imagecreatefromjpeg($img_name);</p>
<p>if(!strcmp("png",$ext))<br />
$src_img=imagecreatefrompng($img_name);<br />
$old_x=imageSX($src_img);<br />
$old_y=imageSY($src_img);</p>
<p>$ratio1=$old_x/$new_w;<br />
$ratio2=$old_y/$new_h;<br />
if($ratio1&#62;$ratio2)    {<br />
$thumb_w=$new_w;<br />
$thumb_h=$old_y/$ratio1;<br />
}<br />
else    {<br />
$thumb_h=$new_h;<br />
$thumb_w=$old_x/$ratio2;<br />
}</p>
<p>// creo una nuova immagine con le nuove dimensioni<br />
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);</p>
<p>imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);</p>
<p>if(!strcmp("png",$ext))<br />
imagepng($dst_img,$filename);<br />
else</p>
<p>imagejpeg($dst_img,$filename);<br />
imagedestroy($dst_img);<br />
imagedestroy($src_img);<br />
}</p>
<p>function getExtension($str) {<br />
$i = strrpos($str,".");<br />
if (!$i) { return ""; }<br />
$l = strlen($str) - $i;<br />
$ext = substr($str,$i+1,$l);<br />
return $ext;<br />
}</p>
<p>$errors=0;</p>
<p>if(isset($_POST['Submit']))<br />
{<br />
$image=$_FILES['image']['name'];</p>
<p>if ($image)<br />
{</p>
<p>$filename = stripslashes($_FILES['image']['name']);</p>
<p>$extension = getExtension($filename);<br />
$extension = strtolower($extension);<br />
if (($extension != "jpg")  &#38;&#38; ($extension != "jpeg") &#38;&#38; ($extension != "png"))<br />
{<br />
echo '&#60;h1&#62;Estensione sconosciuta!&#60;/h1&#62;';<br />
$errors=1;<br />
}<br />
else<br />
{<br />
$size=getimagesize($_FILES['image']['tmp_name']);<br />
$sizekb=filesize($_FILES['image']['tmp_name']);</p>
<p>if ($sizekb &#62; MAX_SIZE*1024)<br />
{<br />
echo '&#60;h1&#62;Hai superato il limite massimo per upload!&#60;/h1&#62;';<br />
$errors=1;<br />
}</p>
<p>$image_name=time().'.'.$extension;<br />
$newname="nome_cartella/".$image_name;<br />
$copied = copy($_FILES['image']['tmp_name'], $newname);</p>
<p>if (!$copied)<br />
{<br />
echo '&#60;h1&#62;Copia non avvenuta!&#60;/h1&#62;';<br />
$errors=1;<br />
}<br />
else<br />
{<br />
$thumb_name='nome_cartella/cartella_thumbs/thumb_'.$image_name;<br />
$thumb=make_thumb($newname,$thumb_name,WIDTH,HEIGHT);<br />
}}    }}</p>
<p>if(isset($_POST['Submit']) &#38;&#38; !$errors)<br />
{<br />
echo "&#60;h1&#62;il Thumbnail è stato creato con successo!&#60;/h1&#62;";<br />
echo '&#60;img src="'.$thumb_name.'"&#62;';<br />
}</p>
<p>?&#62;</p></blockquote>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Yahoo! releases SearchMonkey]]></title>
<link>http://webtech.wordpress.com/?p=747</link>
<pubDate>Thu, 15 May 2008 18:02:37 +0000</pubDate>
<dc:creator>webtech</dc:creator>
<guid>http://webtech.wordpress.com/?p=747</guid>
<description><![CDATA[Yahoo! SearchMonkey 
&#8230; SearchMonkey is Yahoo! Search&#8217;s new open platform. - developer.ya]]></description>
<content:encoded><![CDATA[<blockquote><p><a href="http://developer.yahoo.com/searchmonkey/">Yahoo! SearchMonkey </a><br />
... SearchMonkey is Yahoo! Search's new open platform. - developer.yahoo.com</p></blockquote>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Come accedere alle API di flickr con Php (Prima parte)]]></title>
<link>http://digitaladoptive.wordpress.com/?p=170</link>
<pubDate>Thu, 15 May 2008 16:53:31 +0000</pubDate>
<dc:creator>carlodaniele</dc:creator>
<guid>http://digitaladoptive.wordpress.com/?p=170</guid>
<description><![CDATA[Gestire le API di flickr con Php 5 è estremamente semplice.
Prima di tutto, bisogna creare una rich]]></description>
<content:encoded><![CDATA[<p>Gestire le <a href="http://www.flickr.com/services/api/" target="_blank">API di flickr</a> con <a href="http://php.net/" target="_blank">Php 5</a> è estremamente semplice.</p>
<p>Prima di tutto, bisogna creare una richiesta in formato <a href="http://www.flickr.com/services/api/request.rest.html" target="_blank">REST</a>, che trasmetta una serie di parametri, alcuni obbligatori, altri facoltativi. La risposta di flickr sarà in formato <a href="http://www.flickr.com/services/api/response.json.html" target="_blank">JSON</a>, e consiste in un array multidimensionale.</p>
<p>Facciamo riferimento alla guida alle <a href="http://www.flickr.com/services/api/" target="_blank">API di flickr</a>, cercando di approfondire appena un po' il discorso.</p>
<p>Il primo obiettivo, dunque, è quello di inviare la richiesta a flickr. La guida suggerisce di creare un array di parametri, del tipo:</p>
<p style="padding-left:30px;">$params = array(<br />
'api_key' =&#62; 'qui va la tua chiave api',<br />
'method' =&#62; 'flickr.photos.getInfo',<br />
'photo_id' =&#62; 'id della foto',<br />
'format' =&#62; 'php_serial',<br />
);</p>
<p>Da notare subito due parametri indispensabili: api_key e format. La chiave API la potete chiedere a flickr a <a href="http://www.flickr.com/services/api/key.gne" target="_blank">questo link</a>, mentre il parametro format è necessario per ricevere una risposta nel formato Php serializzato (per maggiori informazioni sulle funzioni php <a href="http://it2.php.net/manual/it/function.serialize.php" target="_blank">serialize()</a> e <a href="http://it2.php.net/manual/it/function.unserialize.php" target="_blank">unserialize()</a>, si veda <a href="http://php.net/" target="_blank">php.net</a>).</p>
<p>Altro parametro indispensabile è method. Nell'esempio di sopra, il metodo invia una semplice richiesta di informazioni su una determinata fotografia, individuata da photo_id. Ogni metodo richiede una serie di parametri aggiuntivi, alcuni dei quali obbligatori.</p>
<p>Se si desidera inviare una richiesta leggermente più complessa, si può utilizzare il metodo <a href="http://www.flickr.com/services/api/flickr.photos.search.html" target="_blank">flickr.photos.search</a>, che, come dice la parola, serve a cercare delle fotografice che rispondano a determinati criteri.<br />
Per costruire l'array, a questo punto, bisogna andare a <a href="http://www.flickr.com/services/api/" target="_blank">interrogare il manuale</a> per trovare gli argomenti necessari o utili per la ricerca da effettuare. Alcuni di questi sono:</p>
<p><strong>api_key</strong> (Obbligatorio)<br />
Ovviamente è sempre necessaria la vostra chiave API</p>
<p><strong>user_id</strong> (Facoltativo)<br />
Questo parametro è necessario qualora vogliate che flickr vi risponda con le informazioni relative alle fotografie di un determinato utente. Con questo parametro, ad esempio, potete costruire nel vostro sito una galleria fotografica delle fotografie che avete caricato su flickr.</p>
<p><strong>tags</strong> (Facoltativo)<br />
Questo parametro vi consente di richiedere fotografie etichettate con uno o più tag, separati da virgola.</p>
<p><strong>sort</strong> (Facoltativo)<br />
QUesto è davvero un parametro utilissimo, in quanto, specialmente quando le immagini in archivio sono numerose, consente di ordinarle nel modo più appropriato. I valori possibili sono: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, relevance.</p>
<p><strong>bbox</strong> (Facoltativo)<br />
Consente di inviare richieste relative alle fotografie localizzate in una determinata area della mappa. Si compone di una lista di 4 valori, separati da virgola, che rappresentano l'angolo in basso a sinistra e in alto a destra di un ideale area rettangolare della mappa.<strong></strong></p>
<p><strong>group_id</strong> (Facoltativo)<br />
L'ID di una pool.</p>
<p><strong>woe_id</strong> (Facoltativo)<br />
L'ID di un'entità spaziale (ne ho parlato nel <a href="http://digitaladoptive.wordpress.com/2008/05/13/where-on-earth-id/" target="_self">post precedente</a>). Da usare se non si ricorre a bbox, ovviamente.</p>
<p><strong>media</strong> (Facoltativo)<br />
Consente di chiedere fotografie o video. I valori possibili sono all (default), photos e videos.</p>
<p><strong>extras</strong> (Facoltativo)<br />
Una lista di informazioni extra. Quelle supportate attualmente sono license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media.</p>
<p><strong>per_page</strong> (Facoltativo)<br />
Numero di fotografie per pagina</p>
<p><strong>page</strong> (Facoltativo)<br />
Numero di pagina richiesta. Per default è 1.</p>
<p>Un ipotetica richiesta, allora, potrebbe comporsi dei seguenti argomenti:</p>
<p style="padding-left:30px;">$params = array(<br />
'api_key' =&#62; 'qui va la tua chiave api',<br />
'method' =&#62; 'flickr.photos.search',<br />
'tags' =&#62; 'flowers',<br />
'sort' =&#62; 'relevance',<br />
'extras' =&#62; 'owner_name,geo',<br />
'format' =&#62; 'php_serial',<br />
);</p>
<p>continua ...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Create a Simple Application to Search a User Name from Database in AJAX]]></title>
<link>http://usefulscripts.wordpress.com/?p=30</link>
<pubDate>Thu, 15 May 2008 15:53:17 +0000</pubDate>
<dc:creator>ubk1004</dc:creator>
<guid>http://usefulscripts.wordpress.com/?p=30</guid>
<description><![CDATA[Hi,
Many of us does not know how to use AJAX and roaming in the Internet for one sample application ]]></description>
<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Hi,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Many of us does not know how to use AJAX and roaming in the Internet for one sample application from which we can start building our knowledge in AJAX (Asynchronous JavaScript and XML).</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">I have a small web application whose backend database is in MySQL and the Server side scripting language is PHP (Hypertext Pre Processor).</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">First we should why we need AJAX in our application. We were pretty happy with our own standard applications where we use POST or GET method to go to database and Fetch data and display it in the Page.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">In the earlier cases if we want a small database access then also we need to POST the form with variables and then execute the Database query and then fetch and Display data back in the Browser.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Suppose we want to validate a user name, i.e we want to check if the user name already exists or not before inserting the user details in the database.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">In this case we need 2 server accesses.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">First time send data to server to check the user name from database.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">GET Data back to the Client with the details such as the name already exists or Name does not exist.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Again send the full form in the server with the complete user details to insert the user in the database.</span></li>
</ol>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">So, if our form is pretty long and contains images and JavaScripts other stuffs then these elements will load again along with the form. This will hamper the performance of the site.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">So we can use AJAX here to minimize the load time and Access time.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">As we know AJAX is not a new coding language. It is a Methodology. This methodology uses XMLHTTP Request to send data to server and get back the results with JavaScript.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Now we will create a JavaScript document named ServerReq.js, which will contain all the utility functions that we can use through out the application.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<table style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:6.15in;background-color:transparent;border:windowtext 0.5pt solid;padding:0 5.4pt;" width="590" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* File: <strong>ServerReq.js</strong></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*This file creates the instance of <strong>xmlHttpRequest</strong> object, sends and</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* Receives the request and response respectively.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* Static script to instantiate XMLHttp object for different browsers.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">var clientHttpHandler;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">clientHttpHandler = create();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* This method creates the <strong>xmlHttpRequest</strong> object and returns it.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">function create()<span>          </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>var xmlHttpRequest = false;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>//Internet Explorer</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>try</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>catch (xml2Exception)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>try</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>catch (xmlException)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>xmlHttpRequest = false;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span><span style="color:teal;">//Netscape, Mozila, Firefox, Safari, Opera</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>if (!xmlHttpRequest &#38;&#38; typeof XMLHTTPRequest == 'undefined')</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>try</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>xmlHttpRequest = new XMLHttpRequest();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>catch (genException)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>XMLHttpRequest = false;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>return xmlHttpRequest;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* This method sends the request to the server url according to the</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* Passing parameters. It sets the user’s response function to the </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* <strong>onreadystatechange</strong> event of the <strong>xmlHttpRequest </strong>object.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">function send(httpMethod, serverUrl, isAsync, respFunc)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>clientHttpHandler.open(httpMethod, serverUrl, isAsync);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>clientHttpHandler.onreadystatechange = respFunc;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>clientHttpHandler.send(null);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* This method checks the state and the status of the response and</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* Depending on that fetches the response text.</span></p>
<p class="MsoBodyText" style="margin:0;"><span style="font-size:9pt;"><span style="color:#008080;">* <strong>readystate</strong>: 0 - <strong>uninitialized</strong>, 1 - <strong>loading</strong>, 2 - <strong>loaded</strong>, 3 - <strong>interactive</strong>, 4 - <strong>complete</strong></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">function receive()</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>//var response = "";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>try</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span><span>            </span>if (clientHttpHandler.readyState == 4) // Completed</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>if (clientHttpHandler.status == 200) // "OK"</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                                </span>return true;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>else if (clientHttpHandler.status == 403) // "Forbidden"</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                                </span>alert("Error: Access denied. Please check the permissions!");</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>else if (clientHttpHandler.status == 404) // "URL Not Found"</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                                </span>alert("Error: URL not found. Please check the URL!");</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>else // Miscellaneous</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                                </span>alert("Error: status code " + clientHttpHandler.status);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>return false;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>catch (genException)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">In this function we have created an <strong>XMLHttpRequest</strong> object depending on the type of browser.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Then we have used the <strong>OnReadyStateChange</strong> event of the Object that will check if the Request has been completed or not. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">This event has 4 ready states:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<table style="border-right:gray 0.25pt solid;border-top:gray 0.75pt solid;background:#f1f1f1;border-left:gray 0.75pt solid;width:100%;border-bottom:gray 0.25pt solid;" border="1" cellspacing="0" cellpadding="0" width="100%" bgcolor="#f1f1f1">
<tbody>
<tr>
<td style="width:10%;background-color:transparent;border:gray;padding:0;" width="10%">
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:black;font-family:Verdana;">State</span></strong><strong><span style="font-size:10pt;color:black;font-family:Verdana;"></span></strong></p>
</td>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:black;font-family:Verdana;">Description</span></strong><strong><span style="font-size:10pt;color:black;font-family:Verdana;"></span></strong></p>
</td>
</tr>
<tr>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">0</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">The request is not initialized</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
</tr>
<tr>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">1</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">The request has been set up</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
</tr>
<tr>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">2</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">The request has been sent</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
</tr>
<tr>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">3</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">The request is in process</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
</tr>
<tr>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">4</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
<td style="background-color:transparent;border:gray;padding:0;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">The request is complete</span><span style="font-size:10pt;color:black;font-family:Verdana;"></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">So each time the ready state changes the function <strong>receive() </strong>will be executed.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">But we will look for the ready state 4 as in this state the request is marked as completed. SO whatever request we have sent that is being completed and we can now access the response data now.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Now we will create a Function that will use the above script to send, parse and display data to the webpage from where we have requested it.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<table style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:6.15in;background-color:transparent;border:windowtext 0.5pt solid;padding:0 5.4pt;" width="590" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* File: <strong>SendAjaxRequest.js</strong></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">This function we will call from our webpage with the values that</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">Needs to be sent to the server for processing.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">function SendReqSearchRequest(userName){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>         </span>/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>          </span>We will append a random number each time we need to </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>          </span>Send the request. So that browsers does not cache the request </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>          </span>And every time a fresh page will be executed.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>         </span>*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>      </span><span>  </span>var rand = Math.floor(Math.random()*1000001);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>              </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>        </span>// The URL where our background page resides</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>         </span>sURL = "../utility/searchuser.php"; // I have used a relative path</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span><span style="color:teal;">/*</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>         </span>I have here used the GET method to send data to the background </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>         </span>Page so builds the query string here.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>         </span>*/</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>         </span>queryString = "?rand=" + rand + "&#38;username=" + userName;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>         </span><span style="color:teal;">// Append the query string at the end of the URL</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>sURL += "?" + queryString;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span><span style="color:teal;">//Attach a function which will take care of the data when it comes back</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>         </span>clientFunc = populateSearchResultData;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>         </span><span style="color:teal;">// If this request is a synchronous or not.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>         </span>// If we use multiple synchronous requests at a time then only the</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"><span>        </span>// Last request will be executed.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>isSync = true;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>     </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>        </span><span style="color:teal;">// Now send the request.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>send("GET", sURL, isSync, clientFunc);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">/*</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">* This method populates the returrn data</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">*/</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">function populateSearchResultData ()</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>var opStr = "";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>if (receive())</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span><span> </span>response = clientHttpHandler.responseText;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span><span> </span>if(response == "NF"){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>document.getElementById("ResultDiv").innerHTML = "User name OK";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span><span> </span>}else{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span><span>          </span>document.getElementById("ResultDiv").innerHTML = "User name Already in Databse&#60;br/&#62; Choose a different one.";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                   </span>}<span>   </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Now we will create our background page <strong>searchuser.php</strong>, which will search the user name from the data we pass to it.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<table style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:6.15in;background-color:transparent;border:windowtext 0.5pt solid;padding:0 5.4pt;" width="590" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;?php</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">//1. Conenct to Databae Here</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">//2. Select the Database</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">//Check if the user name variable is set or not as without it we cannot search</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">if(isset($_REQUEST['username'])){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>// Build the query string </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>$name = $_REQUEST['username'];</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>$query = "SELECT user_name FROM tbl_user WHERE user_name = '{$name}'";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>// Now fire the query</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>$result = mysql_query($query);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>if(mysql_num_rows($result) &#62; 0){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>//User found</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>echo "OK";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}else{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>//User NOT found</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>echo "NF";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}else{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>echo "ERROR";</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">?&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Now this page will search the user name in the background and outputs specified string, which will send back the Client to process as per requirement.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">And now we require one more page before we proceed to Test.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">This page is the main page of our application from where user creation is done. I have used only one element to demonstrate the AJAX technology; you can use it anywhere you like.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<h1 style="margin:0;"><span style="font-size:10pt;"><span style="font-family:Verdana;">Name of the file: AddUser.html</span></span></h1>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<table style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:6.15in;background-color:transparent;border:windowtext 0.5pt solid;padding:0 5.4pt;" width="590" valign="top">
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;HTML&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;HEAD&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;TITLE&#62; AJAX Test Page &#60;/TITLE&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;META NAME="Generator" CONTENT="EditPlus"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;META NAME="Author" CONTENT=""&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;META NAME="Keywords" CONTENT=""&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;META NAME="Description" CONTENT=""&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">&#60;script type="text/javascript" src="js/ServerReq.js"&#62;&#60;/script&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:teal;font-family:Verdana;">&#60;script type="text/javascript" src="js/SendAjaxRequest.js"&#62;&#60;/script&#62;</span><span style="font-size:9pt;font-family:Verdana;"></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;script type="text/javascript"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">function checkUserName(){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>user =<span>  </span>document.getElementById("username");</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>          </span>if(null == user or user.value == “”){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>alert(“Please enter a User Name to check “);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>         </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"><span>            </span>SendReqSearchRequest(user);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;/script&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;/HEAD&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;BODY&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;form method="POST"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">User Name : &#60;input type="text" name="username" id="username"/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;a href="#" onlcick="javascript:checkUserName()"&#62; check user name &#60;/a&#62;&#60;br/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;div id="ResultDiv"&#62;&#60;/div&#62;&#60;br/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Password : &#60;input type="password" name="pass" id="pass" /&#62; &#60;br/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">Confirm Password : &#60;input type="password" name="confpass" id="confpass" /&#62; &#60;br/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;input type="submit" name="submit" value="Add user"/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;/form&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;/BODY&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;">&#60;/HTML&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Here if the users click on the <strong>“check user name” </strong>link, the function will be called and JavaScript will send the request to the server in the background. In the mean time users can proceed filling the form. This form will be ready.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">When the response data comes back from the server it will be displayed in the Div.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Also, Do not forget to add this JavaScripts at the TOP:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">&#60;script type="text/javascript" src="<strong>js/ServerReq.js</strong>"&#62;&#60;/script&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">&#60;script type="text/javascript" src="<strong>js/SendAjaxRequest.js</strong>"&#62;&#60;/script&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">You can note from these above lines that the Scripts are located in the <strong>js</strong> folder under the root directory.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">Important: As <strong>ServerReq.js</strong> holds the necessary functions to create and use the XMLHTTPRequest object then you always need to include the script <strong>ServerReq.js </strong>before using the<strong> </strong>Object.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;">HappY AjAxing ;)</span></p>
<p> </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)]]></title>
<link>http://carasetting.wordpress.com/?p=4</link>
<pubDate>Thu, 15 May 2008 15:29:05 +0000</pubDate>
<dc:creator>carasetting</dc:creator>
<guid>http://carasetting.wordpress.com/?p=4</guid>
<description><![CDATA[Apabila php telah diinstall dengan baik dan mysql juga telah ada, namun pada saat menjalankan mysql_]]></description>
<content:encoded><![CDATA[<p>Apabila php telah diinstall dengan baik dan mysql juga telah ada, namun pada saat menjalankan mysql_connect muncul error message "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)", kemungkinanya adalah MySQL server dan PHP mencari file socket pada tempat yang berbeda.</p>
<p>penyelesaiannya adalah sebagai berikut:</p>
<p>1. masuk ke /etc/php.ini atau lokasi lain tempat php.ini, cari socket dibagian mysqld. ganti dengan</p>
<p>mysql.default_socket=/tmp/mysql.sock</p>
<p>2. masuk ke /etc/my.cnf atau lokasi lain tempat my.cnf, cari socket</p>
<p>[client]<br />
socket=/tmp/mysql.sock</p>
<p>[mysqld]<br />
socket=/tmp/mysql.sock</p>
<p>Jika telah selesai, restart apache (etc/init.d/httpd restart) dan mysql server (/etc/init.d/mysqld restart)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[How to upload large files in PHP]]></title>
<link>http://jhalog.wordpress.com/?p=13</link>
<pubDate>Thu, 15 May 2008 15:10:51 +0000</pubDate>
<dc:creator>jhalak</dc:creator>
<guid>http://jhalog.wordpress.com/?p=13</guid>
<description><![CDATA[Problem: File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)
]]></description>
<content:encoded><![CDATA[<p>Problem: File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)</p>
<p>Solution:</p>
<p>1) To update the php.ini file  set</p>
<p>upload_max_filesize = 20M  (your desired size)<br />
post_max_size = 20M (your desired size)</p>
<p>2) Add the following lines in the .htaccess file in the root directory of the server:</p>
<p>php_value upload_max_filesize 20M<br />
php_value post_max_size 20M<br />
php_value max_execution_time 200<br />
php_value max_input_time 200</p>
<p>3) In the php file including the following codes:</p>
<p>&#60;?php ini_set("memory_limit","64M"); ?&#62;<br />
&#60;?php ini_set("post_max_size","20M"); ?&#62;<br />
&#60;?php ini_set("upload_max_filesize","20M"); ?&#62;</p>
<p>In HTML file from where the  file will be uploaded:</p>
<p>&#60;form ............................&#62;</p>
<p>&#60;input type="hidden" name="MAX_FILE_SIZE" value="200000000"&#62;</p>
<p>&#60;input type="file"     .....................&#62;</p>
<p>&#60;/form&#62;<br />
The choice depends upon the situation.</p>
]]></content:encoded>
</item>

</channel>
</rss>
