<?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>darmstädterFiltrat &#187; web &amp; programmierung</title>
	<atom:link href="http://www.karrock.de/daf/tag/web-programmierung/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karrock.de/daf</link>
	<description>daF: das Filtrat aus Darmstadt - ein Blog über Wissenschaft und Forschung, Kultur und Gesellschaft</description>
	<lastBuildDate>Mon, 10 Oct 2011 18:35:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Moderne Webentwicklung &#8211; Eine Vortragsreihe an der TU Darmstadt</title>
		<link>http://www.karrock.de/daf/2010/11/moderne-webentwicklung-eine-vortragsreihe-an-der-tu-darmstadt/</link>
		<comments>http://www.karrock.de/daf/2010/11/moderne-webentwicklung-eine-vortragsreihe-an-der-tu-darmstadt/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 11:58:14 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[darmstadt]]></category>
		<category><![CDATA[web & programmierung]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=1532</guid>
		<description><![CDATA[{lang: 'de'}Moderne Webentwicklung lebt von modernen Programmiersprachen, modernen Methoden und vor allem von Frameworks, die dem Programmierer viel Arbeit abnehmen. Gerade im Webbereich haben mit der Weiterentwicklung Web 2.0 zahlreiche Frameworks Vorschub bekommen. Webentwicklung findet nicht mehr nur für große Webseiten statt, sondern auch für Applikationen für mobile Endgeräte (wie iPhone, HTC, usw.). Durch Frameworks [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2010/11/moderne-webentwicklung-eine-vortragsreihe-an-der-tu-darmstadt/">{lang: 'de'}</g:plusone></div><p>Moderne Webentwicklung lebt von modernen Programmiersprachen, modernen Methoden und vor allem von Frameworks, die dem Programmierer viel Arbeit abnehmen.</p>
<p>Gerade im Webbereich haben mit der Weiterentwicklung Web 2.0 zahlreiche Frameworks Vorschub bekommen. Webentwicklung findet nicht mehr nur für große Webseiten statt, sondern auch für Applikationen für mobile Endgeräte (wie iPhone, HTC, usw.).</p>
<p>Durch Frameworks werden dem Entwickler Funktionen an die Hand gegeben, die die Entwicklung selbst leichter machen sollen, aber vor allem auch Designelemente standardisieren und Anwendungen auf vielen Endgeräten robuster machen. Jeder Webentwickler kennt die Probleme eine Webseite für die verschiedensten Browser zu optimieren.</p>
<p>An der TU Darmstadt, Fachbereich Informatik findet am Samstag, 04.12.2010 eine Vortragsreihe statt, die drei interessante und moderne Entwicklungsmethoden mit Frameworks vorstellt:</p>
<ul>
<li><a title="Link zum Veranstaltungskalender" href="http://www.informatik.tu-darmstadt.de/de/aktuelles/veranstaltungentermine/?no_cache=1&amp;tx_cal_controller[getdate]=20101204&amp;tx_cal_controller[lastview]=month-35&amp;tx_cal_controller[view]=event&amp;tx_cal_controller[type]=tx_cal_phpicalendar&amp;tx_cal_controller[uid]=617&amp;cHash=b0055c40739afbecea68aa8f9ddfaa9e">Ruby On Rails in a metro session</a> (Jesus Villar)</li>
<li><a title="Link zum Veranstaltungskalender" href="http://www.informatik.tu-darmstadt.de/de/aktuelles/veranstaltungentermine/?no_cache=1&amp;tx_cal_controller[getdate]=20101204&amp;tx_cal_controller[lastview]=month-35&amp;tx_cal_controller[view]=event&amp;tx_cal_controller[type]=tx_cal_phpicalendar&amp;tx_cal_controller[uid]=618&amp;cHash=73922e014c5db3a10760e30451f49693">CodeIgniter &#8211; Einführung in ein lightweight PHP-Framework</a> (Ulf Karrock)</li>
<li><a title="Link zum Veranstaltungskalender" href="http://www.informatik.tu-darmstadt.de/de/aktuelles/veranstaltungentermine/?no_cache=1&amp;tx_cal_controller[getdate]=20101204&amp;tx_cal_controller[lastview]=month-35&amp;tx_cal_controller[view]=event&amp;tx_cal_controller[type]=tx_cal_phpicalendar&amp;tx_cal_controller[uid]=619&amp;cHash=12bc292e34dd31dd4461752bc8ae46f3">HTML5 und Javascript &#8211; mehr als eine &#8220;simple&#8221; Scriptsprache</a> (Thomas Pöpl)</li>
</ul>
<p>Die drei Vorträge finden im <a title="Fachbereichsgebäude Informatik bei Google Maps" href="http://maps.google.de/maps/place?cid=5641014022272537499&amp;q=Technische+Universit%C3%A4t+Darmstadt:+Fachbereich+Informatik+&amp;hl=de&amp;ved=0CFoQ-QswAA&amp;ei=fOb0TIeRO4OxsAbRy4XyCQ&amp;sll=49.877588,8.65624&amp;sspn=0.00903,0.01929&amp;ie=UTF8&amp;ll=49.882192,8.644931&amp;spn=0,0&amp;t=h&amp;z=16">Fachbereichsgebäude der Informatik an der TU Darmstadt</a> (Hochschulstraße 10, 64289 Darmstadt) statt.</p>
<p><strong>Beginn:</strong> Samstag 04.12.2010, 10 Uhr<br />
 <strong>Ende:</strong> ca. 13 Uhr<br />
 <strong>Raum:</strong> S2 02 | C110</p>
<p>Wer interessiert ist an einer Einführung in moderne Webentwicklung sollte hier einen Blick riskieren.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2010/11/moderne-webentwicklung-eine-vortragsreihe-an-der-tu-darmstadt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Designer vs. Client &#8211; Make my website for free</title>
		<link>http://www.karrock.de/daf/2010/03/web-designer-vs-client-make-my-website-for-free/</link>
		<comments>http://www.karrock.de/daf/2010/03/web-designer-vs-client-make-my-website-for-free/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 10:37:36 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[web & programmierung]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=1247</guid>
		<description><![CDATA[{lang: 'de'} Gefunden bei Clients from hell.]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2010/03/web-designer-vs-client-make-my-website-for-free/">{lang: 'de'}</g:plusone></div><p style="text-align: center;"><a href="http://www.youtube.com/watch?v=HyTpzgAW5NA"></a><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="play" value="false" /><param name="loop" value="false" /><param name="src" value="http://www.youtube.com/v/HyTpzgAW5NA" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/HyTpzgAW5NA" loop="false" play="false"></embed></object>
</p>
<p style="text-align: left;">Gefunden bei <a title="Clients from hell" href="http://clientsfromhell.tumblr.com/">Clients from hell</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2010/03/web-designer-vs-client-make-my-website-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fachbücher online einsehen</title>
		<link>http://www.karrock.de/daf/2010/02/fachbuecher-online-einsehen/</link>
		<comments>http://www.karrock.de/daf/2010/02/fachbuecher-online-einsehen/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 18:19:14 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Werkzeuge]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[studium]]></category>
		<category><![CDATA[web & programmierung]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=1241</guid>
		<description><![CDATA[{lang: 'de'}Wer kennt nicht inzwischen den Verlag Galileo Computing, der durch seine kostenlosen online abrufbaren Bücher Openbook (wie die &#8220;Java Insel&#8221;, wohl eines der besten Java Bücher überhaupt), aber auch durch seine anderen guten Fachbücher bekannt wurde? Noch bekannter dagegen ist der O&#8217;Reilly-Verlag, welcher sich den IT-Fachbüchern verschrieben hat. Die sehr guten und praktischen Fachbücher [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2010/02/fachbuecher-online-einsehen/">{lang: 'de'}</g:plusone></div><p>Wer kennt nicht inzwischen den Verlag <a title="Webseite des IT-Fachbuchverlags Galileo Computing" href="http://www.galileocomputing.de/">Galileo Computing</a>, der durch seine kostenlosen online abrufbaren Bücher <a title="Das Openbook-Angebot von Galileo-Computing (Bücher zum Herunterladen oder online lesen)" href="http://www.galileocomputing.de/katalog/openbook">Openbook</a> (wie die &#8220;Java Insel&#8221;, wohl eines der besten Java Bücher überhaupt), aber auch durch seine anderen guten Fachbücher bekannt wurde?</p>
<p>Noch bekannter dagegen ist der <a title="deutsche Webseite des O'Reilly Verlags" href="http://www.oreilly.de/">O&#8217;Reilly-Verlag</a>, welcher sich den IT-Fachbüchern verschrieben hat. Die sehr guten und praktischen Fachbücher vom &#8220;Cookbook&#8221;, der Referenz bis hin zur &#8220;kurz&amp;gut&#8221;-Kurzreferenz für die Westentasche sind die Bücher alle durchweg für die praktische Anwendung geeignet.</p>
<p>Wie <a title="golem.de zum neuen Dienst PaperC" href="http://www.golem.de/1002/73406.html">golem.de</a> heute meldet, bietet der Webdienst <a title="Hauptseite des Online-Bücherdienst PaperC" href="http://www.paperc.de/">PaperC</a>, bei dem man knapp 2.700 Bücher online kostenlos von der ersten bis zur letzten Seite einsehen kann, nun auch 600 neue IT-Bücher aus dem Hause O&#8217;Reilly an.</p>
<p>Ich habe den Dienst selbst noch nicht benutzt, aber aus den Kommentaren bei golem.de lässt sich entnehmen, dass die Qualität zum lockeren Lesen am PC wohl nicht geeignet sei. Aber zum Recherchieren z. Bsp. für Hausarbeiten oder zum schnellen Nachschlagen dürfte es genügen. Ein guter Tipp! Ich könnte mir gut vorstellen, dass der Dienst sich auch dazu eignet in Bücher reinzuschauen und sich dadurch eine Kaufentscheidung zu erleichtern. Der Dienst PaperC ist übrigens deutsch und hat damit auch deutsche Bücher im Angebot!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2010/02/fachbuecher-online-einsehen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to validate forms with jQuery and CodeIgniter</title>
		<link>http://www.karrock.de/daf/2009/10/how-to-validate-forms-with-jquery-and-codeigniter/</link>
		<comments>http://www.karrock.de/daf/2009/10/how-to-validate-forms-with-jquery-and-codeigniter/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 22:12:14 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[web & programmierung]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=1063</guid>
		<description><![CDATA[{lang: 'de'}In the Web 2.0 it is familiar to create new services. In Germany the Web 2.0 is also called &#8220;Mitmach-Web&#8221; (join-in-web). And there is a other transformation in the scene: With Javascript (and that what is called Ajax &#8211; I call it in german always &#8220;Webwaschmittel&#8221;) more and more static websites becomes dynamically web [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2009/10/how-to-validate-forms-with-jquery-and-codeigniter/">{lang: 'de'}</g:plusone></div><div id="attachment_1085" class="wp-caption alignleft" style="width: 175px"><a href="http://codeigniter.com/"><img class="size-medium wp-image-1085 " title="CodeIgniter Logo" src="http://www.karrock.de/daf/wp-content/uploads/2009/10/codeigniter_logo_black-235x300.jpg" alt="CodeIgniter Logo" width="165" height="210" /></a><p class="wp-caption-text">CodeIgniter Logo</p></div>
<p>In the Web 2.0 it is familiar to create new services. In Germany the <a title="Wikipedia about Web 2.0" href="http://en.wikipedia.org/wiki/Web_2.0">Web 2.0</a> is also called &#8220;Mitmach-Web&#8221; (join-in-web). And there is a other transformation in the scene: With Javascript (and that what is called Ajax &#8211; I call it in german always &#8220;Webwaschmittel&#8221;) more and more static websites becomes dynamically web applications &#8211; to use like normal desktop applications. But to have an interactive website, which behaves similar to a desktop application (giving response in no time, show informations and take the user into its own hand). The one thing webdesigners and web-developers do to make a website interactive and behaves like an application is to use Javascript. Javascript is the mean of  choice but there exists several Javascript-Frameworks which helps the user to write clean and short Javascript-Code with a great functionality.</p>
<p>On the backend-side (server-side) the programmers have done also many development and engineering in the last years. Several Frameworks have been established (<a title="Symfony Framework" href="http://www.symfony-project.org/">Symfony</a>, <a title="CodeIgniter" href="http://codeigniter.com/">CodeIgniter</a>, <a title="Ruby on Rails" href="http://rubyonrails.org/">Ruby on Rails</a>, <a title="Zend Framework" href="http://framework.zend.com/">Zend</a>, <a title="Flow3 - The Typo3 Application Framework" href="http://flow3.typo3.org/">Flow3</a> and so on &#8211; more about frameworks in the iX special &#8220;<a title="iX special &quot;Web on Rails&quot;" href="http://www.heise.de/kiosk/special/ix/09/01/">Web on Rails</a>&#8220;). I am using CodeIgniter because it is a really leightweight and nice to use framework with many functionality, but the latitude to program and design your application as you will (means: with very few restrictions and a very small footprint).</p>
<p>In this little HowTo I want to show you how to build a little CodeIgniter REST-like API (only  an example with one controller) and use it via Javascript (ajax with jQuery). The <a title="Wikipedia about Representational State Transfer" href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a>-API (Representational State Transfer &#8211; Advanced Programming Interface) is an idea, a way how to provide information and data as an service to the web, using the <a title="Wikipedia about the HTTP protocol" href="http://en.wikipedia.org/wiki/Http_protocol">HTTP-protocol</a> given mechanisms (like POST-data, GET-data, &#8230;). I write knowingly &#8220;REST-like&#8221;, because it is no easy work to create a full and dynamically usable REST-API. The <a title="Model-View-Controller-Pattern" href="http://en.wikipedia.org/wiki/MVC_Pattern">MVC-Pattern</a>-Design from CodeIgniter helps you to build Controller which can behave REST-like. But still programming a controller and let them return a header and some data is not the whole idea of a REST-full API.<br />
 To learn what a REST-API is or how it works: have a look at &#8220;<a title="RESTful Web service with an example of http://del.icio.us" href="http://www.peej.co.uk/articles/restfully-delicious.html">A RESTful Web service, an example</a>&#8221; by Paul James. There are also a german PDF &#8220;<a title="REST Webservice eine Einführung" href="http://www.oio.de/public/xml/rest-webservices.pdf">REST Web Services &#8211; eine Einführung</a>&#8221; available from OIO (Orientation In Objects &#8211; a german software development company).<br />
 I also used two other tutorials from the web to inform myself about form validation with Ajax. You can find them at the end of the article among &#8220;Sources&#8221;.</p>
<p>Now I want to show you in an easy way how to build one little web service which validates something for you and send a response. A Javascript snippet send a call to the CodeIgniter Controller, the Controller do something and send an response. The answer will be shown up on the front end without relaoding the whole website. So it is good for a site with a PHP-Backend (via the REST-API) because it can be used from others later (maybe from outside or from company-internal services).</p>
<p><span id="more-1063"></span><br />
 This code splitting: using Javascript for the request and do the validation in PHP and sending an response makes your application more secure, because if you writes your validation all in Javascript inside the HTML-code, a attacker can use this information. And you need in all cases (also when you wants to validates all with Javascript inside the HTML-code and also with the scenario explained in this article) a PHP-function to validate the data you gets from outside before it will be inserted maybe in a database. Because a attacker can build a own website, using your site and deletes the Javascript code and then sending some shit to your application.</p>
<p>It is some of the most important security-rules when you have an application with data coming from outside your application to test them in all cases. The application has to verify that the data are as expected and that the length is like expected. Just to think all users are nice and it is enough to tell them &#8220;this string has to be maximal 128 characters long&#8221; and not to verify is a naive way.</p>
<p>But now coming to the things you need to build a Ajax form validation with jQuery and a REST-like API built with CodeIgniter.</p>
<h4>What do you need?</h4>
<p>You need a CodeIgniter installation. You need a Controller (which represent the REST-like API), a HTML-Website, jQuery and a little Javascript snippet. For testing I used a simple HTML-Website (no site provided by CI &#8211; so in this example I just use CI for the validation-response).</p>
<ul>
<li>Your Controller must have the name: <span style="font-family: courier new,courier;">service.php</span> and must have (in this example) a <span style="font-family: courier new,courier;">function exists()</span></li>
<li>The service has be available in: <span style="font-family: courier new,courier;">system/application/controller/</span></li>
<li>The simple HTML-File for test this web-service has to be stored in the same directory as the CI <span style="font-family: courier new,courier;">index.php</span>.</li>
<li>The HTML-File itself. I named it: <span style="font-family: courier new,courier;">template.php</span> (it has an php-suffix, but it is still a HTML-site).</li>
</ul>
<p>Let´s start with the HTML-File and some Javascript.</p>
<h4>The HTML-File and Javascript-Code</h4>
<div id="attachment_1087" class="wp-caption alignleft" style="width: 236px"><a href="http://jquery.com/"><img class="size-full wp-image-1087" title="jQuery Logo" src="http://www.karrock.de/daf/wp-content/uploads/2009/10/jquery.jpg" alt="jQuery Logo" width="226" height="61" /></a><p class="wp-caption-text">jQuery Logo</p></div>
<p>First of all create an HTML-File. I using one created with <a title="Yet Another Multicolumn Layout" href="http://www.yaml.de/">YAML</a>. In the header of the HTML-File you have to link to jQuery (local stored or from the web), to use their functions.</p>
<pre>&lt;script src="<a title="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" href="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js">http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js</a>"
type="text/javascript"&gt;&lt;/script&gt;</pre>
<p>Then you put these Javascript Snippet in the head.<br class="spacer_" /></p>
<pre>$(document).ready(function () {
 var validateUsername = $('#validateUsername');
 $('#username').keyup(function () {
    var t = this;
    if (this.value != this.lastValue) {
      if (this.timer) clearTimeout(this.timer);
         validateUsername.removeClass('error').html('&lt;img src="images/ajax-loader.gif" height="16"
         width="16" /&gt; checking availability...');
         this.timer = setTimeout(function () {
            $.ajax({
               url: 'index.php/api/service/exists/',
               data: 'username=' + t.value,
               dataType: 'json',
               type: 'post',
               success: function (j) {
                  validateUsername.html(j.msg);
               }
             });
          }, 200);
         this.lastValue = this.value;
      }
   });
});</pre>
<p>What this all stands for and the parts of the code are explained in the source jQuery for designers &#8220;Using Ajax to validate forms&#8221; below. You see at line 7 a little grafic is loaded. You have to put this image in your images-directory. A Ajax-Load-Image (also called ajax spinner) in your style can be downloaded at <a title="Download a ajax spinner to indicate activity" href="http://ajaxload.info/">ajaxload.info</a>. This grafic indicates activity when load data via Ajax.</p>
<p>In the middle of the code you see the <span style="font-family: courier new,courier;">$.ajax({})</span>-part. This are the data which will be send to your CodeIgniter REST-like API to validate them. The <span style="font-family: courier new,courier;">url</span> is the uri-segment of your CodeIgniter-URL. This is, why the <span style="font-family: courier new,courier;">template.php</span> file has to be stored where the CI <span style="font-family: courier new,courier;">index.php</span> is. This will later be unnecessary when you load your website via CI, but is necessary in this example because we work with this simple <span style="font-family: courier new,courier;">template.php</span>-File instead of using the CI framework for providing the test-site.<br />
 The part <span style="font-family: courier new,courier;">exists</span> is the function inside your CI-Controller &#8220;<span style="font-family: courier new,courier;">service</span>&#8220;. As you can see we pass the data in <a title="Wikipedia about the JSON-Format" href="http://en.wikipedia.org/wiki/JSON">JSON</a>-format. So the response later has also to be in JSON. And we put the data via HTTP &#8220;post&#8221; to the CI service, so we have to read later the data from the PHP <span style="font-family: courier new,courier;">$_POST[]</span>-variable.</p>
<p>As you know, CI normally gets the data via GET over the URL (in the uri-segments like: <span style="font-family: courier new,courier;">controller/function/param1/param2</span>). This also works with this JScript. Normally via Ajax and REST-API you put the data via POST. If you want to put it via the URL you have to change the script above. Delete the lines for set &#8220;<span style="font-family: courier new,courier;">data</span>&#8221; and &#8220;<span style="font-family: courier new,courier;">type</span>&#8221; and transofrm the url like this:</p>
<pre>url: 'index.php/api/service/exists/' + t.value</pre>
<p>The next thing is the  HTML-snippet (with the IDs from above, used in the Javascript). This is the base for using the Javascript, sending the value in the input-field and display the response from the CI-Controller.<br class="spacer_" /></p>
<h4>The HTML-Code</h4>
<p>This is the HTML-Code inside our <span style="font-family: courier new,courier;">template.php</span> to few an input-form-field and can view the response from CI and the loading-spinner. The spinner and the validation-response is shown in the span with the ID <span style="font-family: courier new,courier;">#validateUsername</span>.</p>
<pre>&lt;div&gt;
  &lt;label for="username"&gt;Username, valid: a-z.-_&lt;/label&gt;
  &lt;input type="text" name="username" value="" id="username" /&gt;
  &lt;span id="validateUsername"&gt;&lt;?php if ($error) { echo $error['msg']; } ?&gt;&lt;/span&gt;
&lt;/div&gt;</pre>
<p>No we have the base to call the CI function, which makes the validation (or whatever you want) and send a response.<br class="spacer_" /></p>
<h4>The CodeIgniter controller and function &#8211; The REST-like API</h4>
<p>This is a primitive Controller, which only checks if a parameter is given or not and sending a response. You can do in this function much more, like doing a database query.</p>
<pre>/**
 * Checks whether a given string is valid or not
 * @param string $value A given value when you call the function via PHP
 * @return string A JSON encoded array
 * @author UK
 */
 public function exists($value=null) {
    $value = $_POST['username'];  //POST-Data from the Javascript
    $response = array();

   //If you does not get an response, you can use this code
   //to test if the JScript calls the controller correctly
   /* $filename = "/the/path/to/your/file.txt";
   $handle = fopen($filename, "w+");
   fwrite($handle, $value);
   fclose($handle); */

   if (empty($value)) {
      $response = array(
         'ok' =&gt; false,
         'msg' =&gt; 'invalid username'
      );
   } //if - empty
   else {
      $response = array(
         'ok' =&gt; true,
         'msg' =&gt; 'valid username'
      );
   }

   header('Content-Type: application/json');
   echo json_encode($response); //send the response to the caller
 } //exists</pre>
<p>Only one thing is important. That the Ajax-caller can get the response, the callee have to send an <a title="Sending http-headers with php" href="http://php.net/manual/en/function.header.php">http-header</a> (that now coming JSON-encoded data) and then just send (echo) the data. This are the last two lines. A PHP-return is not enough, because this returns the data to the PHP-internal caller (which is here the CI-Framework, coming over the <span style="font-family: courier new,courier;">index.php</span>). But you need to put the data via http to the frontend-website and this is, what echo do.</p>
<p>That´s it.<br />
 Now you have an REST-like API (your Controller) and have a nice input-field which let the data  on change validate from the CI Controller.<br />
 The only disadvantage is, that you need for <em>every</em> input-field you want to validate a little Javascript snippet in the site-header. But maybe you can write them all together in a little js-File and include one file. Maybe the code for sending the value and showing the grafic can be written down in a little javascript-function, so that every snippet for every input-field can reuse these things. So you can minimize the overhead.</p>
<h4>Sources</h4>
<p>&#8220;<a title="Using Ajax to validate forms at jqueryfordesigners.com" href="http://jqueryfordesigners.com/using-ajax-to-validate-forms/">Using Ajax to validate forms</a>&#8221; at jqueryfordesigners.com<br />
 &#8220;<a title="Example form validation for the tutorial from jqueryfordesigners.com" href="http://jqueryfordesigners.com/demo/ajax-validation.php">jQuery for Designers &#8211; Ajax Form Validation Example</a>&#8221; at jqueryfordesigners.com<br />
 &#8220;<a title="A quick Code Igniter and jQuery Ajax tutorial at mrforbes.com" href="http://www.mrforbes.com/thoughts/2009/01/28/a-quick-code-igniter-and-jquery-ajax-tutorial/">A quick Code Igniter and jQuery Ajax Tutorial</a>&#8221; at mrforbes.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2009/10/how-to-validate-forms-with-jquery-and-codeigniter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installation of the WordPress Plugin MyCaptcha</title>
		<link>http://www.karrock.de/daf/2009/01/installation-of-the-wordpress-plugin-mycaptcha/</link>
		<comments>http://www.karrock.de/daf/2009/01/installation-of-the-wordpress-plugin-mycaptcha/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 17:26:13 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[web & programmierung]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=343</guid>
		<description><![CDATA[{lang: 'de'}The installation instructions for the WordPress PlugIn MyCaptcha on wordpress.org is false. The code shown there is not complete. Here are the correct way to install it. for the single.php-file of your theme (must start at the first line of your file): &#60;?php if (class_exists('MyCaptcha')) { $MyCaptcha-&#62;initialize(); } // ?&#62; for the comment.php-file the [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2009/01/installation-of-the-wordpress-plugin-mycaptcha/">{lang: 'de'}</g:plusone></div><p>The <a title="Installation Instructions for MyCaptcha at wordpress.org" href="http://wordpress.org/extend/plugins/mycaptcha/installation/" target="_blank">installation instructions</a> for the WordPress PlugIn MyCaptcha on wordpress.org is false. The code shown there is not complete. Here are the correct way to install it.</p>
<ul>
<li>for the <span style="font-family: courier new,courier;"><strong>single.php</strong></span>-file of your theme (must start at the first line of your file):</li>
</ul>
<p><code>&lt;?php<br />
if (class_exists('MyCaptcha')) {<br />
$MyCaptcha-&gt;initialize();<br />
}<br />
//<br />
?&gt;</code></p>
<p><span id="more-343"></span></p>
<ul>
<li>for the <strong>comment.php</strong>-file the code on wordpress.org is correct:</li>
</ul>
<p><code> &lt;?php</code><code><br />
if (class_exists('MyCaptcha')) {</code><code><br />
global $MyCaptcha;<br />
?&gt;<br />
Enter this code &lt;!-- or any text that fits you --&gt;<br />
&lt;?php<br />
$MyCaptcha-&gt;comment_form();<br />
?&gt;</code></p>
<p>&lt;br&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;securitycode&#8221; id=&#8221;securitycode&#8221; size=&#8221;30&#8243; /&gt;<br />
<code><br />
&lt;?php<br />
}<br />
?&gt;</code></p>
<p>Important is, that you paste the code for the <span style="font-family: courier new,courier;">single.php</span> in the <em>first</em> line! If you have the <code>get_header();</code> in the first line, you´ll get following error (the path and the code-line is different from yours &#8211; it is dependent from your webserver and your wordpress-theme):</p>
<p style="padding-left: 30px;"><strong>Warning:</strong> session_start() [function.session-start]: Cannot send session cache limiter &#8211; headers already sent (output started at /path/to/your/website/wordpress/wp-content/themes/k2/header.php:24) in /path/to/your/website/wordpress/wp-content/plugins/mycaptcha/MyCaptcha.php on line 41</p>
<p>Hope this will help you fix a installation problem with the <a title="MyCaptcha description-site" href="http://wordpress.org/extend/plugins/mycaptcha/" target="_blank">MyCaptcha Plugin</a> for WordPress.</p>
<p>At douglaswademedia.com are also some information available on how to install the Plugin. But <strong>attention</strong> &#8211; there is also shown the <strong>failure</strong> at the 2nd screenshots, where the <code>get_header();</code> is in the first line (that is false!).</p>
<h4>Update 05.07.2009 &#8211; Prefering SI Captcha</h4>
<p>I now prefer the more easier to install Captcha-Plugin <a title="Get SI Captcha" href="http://wordpress.org/extend/plugins/si-captcha-for-wordpress/">SI Captcha</a>. It also provides more functionality like reload Captcha. It also works perfectly with the newest WordPress version!<br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2009/01/installation-of-the-wordpress-plugin-mycaptcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Personalisierte Google-Suche für die eigene Webseite</title>
		<link>http://www.karrock.de/daf/2008/10/personalisierte-google-suche-fuer-die-eigene-webseite/</link>
		<comments>http://www.karrock.de/daf/2008/10/personalisierte-google-suche-fuer-die-eigene-webseite/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 18:15:37 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[web & programmierung]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=90</guid>
		<description><![CDATA[{lang: 'de'}Bereits seit einiger Zeit ist es möglich mit Google eine benutzerdefinierte Suche anzulegen. Auch Yahoo und andere Suchmaschinenbetreiber bieten ähnliche Dienste an. Im folgenden Artikel beschreibe ich kurz wie man mit wenigen Klicks zur benutzerdefinierten Suche bei Google kommt und wie man diese auf seiner eigenen Webseite oder seinem Blog einbaut. Die Suchmaschine kann [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2008/10/personalisierte-google-suche-fuer-die-eigene-webseite/">{lang: 'de'}</g:plusone></div><p>Bereits seit einiger Zeit ist es möglich mit <a title="Start- und Suchseite von Google" href="http://www.google.com/" target="_blank"><span class="smallcaps">Google</span></a> eine benutzerdefinierte Suche anzulegen. Auch <a title="Portal- und Suchseite von Yahoo" href="http://www.yahoo.com/" target="_blank"><span class="smallcaps">Yahoo</span></a> und andere Suchmaschinenbetreiber bieten ähnliche Dienste an.<br />
Im folgenden Artikel beschreibe ich kurz wie man mit wenigen Klicks zur benutzerdefinierten Suche bei <span class="smallcaps">Google</span> kommt und wie man diese auf seiner eigenen Webseite oder seinem Blog einbaut. Die Suchmaschine kann auch per URL öffentlich zugänglich gemacht werden.</p>
<p>Aber zunächst einmal stellt sich die Frage was denn eine benutzerdefinierte Suche eigentlich genau ist? <span class="smallcaps">Google</span> bietet eine Kombination aus Suchbegriffen und Suchseiten an. Es ist also quasi möglich eine Suche, die man auch auf der normalen Seite von <span class="smallcaps">Google</span> durchführen könnte abzuspeichern. Man kann diese weiter eingrenzen durch Suchbegriffe, Webseiten die mit eingeschlossen werden sollen und mit Tags versehen. Für die eigene Webseite bietet es sich an einfach über alle Seiten auf der eigenen Webseite zu suchen. So habe ich für meine Webseite folgenden Suchstring erstellt: <span style="font-family: courier new,courier;">*.karrock.de/*</span> welcher dann die ganze Seite einbezieht, inklusive Subdomains und Unterverzeichnissen (wie bspw. der Blog).</p>
<p><span id="more-90"></span></p>
<h3>Erstellen der benutzerdefinierten Suchmaschine in vier Schritten</h3>
<ol>
<li>
<div id="attachment_96" class="wp-caption alignright" style="width: 160px"><a href="http://www.karrock.de/daf/wp-content/uploads/2008/10/nach_der_anmeldung.jpg"><img class="size-thumbnail wp-image-96" title="nach_der_anmeldung" src="http://www.karrock.de/daf/wp-content/uploads/2008/10/nach_der_anmeldung-150x150.jpg" alt="Nach der Anmeldung bei Google zum Erstellen der Suchmaschine" width="150" height="150" /></a><p class="wp-caption-text">Nach der Anmeldung bei Google zum Erstellen der Suchmaschine</p></div>
<p>Auf <a title="Benutzerdefinierte Suche bei Google" href="http://www.google.de/coop/cse/" target="_blank"><span style="font-family: courier new,courier;">http://www.google.de/coop/cse/</span></a> gelangst Du über &#8220;Erstellen einer benutzerdefinierten Suchmaschine&#8221; auf die Login-Seite. Dort musst Du dir, sofern noch nicht geschehen, registrieren. Dafür ist kein GMail-Konto oder ähnliches nötig. Es reicht auch die private E-Mail-Adresse zur Registrierung. Nach der Anmeldung landest Du auf einer art Wizard in zwei Schritten. Der erste Schritt &#8220;Richte Sie ihre Suchmaschine ein&#8221; erfasst &#8220;Allgemeine Informationen&#8221;.</li>
<li>
<div id="attachment_99" class="wp-caption alignleft" style="width: 160px"><a href="http://www.karrock.de/daf/wp-content/uploads/2008/10/meine_suchmaschinen.jpg"><img class="size-thumbnail wp-image-99" title="meine_suchmaschinen" src="http://www.karrock.de/daf/wp-content/uploads/2008/10/meine_suchmaschinen-150x117.jpg" alt="Übersicht der eigenen Suchmaschinen" width="150" height="117" /></a><p class="wp-caption-text">Übersicht der eigenen Suchmaschinen</p></div>
<p>Ist der Wizard abgeschlossen, ist die Suchmaschine erstellt. Weiter müssen zunächst keine Einstellungen vorgenommen werden. Dann kann aus der URL aus dem vorherigen Schritt der Link &#8220;Oder verwalten Sie ihre vorhandenen Suchmaschinen&#8221; ausgewählt werden. Damit gelangt man zur Übersicht seiner Suchmaschinen.</li>
<li>Dort wählt man für die entsprechende Suchmaschine den Link &#8220;Steuerungsfeld&#8221; aus. Damit kommt man zu den erweiterten Einstellungen
<div id="attachment_104" class="wp-caption alignright" style="width: 160px"><a href="http://www.karrock.de/daf/wp-content/uploads/2008/10/suche_anpassen.jpg"><img class="size-thumbnail wp-image-104" title="suche_anpassen" src="http://www.karrock.de/daf/wp-content/uploads/2008/10/suche_anpassen-150x150.jpg" alt="Google-Suche anpassen" width="150" height="150" /></a><p class="wp-caption-text">Google-Suche anpassen</p></div>
<p>der Suchmaschine. Dort lässt sich dann über &#8220;Aussehen und Verhalten&#8221; (obere Navigationsleiste) einige Farbeinstellungen und das gewünschte &#8220;Branding&#8221; (das markieren durch ein <span class="smallcaps">Google</span>-Logo) auswählen.</li>
<li>Unter &#8220;Code&#8221; kann man entsprechend wie für die eigene Webseite gewünscht dann den HTML-Code kopieren und in die eigene Webseite einfügen: Fertig!</li>
</ol>
<div id="attachment_106" class="wp-caption alignnone" style="width: 160px"><a href="http://www.karrock.de/daf/wp-content/uploads/2008/10/suchcode.jpg"><img class="size-thumbnail wp-image-106" title="suchcode" src="http://www.karrock.de/daf/wp-content/uploads/2008/10/suchcode-150x150.jpg" alt="Code-Auswahl" width="150" height="150" /></a><p class="wp-caption-text">Code-Auswahl</p></div>
<p>Das HTML-Formular mit dem Suchfeld und dem Button kann natürlich noch angepasst werden. Zum Beispiel habe ich die Beschriftung des Buttons in &#8220;los&#8221; geändert.<br />
Die Ergebnisseite der Suche kann noch soweit angepasst werden, dass ein Kopfbild eingefügt wird.<br />
Die Werbung an der rechten Seite der Ergebnisseite, darf für den privaten oder gewerblichen Gebrauch nicht entfernt werden (die entsprechende Einstellung ist in den Einstellungen bzw. bei der Erstellung der Suchmaschine auszuwählen).<br />
Das Ergebnis meiner personalisierten Suche und die Einbindung in die Webseite können auf meiner <a title="Heimseite von karrock.de" href="http://www.karrock.de/" target="_self">Heimseite</a> rechts oben betrachtet und natürlich genutzt werden. <img src='http://www.karrock.de/daf/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Es gibt auch andere Anbieter die eine benutzerdefinierte Suche anbieten &#8211; einer der größten ist wohl <span class="smallcaps">Yahoo</span>. In einem späteren Artikel werde ich mich auch mit dieser benutzerdefinierten Suche befassen und ggf. weitere Tipps geben zur Anpassung des Designs und anderen Möglichkeiten die Suchseite in sein eigenes Webseiten-Design zu integrieren.</p>
<h3>Andere Quellen über personalisierte Google-Suchmaschinen</h3>
<p><a title="schreiblogade.de über personalisierte Google-Suche" href="http://www.schreiblogade.de/2006/10/eigene-google-suchmaschine-erstellen" target="_blank">Eigene Google Suchmaschine erstellen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2008/10/personalisierte-google-suche-fuer-die-eigene-webseite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blank-Page problem with CodeIgniter framework</title>
		<link>http://www.karrock.de/daf/2008/10/blank-page-problem-with-codeigniter-framework/</link>
		<comments>http://www.karrock.de/daf/2008/10/blank-page-problem-with-codeigniter-framework/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 18:45:11 +0000</pubDate>
		<dc:creator>uk</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[web & programmierung]]></category>

		<guid isPermaLink="false">http://www.karrock.de/daf/?p=36</guid>
		<description><![CDATA[{lang: 'de'}Code Igniter is a very fast and leightweight PHP-Framework. Since I transferred my website to a other webhoster my previous installation of CI and my website does not work. I only get a blank page instead of my website content. I searched for days but I found nothing. Now after a few month (the [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 5px;"><g:plusone size="tall" count="1" href="http://www.karrock.de/daf/2008/10/blank-page-problem-with-codeigniter-framework/">{lang: 'de'}</g:plusone></div><p><a title="Code Igniter Website" href="http://codeigniter.com/" target="_self">Code Igniter</a> is a very fast and leightweight PHP-Framework.<br />
 Since I transferred my website to a other webhoster my previous installation of CI and my website does not work. I only get a blank page instead of my website content. I searched for days but I found nothing.</p>
<p><span id="more-36"></span></p>
<p>Now after a few month (the last month I had not very much time to work on this problem) I begun again to pay the problem my attention. At the first time I workedout the problem I was also searching at <a title="Code Igniter Forums" href="http://codeigniter.com/forums/" target="_self">CI Forum</a> but I found no solution &#8211; only one or two others with the same complications.<br />
 Today I took a look at the log files from my webhoster but I found nothing interesting. Afterwards I took a look at the CI log files but the last one were from July. This was weird and I checked out the config-file and see that logging was on (4 = log all).</p>
<p>And now the solution for my problem is:<br />
 if you have logging on, you also have to make sure, that the access rights for the log-directory are correct for CI (set it to 777 = all can read, write and execute).</p>
<p>After changing this my website works again properly! <img src='http://www.karrock.de/daf/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Some blank page problem threads at CI forum</h4>
<ul>
<li><a href="http://codeigniter.com/forums/viewthread/84634/" target="_self">http://codeigniter.com/forums/viewthread/84634/</a></li>
<li><a href="http://codeigniter.com/forums/viewthread/84614/" target="_self">http://codeigniter.com/forums/viewthread/84614/</a></li>
<li><a href="http://codeigniter.com/forums/viewthread/84850/" target="_self">http://codeigniter.com/forums/viewthread/84850/</a></li>
</ul>
<h4>Update 20.08.2009</h4>
<p>There are also some other reasons which can result in a blank page when calling a CI controller. I use at the moment the actual CodeIgniter Version 1.7.1 at a project and every time I have a syntax error (maybe I forgot a parenthesis or bracket) I got a white blank page instead of a result.<br />
 I don´t know till now why CI don´t view a PHP error. Maybe one reason is the environment in which I develope. But I don´t really know &#8230;</p>
<h4>Update 12.05.2010</h4>
<p>I have another solution for the blank-page-problem. If you write a PHP-Script an have a syntax error, CI maybe show a blank page. The problem is the configuration in the <span style="font-family: courier new,courier;">php.ini</span> which prevent the system from showing the syntax error. So you have to set <span style="font-family: courier new,courier;">display_errors</span> to &#8220;on&#8221;.</p>
<p>Than maybe another error can occur. If you use PHP 5.2.5 with dompdf as an CI-Plugin and have logging enabled this error message can occur:</p>
<pre>Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the
date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in
/system/libraries/Log.php on line 102
</pre>
<p>The error can also occur on line 89. To prevent the system from display this error you have to put a &#8220;@&#8221; in front of the <span style="font-family: courier new,courier;">date()</span>-Function at Line 102 and 89 in the <span style="font-family: courier new,courier;">Log.php</span>.<br />
 I only found this problem because my automatically generated PDF with the dompdf-Plugin can´t be view in the PDF-Reader. If you open the PDF-Document in a text editor you can see the message.</p>
<p>To get more information about using dompdf as an Plugin in CI see the CI-Wiki article &#8220;<a title="CodeIgniter wiki article how to use dompdf for generating PDF" href="http://codeigniter.com/wiki/PDF_generation_using_dompdf/">PDF generation using dompdf</a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karrock.de/daf/2008/10/blank-page-problem-with-codeigniter-framework/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

