<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CatyCat İnternet &#187; form</title>
	<atom:link href="http://www.catycat.net/tag/form/feed" rel="self" type="application/rss+xml" />
	<link>http://www.catycat.net</link>
	<description>Web teknolojilerine alternatif bakış açısı</description>
	<lastBuildDate>Wed, 24 Feb 2010 18:42:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP ile Formları Aynı Sayfada Dönderme</title>
		<link>http://www.catycat.net/php-ile-formlari-ayni-sayfada-donderme</link>
		<comments>http://www.catycat.net/php-ile-formlari-ayni-sayfada-donderme#comments</comments>
		<pubDate>Thu, 31 Jul 2008 17:11:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[aynı sayfada]]></category>
		<category><![CDATA[form]]></category>

		<guid isPermaLink="false">http://www.catycat.net/?p=8</guid>
		<description><![CDATA[PHP ile proje geliştirirken önemli unsurlardan biri de sayfaların kalabalıklığıdır. Hele ki kapsamlı bir proje geliştiriyorsanız neyin nerde olduğunu bulmakla uğraşmak can sıkıcıdır. Bu sıkıntıyı bir nebze hafifleten bir yöntemi dilim döndüğünce anlatmaya çalışacağım. Öncelikle içerisinde form öğelerini barındıran normal bir HTML sayfası oluşturalım. index.html 1 2 3 4 5 6 7 8 9 10 [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_94" class="wp-caption alignleft" style="width: 260px"><img class="size-full wp-image-94" title="contactform" src="http://www.catycat.net/wp-content/uploads/2009/02/contactform.gif" alt="contact form" width="250" height="193" /><p class="wp-caption-text">contact form</p></div>PHP ile proje geliştirirken önemli unsurlardan biri de sayfaların kalabalıklığıdır. Hele ki kapsamlı bir proje geliştiriyorsanız neyin nerde olduğunu bulmakla uğraşmak can sıkıcıdır. Bu sıkıntıyı bir nebze hafifleten bir yöntemi dilim döndüğünce anlatmaya çalışacağım.<br />
<span id="more-8"></span><br />
Öncelikle içerisinde form öğelerini barındıran normal bir HTML sayfası oluşturalım.</p>
<p><b>index.html</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=windows-1250&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;generator&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;PSPad editor, www.pspad.com&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>PHP ile Formları Aynı Sayfada Dönderme - ERsin HAN<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form1&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;kaydet.php&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;isim&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Gönder!&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>
Formumuzu oluşturduktan sonra bu formdaki değerlerin okunacağı kaydet.php sayfasını oluşturalım.</p>
<p><b>kaydet.php</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$isim</span><span style="color: #339933;">=</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;isim&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$soyisim</span><span style="color: #339933;">=</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;soyisim&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #666666; font-style: italic;">// Değişkenlerimizi aldıktan sonra işlemlerimiz buradan devam ediyor.</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>
Gördüğünüz gibi normal bir formdan verileri aldık ve işlemleri yaptık ama bu basit işlem için 2 ayrı sayfa kullanmış olduk. Şimdi bu iki sayfayı nasıl birleştirip, işlemleri tek bir sayfada halledebiliriz ona bakalım. </p>
<p><b>birlesmis.php</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$submit</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Submit isimli buton tıklanmamışsa formu ekrana basıyoruz.</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;form name=&quot;form1&quot; action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$PHP_SELF</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; method=&quot;post&quot;&gt;
İsim: &lt;input type=&quot;text&quot; name=&quot;isim&quot; value=&quot;&quot;&gt;
Soyisim: &lt;input type=&quot;text&quot; name=&quot;soyisim&quot; value=&quot;&quot;&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Gönder!&quot;&gt;
&lt;/form&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$submit</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Submit isimli buton tıklanmışsa işlemlerimi yapıyoruz.</span>
<span style="color: #000088;">$isim</span><span style="color: #339933;">=</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;isim&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$soyisim</span><span style="color: #339933;">=</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;soyisim&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #666666; font-style: italic;">// Değişkenlerimizi aldıktan sonra işlemlerimiz buradan devam ediyor.</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>
Örnekte görüldüğü gibi formdaki submit butonuna verdiğimiz isimle formun gönderilip($submit==true) gönderilmediğini ($submit==false) anlayabiliyoruz. Submit butonu tıklanmadıysa formu gösteriyoruz. Tıklandıysa yani form gönderildiyse, işlemlerimizi yapıyoruz.</p>
<p>Bu işlem genel hatlarıyla bu şekilde. Soru, görüş ve önerilerinizi yorum olarak gönderebilirsiniz.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catycat.net/php-ile-formlari-ayni-sayfada-donderme/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arama Formlarına Anahtar Kelime Önerileri Ekleme</title>
		<link>http://www.catycat.net/arama-formlarina-anahtar-kelime-onerileri-ekleme</link>
		<comments>http://www.catycat.net/arama-formlarina-anahtar-kelime-onerileri-ekleme#comments</comments>
		<pubDate>Fri, 25 Jul 2008 22:12:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[keyword suggest]]></category>

		<guid isPermaLink="false">http://www.catycat.net/?p=6</guid>
		<description><![CDATA[Başta Google olmak üzere birçok web sitesinde arama yapmak istediğinizde, yazdınız şeylerle ilgili sizlere öneriler sunulduğunu görmüşsünüzdür. Bu yazıda bu tür arama formlarını nasıl oluşturabileceğimizi anlatmaya çalışacağım.Bu işlemleri yapabilmek için PHP, MySQL ve AJAX kullanacağız. AJAX&#8217;ın çalışma mantığını anlamak için şu adreste eburhan&#8217; ın yazdığı makaleyi okumanızı tavsiye ederim. Artık arama formunu içeren sayfamızı oluşturmanın vakti [...]]]></description>
			<content:encoded><![CDATA[<p><a style="border: 0pt none ; background-color: transparent; clear: left; margin-bottom: 1em; float: left; margin-right: 1em;" href="http://www.seroundtable.com/archives/google-suggest.jpg"><img class="alignleft" style="border: 0pt none;" src="http://www.seroundtable.com/archives/google-suggest.jpg" alt="" width="200" height="124" /></a>Başta <a href="http://www.google.com/">Google</a> olmak üzere birçok web sitesinde arama yapmak istediğinizde, yazdınız şeylerle ilgili sizlere öneriler sunulduğunu görmüşsünüzdür. Bu yazıda bu tür arama formlarını nasıl oluşturabileceğimizi anlatmaya çalışacağım.Bu işlemleri yapabilmek için PHP, MySQL ve AJAX kullanacağız. AJAX&#8217;ın çalışma mantığını anlamak için <a href="http://ajax-tr.com/eyceks-kutuphanesi-ve-ornek-bir-uygulama/1/">şu adreste</a> eburhan&#8217; ın yazdığı makaleyi okumanızı tavsiye ederim.</p>
<p><span id="more-6"></span><br />
Artık arama formunu içeren sayfamızı oluşturmanın vakti geldi.</p>
<p><strong>index.html</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=windows-1250&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;generator&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;PSPad editor, www.pspad.com&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Arama Formlarına Anahtar Kelime Önerileri Ekleme - ERsin HAN<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;eyceks.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
function oneriler(){ 
    var gelen = document.ara.aranan.value;
    var gelen = fc_(gelen);
    var sc = 'ara='+ gelen;
        JXP(1, &quot;sonuclar&quot;, &quot;oneriler.php&quot;, sc);
        e=document.getElementById('sonuclar');
        e.style.display=&quot;block&quot;;
   }
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ara&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ara.php&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;aranan&quot;</span> <span style="color: #000066;">onkeyup</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;oneriler()&quot;</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- Fonksiyonumuzu çağırıyoruz. --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Ara&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'sonuclar'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- Fonksiyondan gelen kelimelerin gösterileceği alan. --&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>Sayfamızı oluşturduktan sonra formun anlık okunacağı oneriler.php sayfasını oluşturmadan önce anahtar kelimeler içeren tablomuzu veritabanında oluşturuyoruz.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`a_kelime`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`id`</span> int<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`icerik_id`</span> int<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`a_kelime`</span> varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span>  <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>MyISAM  <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8 <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">36</span> ;
&nbsp;
<span style="color: #808080; font-style: italic;">--</span>
<span style="color: #808080; font-style: italic;">-- Tablo döküm verisi `a_kelime`</span>
<span style="color: #808080; font-style: italic;">-- </span>
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`a_kelime`</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'elma'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`a_kelime`</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'armut'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`a_kelime`</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'kiraz'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`a_kelime`</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'karpuz'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`a_kelime`</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'ayva'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Veritabanında anahtar kelime tablomuzu oluşturduktan sonra sıra geldi PHP sayfamıza.</p>
<p><strong>oneriler.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #000088;">$db_host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Genelde localhost</span>
  <span style="color: #000088;">$db_kullanici</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Veritabanı kullanıcı adınız</span>
  <span style="color: #000088;">$db_sifre</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;******&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// Veritabanı şifreniz</span>
  <span style="color: #000088;">$db_adi</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;deneme&quot;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// Veritabanı adınız</span>
&nbsp;
  <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_host</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_kullanici</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_sifre</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_adi</span><span style="color: #339933;">,</span> <span style="color: #000088;">$baglanti</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_errno</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Veritabanına bağlanılamıyor ...'</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$ara</span><span style="color: #339933;">=</span><span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$aranan</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Gelen değişkeni temizliyoruz.</span>
<span style="color: #000088;">$sorgu</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT DISTINCT a_kelime FROM a_kelime WHERE a_kelime LIKE '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$aranan</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;%'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$say</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sorgu</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$aranan</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizi</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sorgu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$ekle</span><span style="color: #339933;">=</span><span style="color: #000088;">$dizi</span><span style="color: #009900;">&#91;</span>a_kelime<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&lt;a href='ara.php?aranan=<span style="color: #006699; font-weight: bold;">$ekle</span>'&gt;&lt;small&gt;<span style="color: #006699; font-weight: bold;">$dizi[a_kelime]</span>&lt;/small&gt;&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Temel olarak yapılan işlemler bu kadar. CSS ile önerileren kelimeleri arama formunun altına getirebilirsiniz. Uygulamayı geliştirdikten sonra, yaptığınız örnekleri ve adreslerini yorum olarak gönderebilirsiniz.</p>
<p>Uygulamayı indirmek için:</p>
<p><a href="http://www.box.net/shared/jq3s295w48">Arama Formu Önerileri</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.catycat.net/arama-formlarina-anahtar-kelime-onerileri-ekleme/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
