<?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>4moki[dot]com</title>
	<atom:link href="http://4moki.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://4moki.com</link>
	<description>delicious Internet</description>
	<lastBuildDate>Wed, 17 Mar 2010 21:38:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jquery ajax tutorial</title>
		<link>http://4moki.com/jquery-ajax-tutorial/</link>
		<comments>http://4moki.com/jquery-ajax-tutorial/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 20:36:51 +0000</pubDate>
		<dc:creator>kirik</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://4moki.com/?p=96</guid>
		<description><![CDATA[In this article I would like to tell about technologies such as ajax.
As a rule I stick to this philosophy &#8211; better to see once than to hear 100 times, so basically will practice rather than theory.
At first I will say that ajax is just a technology for exchanging data between the client and the [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I would like to tell about technologies such as <strong>ajax</strong>.<br />
As a rule I stick to this philosophy &#8211; better to see once than to hear 100 times, so basically will practice rather than theory.</p>
<p>At first I will say that ajax is just a technology for exchanging data between the client and the server uses a programming language based on javascript.<br />
<span id="more-96"></span><br />
This technology allows the HTTP protocol asynchronous, which in turn gives us the opportunity to exchange data without reloading the page.</p>
<div id="attachment_99" class="wp-caption alignright" style="width: 310px"><a href="http://4moki.com/wp-content/uploads/2010/03/jquery-ajax-tutorial.png"><img class="size-medium wp-image-99" title="jquery-ajax-tutorial" src="http://4moki.com/wp-content/uploads/2010/03/jquery-ajax-tutorial-300x120.png" alt="Ajax tutorial" width="300" height="120" /></a><p class="wp-caption-text">Jquery ajax tutorial</p></div>
<p>In that it works this way: we take something (whether the contents of the tag h1) and pass it to the server (eg Apache) through a special object XMLhttpRequest.</p>
<p>The server processes the data (for example script in PHP) and returns the client-side result of their treatment. Further the client script (eg JS) can do anything, for example, insert a new content in the same tag H1.<br />
All told basic idea of technology is written, now proceed to its implementation.<br />
For a basis we take JS freymovrk Jquery, PHP framework Codeigniter.</p>
<p>So, we start by creating an html page, in Codeigniter they are called views. Our html page is called sample_view.php.</p>
<pre class="brush: html">
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
        &lt;title&gt;Sample ajax tutorial&lt;/title&gt;
        &lt;link href=&quot;&lt;?php echo base_url();?&gt;css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
   &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url();?&gt;js/jquery-1.4.2.js&quot;&gt;&lt;/script&gt;
   &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo base_url();?&gt;js/admin.js&quot;&gt;&lt;/script&gt;
      &lt;/head&gt;
    &lt;body&gt;
        &lt;div id=&quot;text&quot;&gt;
            &lt;h1 class=&quot;h1&quot;&gt;&lt;/h1&gt;
            &lt;h2 class=&quot;h2&quot;&gt;&lt;/h2&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Everything here is extremely simple. The main thing what to know is the fact that the code framework Jquery better connect the first among all the js scripts. Also we have created a fairly simple layout consisting of several div tags and headers.</p>
<p>Just to show you the code which displays the styles for our page, it has name as you can see style.css</p>
<pre class="brush: css">
#text{

position: relative;

margin: auto;

padding-top: 10%;

width:60%;

background-color: #eeeddd;

}

#caption{

position: absolute;

top:20px;

width: 100%;

padding-top: 2%;

text-align: center;

background-color: gray;

}

.h1{

text-align: center;

font-size: xx-large;

font-weight: bold;

font-family: Gill, Helvetica, sans-serif;

}

.h2{

text-align: right;

padding-right: 10%;

padding-top: 10%;

font-family: Gill, Helvetica, sans-serif;

}
</pre>
<p>There is nothing to us interested so you can just take and copy. After all, we are not designers)</p>
<p>Well here we are getting to the most interesting, namely the client script, the name of which I gave very angry &#8211; admin.js</p>
<pre class="brush: javascript">
$(document).ready(function(){
        setInterval(function(){

         $.ajax({
                type: &quot;POST&quot;,
                url: &quot;index.php/sample/update/&quot;,
                dataType: &quot;json&quot;,
                  beforeSend: function(){
                         $(&quot;#text&quot;).val(&#039;&#039;);
	                  $(&quot;.h1&quot;).hide();
                         $(&quot;.h2&quot;).hide();
		    }
	           success: function(mes){
  	                  $(&quot;.h1&quot;).text(mes.text);
       	           $(&quot;.h2&quot;).text(mes.author);
                         $(&quot;.h1&quot;).fadeIn(3000);
                         $(&quot;.h2&quot;).fadeIn(3000);
	                  $(&quot;.h1&quot;).fadeOut(1000);
       	           $(&quot;.h2&quot;).fadeOut(1000);
	           }
        });
},5000);
        });
</pre>
<p>I tried to make the most simple example, what would you till now in this technology.</p>
<p>Thus, our script will work as soon as the page is loaded. And it will run ajax request with an interval of 5000ms. This provides us a function setInterval. Coming attribute ajax request we indicate request type, address of the server on which the script will be executed processing data sent by us (url), the type of data returned by the server (dataType). Further there are 2 functions beforeSend and succes, first is performed before shipment, and second is performed after successful receipt of a response from the server (200 ok). Methods val, hide, text, fadeIn and fadeOut  I think speak for themselves.</p>
<p>We still have to work server side. So start with the controller, its name sample.</p>
<pre class="brush: php">
&lt;?php

class Sample extends Controller {

        function  __construct() {

		parent::Controller();
	}

	function index()
	{
		$this-&gt;load-&gt;view(&#039;sample_view&#039;);
	}
         function update()
	{
            $data = $this-&gt;sample_model-&gt;get_data();
            if(isset($data)){
                foreach ($data as $key =&gt; $list){
                $d[&#039;text&#039;] = $list[&#039;text&#039;];
                $d[&#039;id&#039;] = $list[&#039;id&#039;];
                $d[&#039;author&#039;] = $list[&#039;author&#039;];
                }
            echo json_encode($d);
            }
            else{ 

                echo &quot;false&quot;;
            }
}
}
?&gt;
</pre>
<p>Here the method index () loads our html page. And all processing of data is transferred  in the method update (). In the variable $ data, we load data from database into an array, and then through the loop forming a new one. The function of json_encode we translate our array in the type of JSON. And in the end send it back to the client side.</p>
<p>Well finally show you the code of our model, its responsibilities is to work with databases (sample_model.php)</p>
<pre class="brush: php">
	&lt;?php
class Sample_model extends Model{
    //put your code here
    function Sample_model(){
        parent::Model();
    }

    function get_data(){
            $this-&gt;db-&gt;select(&#039;*&#039;);
            $this-&gt;db-&gt;order_by(&#039;id&#039;, &#039;random&#039;);
            $this-&gt;db-&gt;limit(1);
            $query = $this-&gt;db-&gt;get(&#039;sample&#039;);
            foreach ($query-&gt;result_array() as $row) {
                $temp[$row[&#039;id&#039;]] = array(
                    &#039;id&#039; =&gt; $row[&#039;id&#039;],
                    &#039;text&#039; =&gt; $row[&#039;text&#039;],
                    &#039;author&#039; =&gt; $row[&#039;author&#039;]
                );
             }
            $query-&gt;free_result();
            return $temp;
    }
}
?&gt;
</pre>
<p>I think that all people understand easily.</p>
<pre>Source code - <a title="Jquery ajax tutorial" href="http://4moki.com/wp-content/uploads/2010/03/jquery-ajax-tutorial.rar">Jquery ajax tutorial</a></pre>
<pre>Demo(please wait 7-10 seconds when page load)- <a title="ajax sample" target="blank" href="http://lottery.4moki.com/sample/">Jquery ajax sample</a></pre>
<p>I think next time to show a more complex example and reveal more of the theory. I want to ask about what you would be interested in reading. So who are interested send questions and suggestions in the comments to this article. And if you enjoyed this article put a link to it on your personal blog or anywhere else. Thank you!</p>
<h3  class="related_post_title">Relates post</h3><ul class="related_post"><li><a href="http://4moki.com/ajax-login-with-jquery-and-codeigniter/" title="Ajax login with Jquery and Codeigniter"><img src="Array" alt="Ajax login with Jquery and Codeigniter" /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://4moki.com/jquery-ajax-tutorial/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Writing for search engine friendly TITLE</title>
		<link>http://4moki.com/writing-for-search-engine-friendly-title/</link>
		<comments>http://4moki.com/writing-for-search-engine-friendly-title/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 20:15:52 +0000</pubDate>
		<dc:creator>kirik</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://4moki.com/?p=74</guid>
		<description><![CDATA[I think those who are familiar with SEO they are well aware that a correctly formatted title is approximately 10% of success in search engine optimization. Therefore, in this article I want to show how to make more correct title for the page.
First, we define a page’s theme, for example, there is we will have [...]]]></description>
			<content:encoded><![CDATA[<p>I think those who are familiar with SEO they are well aware that a correctly formatted title is approximately 10% of success in search engine optimization. Therefore, in this article I want to show how to make more correct title for the page.</p>
<p><strong>First, we define a page’s theme</strong>, for example, there is we will have text about rent of apartments in New York on the page.</p>
<p><span id="more-74"></span></p>
<div id="attachment_75" class="wp-caption alignleft" style="width: 288px"><a href="http://4moki.com/wp-content/uploads/2010/02/22.02.png"><img class="size-full wp-image-75" title="keys" src="http://4moki.com/wp-content/uploads/2010/02/22.02.png" alt="keys" width="278" height="268" /></a><p class="wp-caption-text">Keys</p></div>
<p>Go to adwords.google.com and select the most popular searches in the topic. Enter the appropriate key words, namely: rental housing, renting.</p>
<p>Then we expose a region of the United States of America, we establish an exact match and sort by number of local requests.</p>
<p>The figure shows the keywords, a frequency is greater than 10000.</p>
<p>It is better to adhere to the following requirements for the preparation of title:</p>
<p>• Length should not exceed 11 words</p>
<p>• Total number preferably should be less than 60 characters</p>
<p>• At the beginning of Title is better to put the most high-frequencykeywords, as the maximum weight will be exactly the first phrase</p>
<p>• better to separate the keywords by comma</p>
<p><strong>Well, let’s proceed to the formation of our title.</strong></p>
<div id="attachment_76" class="wp-caption alignright" style="width: 294px"><a href="http://4moki.com/wp-content/uploads/2010/02/22.021.png"><img class="size-full wp-image-76" title="range keys" src="http://4moki.com/wp-content/uploads/2010/02/22.021.png" alt="range keys" width="284" height="284" /></a><p class="wp-caption-text">Keys</p></div>
<p>1. In the first set «apartments for rent» because it is a very steep keyword, almost all the same 700,000 queries per month.</p>
<p>2. The second place we combine «house rentals» and «house rent» into «house rent and rentals».</p>
<p>3. And then we combine «apartment for rent» and «rooms for rent» into «apartment and rooms for rent».</p>
<p>As a result, we obtain the following: apartments for rent + house rentals + apartment and rooms for rent.</p>
<p>Our title correct with punctuation marks, where needed whatever weight distributed between key words as we need.</p>
<p>In the end we get a suitable user-friendly title for search engines: Apartments for rent: house rentals, apartment and rooms for rent</p>
<p>If a page has a good text, correct titles, then you can count on a good position in SERP. Of course, this is only possible if topic of the site is not too competitive and there are a number of external links (the anchor of external links contain our promoted keywords) on this page.</p>
<p>How to create clickable description I will tell you in the next article.</p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a href="http://4moki.com/ajax-login-with-jquery-and-codeigniter/" title="Ajax login with Jquery and Codeigniter"><img src="Array" alt="Ajax login with Jquery and Codeigniter" /></a></li><li><a href="http://4moki.com/jquery-ajax-tutorial/" title="Jquery ajax tutorial"><img src="Array" alt="Jquery ajax tutorial" /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://4moki.com/writing-for-search-engine-friendly-title/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a website from scratch</title>
		<link>http://4moki.com/creating-a-website-from-scratch/</link>
		<comments>http://4moki.com/creating-a-website-from-scratch/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 22:57:04 +0000</pubDate>
		<dc:creator>kirik</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[creating website]]></category>
		<category><![CDATA[from scratch]]></category>

		<guid isPermaLink="false">http://4moki.com/?p=24</guid>
		<description><![CDATA[In this article I want to start a series of articles devoted to the creation of a site from scratch. I think this cycle will be attractive for beginner web programmers. Although it is possible for more experienced programmers improve their knowledge.

I kept thinking about what type of site we will develop, just wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I want to start a series of articles devoted to the creation of a site from scratch. I think this cycle will be attractive for beginner web programmers. Although it is possible for more experienced programmers improve their knowledge.</p>
<p><span id="more-24"></span></p>
<div id="attachment_26" class="wp-caption alignright" style="width: 160px"><a href="http://4moki.com/wp-content/uploads/2010/02/code_igniter.png"><img class="size-thumbnail wp-image-26" title="codeigniter" src="http://4moki.com/wp-content/uploads/2010/02/code_igniter-150x150.png" alt="PHP framework - codeiginter" width="150" height="150" /></a><p class="wp-caption-text">Codeigniter</p></div>
<p>I kept thinking about what type of site we will develop, just wanted to make a good serious project, but not hello world, because the Internet beaten this kind of materials. I thought and decided that we would be doing online lottery.</p>
<p>Yes exactly, you heard right it was a lottery with news, articles, user registration, payment, etc. So all of whom will be interested to read about it, welcome on my blog.  If you have friends that it might be interesting &#8211; share with them the address of my blog. Just wanted to describe what tools we use to develop a web site.</p>
<p>Well, first &#8211; we will write on the php the choice fell on it because now it was the most widely spread in the Internet. But we will not write on the bare php, we will use the php framework codeigniter. It is quite easy to learn and understand the framework.</p>
<div id="attachment_32" class="wp-caption alignleft" style="width: 160px"><a href="http://4moki.com/wp-content/uploads/2010/02/jqeury.png"><img class="size-thumbnail wp-image-32" title="jQuery" src="http://4moki.com/wp-content/uploads/2010/02/jqeury-150x150.png" alt="jQuery" width="150" height="150" /></a><p class="wp-caption-text">jQuery</p></div>
<p>For the client side we will use the javascript framework Jquery. In my opinion now it is the standard for speed of execution, cross-browser and very easy in use.</p>
<p>As the database we will use the MYSQL. Even may not ask me why MYSQL. Almost I didn’t work with others.</p>
<div id="attachment_38" class="wp-caption alignright" style="width: 160px"><a href="http://4moki.com/wp-content/uploads/2010/02/bug.png"><img class="size-thumbnail wp-image-38" title="Firebug" src="http://4moki.com/wp-content/uploads/2010/02/bug-150x150.png" alt="Firebug" width="150" height="150" /></a><p class="wp-caption-text">Firebug</p></div>
<p>Of course we will use xHTML and CSS &#8211; how do without them.</p>
<p>Since we will work on their local machine, then we need a web server.  I will use Apache in my examples. In general, for ease of setup, we will use the assembly called XAMPP.</p>
<p>I chose the Netbeans as a development environment. It is a very comfortable, good and most importantly free development environment.</p>
<p>Of course we need the browser, how do without it) I&#8217;m using Firefox. Just Firefox has a plugin indispensable for the development as firebug and its supplement firephp. On that basis a debugging of the application will be just a fairy tale.</p>
<p>Well, here&#8217;s all for today. In the next article we will start with setting up all equipment.</p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a href="http://4moki.com/writing-for-search-engine-friendly-title/" title="Writing for search engine friendly TITLE"><img src="Array" alt="Writing for search engine friendly TITLE" /></a></li><li><a href="http://4moki.com/ajax-login-with-jquery-and-codeigniter/" title="Ajax login with Jquery and Codeigniter"><img src="Array" alt="Ajax login with Jquery and Codeigniter" /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://4moki.com/creating-a-website-from-scratch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ajax login with Jquery and Codeigniter</title>
		<link>http://4moki.com/ajax-login-with-jquery-and-codeigniter/</link>
		<comments>http://4moki.com/ajax-login-with-jquery-and-codeigniter/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 21:34:10 +0000</pubDate>
		<dc:creator>kirik</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://4moki.com/?p=11</guid>
		<description><![CDATA[Today we will consider creating of authorization on a site by means of Jquery and Condeigniter. Course for our problem Jquery, Jquery UI, and Codeigniter will be required us. I will not to consider their installing in this article, thanks to the Internet there is a lot of similar manuals.

Let’s begin with consideration of the [...]]]></description>
			<content:encoded><![CDATA[<p>Today we will consider creating of authorization on a site by means of Jquery and Condeigniter. Course for our problem Jquery, Jquery UI, and Codeigniter will be required us. I will not to consider their installing in this article, thanks to the Internet there is a lot of similar manuals.</p>
<p><span id="more-11"></span></p>
<p>Let’s begin with consideration of the template file (view)</p>
<pre class="brush: html">
#dialog { font-size: 70%; }

label, input { display:block; }

input.text { margin-bottom:12px; width:95%; padding: .4em; }

fieldset { padding:0; border:0; margin-top:25px; }

h1 { font-size: 1.2em; margin: .6em 0; }

.ui-button { outline: 0; margin:0; padding: .4em 1em .5em; text-decoration:none;  !important; cursor:pointer; position: relative; text-align: center; }

.ui-dialog .ui-state-highlight, .ui-dialog .ui-state-error { padding: .3em;  }

--&gt;
&lt;div id=&quot;user&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;dialog&quot; title=&quot;Create new user&quot;&gt;
&lt;p id=&quot;validateTips&quot;&gt;All form fields are required.&lt;/p&gt;

&lt;form&gt;
&lt;fieldset&gt;&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;

&lt;input id=&quot;email&quot; class=&quot;text ui-widget-content ui-corner-all&quot; name=&quot;email&quot; type=&quot;text&quot; /&gt;

&lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;

&lt;input id=&quot;password&quot; class=&quot;text ui-widget-content ui-corner-all&quot; name=&quot;password&quot; type=&quot;password&quot; /&gt;&lt;/fieldset&gt;
&lt;/form&gt;&lt;/div&gt;
</pre>
<p>Here in the beginning we do a reference which will allude to the method login of controller main. Then a css code follows with a description of how it should looks like the window itself. The following description of fields that will contain the authorization form.</p>
<p>Let’s describe our model users_model.</p>
<pre class="brush: php">
class Users_model extends Model {

function Users_model() {

parent::Model();

}

function login($mail,$passw) {

$this-&gt;db-&gt;where(&#039;mail&#039;,$mail);

$this-&gt;db-&gt;where(&#039;passw&#039;,$passw);

$query = $this-&gt;db-&gt;get(&#039;users&#039;);

if($query-&gt;num_rows == 1){

return true;

}

}

}
</pre>
<p>In it I will show you a method of login, which actually receives data over a controller and then makes to request to our database. And in the case of successful finding row from the table returns a true (true).</p>
<p>Further we pass to our controller main.</p>
<p>In it we are interested in the method of login, which will take information over the user and then transmit them to the models, listen to the answer. Depending on the correctness of input of email and password is to save in session of user data  or to report about error.</p>
<pre class="brush: php">
function login(){

$query = $this-&gt;users_model-&gt;login($_POST[&#039;email&#039;],$_POST[&#039;password&#039;]);

if ($query){

$data = array (

&#039;username&#039; =&gt; $_POST[&#039;email&#039;],

&#039;is_log&#039; =&gt; true

);

$this-&gt;session-&gt;set_userdata($data);

$answ = true;

}

else{

$answ = false;

}

echo $answ;

}
</pre>
<p>And in conclusion we consider the actual JavaScript code itself.</p>
<pre class="brush: javascript">
$(document).ready(function(){

var

email = $(&quot;#email&quot;),

password = $(&quot;#password&quot;),

allFields = $([]).add(email).add(password),

tips = $(&quot;#validateTips&quot;);

function updateTips(t) {

tips.text(t).effect(&quot;highlight&quot;,{},2000);

}

function checkLength(o,n,min,max) {

if ( o.val().length &gt; max || o.val().length &lt; min ) {

o.addClass(&#039;ui-state-error&#039;);

updateTips(&quot;Length of &quot; + n + &quot; must be between &quot;+min+&quot; and &quot;+max+&quot;.&quot;);

return false;

} else {

return true;

}

}

function checkRegexp(o,regexp,n) {

if ( !( regexp.test( o.val() ) ) ) {

o.addClass(&#039;ui-state-error&#039;);

updateTips(n);

return false;

} else {

return true;

}

}

function checkLogin(e,p) {

$.ajax({type:&quot;POST&quot;,

url:&#039;http://localhost/lottery/index.php/main/login/&#039;,

data:&quot;email=&quot; + e.val() +&quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;password=&quot; + p.val(),

dataType:&quot;text&quot;,

cashe:false,

success:function(msg){

if(!msg){

e.addClass(&#039;ui-state-error&#039;);

p.addClass(&#039;ui-state-error&#039;);

updateTips(&quot;Login or password is incorrect&quot;);

}

else {

updateTips(&quot;Logining...&quot;);

allFields.val(&#039;&#039;).removeClass(&#039;ui-state-error&#039;);

window.location = &quot;http://localhost/lottery/index.php/admin/&quot;;

}

}

})

}

$(&quot;#dialog&quot;).dialog({

bgiframe: true,

autoOpen: false,

height: &#039;auto&#039;,

width : 320,

modal: true,

buttons: {

&#039;Login&#039;: function() {

var bValid = true;

allFields.removeClass(&#039;ui-state-error&#039;);

bValid = bValid &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; checkLength(email,&quot;email&quot;,6,80);

bValid = bValid &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; checkLength(password,&quot;password&quot;,5,16);

bValid = bValid &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; checkRegexp(email,/^((([a-z]|\d|[!#\$%&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&#039;\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&#039;\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,&quot;eg. ui@jquery.com&quot;);

bValid = bValid &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; checkRegexp(password,/^([0-9a-zA-Z])+$/,&quot;Password field only allow : a-z 0-9&quot;);

if (bValid){

checkLogin(email,password);

}

},

&#039;Cancel&#039;: function() {

$(this).dialog(&#039;close&#039;);

}

},

close: function() {

allFields.val(&#039;&#039;).removeClass(&#039;ui-state-error&#039;);

}

});

$(&#039;#login&#039;).click(function(e) {

e.preventDefault();

$(&#039;#dialog&#039;).dialog(&#039;open&#039;);

})

});
</pre>
<div id="attachment_53" class="wp-caption alignleft" style="width: 160px"><a href="http://4moki.com/wp-content/uploads/2010/01/ajax_login.png"><img class="size-thumbnail wp-image-53" title="ajax login" src="http://4moki.com/wp-content/uploads/2010/01/ajax_login-150x150.png" alt="Ajax login" width="150" height="150" /></a><p class="wp-caption-text">Ajax login</p></div>
<p>The function of updateTips renews the state of informative panel. The function of checkLength checks made email and password on the line for desired length. The function of checkRegexp checks for accordance of the entered information regular expression. The function of checkLogin actually implements the technology of Ajax. Options on the input and the values entered password and email. Then data is sent by the method of POST to our controller of main. Then in the method of success we describe a function which takes an answer over a controller. In the case of success it does redirect on the protected page of site, otherwise a message.</p>
<p>I forgot to mention that for correct work should also put css styles being in the catalogue of Jquery , where your styles are located.</p>
<p>That would be like to complete the description of the solution of the problem.  If you have any questions about using Jquery, Jquery UI and Codeigniter ask them in the comments. I will try to answer them.</p>
<pre>At the request of Farhad spread source code example - <a title="ajax login" href="http://4moki.com/wp-content/uploads/2010/02/ajax_login.rar">Ajax login with Jquery and Codeigniter</a></pre>
<h3  class="related_post_title">Relates post</h3><ul class="related_post"><li><a href="http://4moki.com/jquery-ajax-tutorial/" title="Jquery ajax tutorial"><img src="Array" alt="Jquery ajax tutorial" /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://4moki.com/ajax-login-with-jquery-and-codeigniter/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
