<?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>Irtaza Tech Blog</title>
	<atom:link href="http://www.irtaza.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.irtaza.com</link>
	<description>Web Hosting &#124; Scripting &#124; Web Design</description>
	<lastBuildDate>Thu, 17 May 2012 13:12:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Validate Date for Mysql Submission</title>
		<link>http://www.irtaza.com/scripting/php/validate-date-for-mysql-submission/</link>
		<comments>http://www.irtaza.com/scripting/php/validate-date-for-mysql-submission/#comments</comments>
		<pubDate>Thu, 17 May 2012 13:11:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=185</guid>
		<description><![CDATA[First use the this function to validate the date what we will be getting after hitting post.
Then prepare the date for Mysql data insertion 
]]></description>
			<content:encoded><![CDATA[<p>First use the this function to validate the date what we will be getting after hitting post.</p>
<pre class="brush: plain; title: ; notranslate">
function _date_is_valid($str) {

    if (substr_count($str, '-') == 2) {

       list($y, $m, $d) = explode('-', $str);

       if(checkdate($m, $d,sprintf('%04u', $y))){

		   return true;
		   }else{
			   return false;

}}

    return false;
}
</pre>
<p>Then prepare the date for Mysql data insertion </p>
<pre class="brush: plain; title: ; notranslate">
$date = date('Y-m-d', strtotime(str_replace('-', '/', $_POST['date'])));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/php/validate-date-for-mysql-submission/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate email address with a valid domain name MX record</title>
		<link>http://www.irtaza.com/scripting/php/validate-email-address-with-a-valid-domain-name-mx-record/</link>
		<comments>http://www.irtaza.com/scripting/php/validate-email-address-with-a-valid-domain-name-mx-record/#comments</comments>
		<pubDate>Thu, 17 May 2012 12:19:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[email validation]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=183</guid>
		<description><![CDATA[The following function in php will help validate the email address with valid domain name MX record 
to use this function you can do the following
]]></description>
			<content:encoded><![CDATA[<p>The following function in php will help validate the email address with valid domain name MX record <span id="more-183"></span></p>
<pre class="brush: plain; title: ; notranslate">
function checkEmail($email) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {

  list($username,$domain)=explode('@',$email);
  if(!checkdnsrr($domain,'MX')) {

   return false;
  }
  return true;
 }
 return false;
}</pre>
<p>to use this function you can do the following</p>
<pre class="brush: plain; title: ; notranslate">
if(!checkEmail($email)) { return false; echo &quot;Not a valid email address&quot;;}else{ return true; echo &quot;A valid email address&quot;;}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/php/validate-email-address-with-a-valid-domain-name-mx-record/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOs mysql must know commands in command-line interface</title>
		<link>http://www.irtaza.com/servers/linux/centos/centos-mysql-must-know-commands-in-command-line-interface/</link>
		<comments>http://www.irtaza.com/servers/linux/centos/centos-mysql-must-know-commands-in-command-line-interface/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 09:23:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOs]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=181</guid>
		<description><![CDATA[When working on mysql command line interface it can be hectic due to the fact that some of the syntax that might work in normal php code or phpmyadmin might not work in CentOS. The fact is that syntax is the same but just have to add some extra spicies to it
Users and DBA’s (Database [...]]]></description>
			<content:encoded><![CDATA[<p>When working on mysql command line interface it can be hectic due to the fact that some of the syntax that might work in normal php code or phpmyadmin might not work in CentOS. The fact is that syntax is the same but just have to add some extra spicies to it</p>
<p><span id="more-181"></span><span style="text-decoration: underline;"><strong>Users and DBA’s (Database Admins) create, delete, manipulate:</strong></span></p>
<p><strong>Show all users in the mysql database:</strong><br />
mysql&gt; SELECT * FROM mysql.user;</p>
<p><strong>Delete a null user:</strong><br />
mysql&gt; DELETE FROM mysql.user WHERE user = &#8216; &#8216;;</p>
<p><strong>Delete all users who are not root:</strong><br />
mysql&gt; DELETE FROM mysql.user WHERE NOT (host=&#8221;localhost&#8221; AND user=&#8221;root&#8221;);</p>
<p><strong>Change root user to a less-guessable name (for security):</strong><br />
mysql&gt; UPDATE mysql.user SET user=&#8221;mydbadmin&#8221; WHERE user=&#8221;root&#8221;;</p>
<p><strong>Create a new DBA:</strong><br />
mysql&gt; GRANT ALL PRIVILEGES ON *.* TO &#8216;username&#8217;@'localhost&#8217; IDENTIFIED BY &#8216;mypass&#8217; WITH GRANT OPTION;</p>
<p><strong>Add a new user with specific privileges on a specific database:</strong><br />
mysql&gt; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON mydatabase.* TO &#8216;username&#8217;@'localhost&#8217; IDENTIFIED BY &#8216;mypass&#8217;;<br />
<strong><br />
Add a new DBA with all privileges to a specific database:</strong><br />
mysql&gt; GRANT ALL PRIVILEGES ON mydatabase.* TO &#8216;username&#8217;@'localhost&#8217; IDENTIFIED BY &#8216;mypass&#8217; WITH GRANT OPTION;</p>
<p><strong>Change a user or DBA password:</strong><br />
mysql&gt; UPDATE mysql.user SET password=oldpass(&#8220;newpass&#8221;) WHERE User=&#8217;username&#8217;;<br />
<strong><br />
Delete a user or DBA from the database:</strong><br />
mysql&gt; DELETE FROM mysql.user WHERE user=&#8221;username&#8221;;</p>
<p><span style="text-decoration: underline;"><strong>Simple database manipulation:</strong></span></p>
<p><strong>Show all databases:</strong><br />
mysql&gt; SHOW DATABASES;</p>
<p><strong>Create a database:</strong><br />
mysql&gt; CREATE DATABASE mydatabase;</p>
<p><strong>Use a specific database:</strong><br />
mysql&gt; USE mydatabase;</p>
<p><strong>Delete a database:</strong><br />
mysql&gt; DROP DATABASE mydatabase;</p>
<p>Rename a database from command line (not from within MySQL), there is purposely no space beween -p and mypass:</p>
<p>mysqldump -u dbauser -pmypass databasename &gt; mybackup.sql</p>
<p>mysql -u dbauser -pmypass newdatabasename &lt; mybackup.sql</p>
<p>Show the last 200 queries to your database with the sample table name &#8220;queries&#8221; and the sample field &#8220;query_id&#8221;:</p>
<p>mysql&gt; SELECT * FROM queries ORDER BY query_id DESC LIMIT 200;<span style="text-decoration: underline;"><strong> </strong></span></p>
<p><span style="text-decoration: underline;"><strong>Simple table manipulation:</strong></span></p>
<p><strong>Show all tables within a previously selected database </strong><br />
mysql&gt; SHOW TABLES;</p>
<p><strong>Show data within a specific table in a previously selected database:</strong><br />
mysql&gt; SELECT * FROM tablename;</p>
<p><strong>Rename a table within a specific database:</strong><br />
mysql&gt; RENAME TABLE first TO second;<br />
or<br />
mysql&gt; ALTER TABLE mytable rename as mynewtable;</p>
<p><strong>Drop a table from a specific database:</strong><br />
mysql&gt; DROP TABLE mytable;</p>
<p><strong>Simple column and field manipulation:</strong></p>
<p>Show columns within a table:<br />
mysql&gt; DESC mytable;<br />
or<br />
mysql&gt; SHOW COLUMNS FROM mytable;</p>
<p><strong>Update a field within a previously selected database table:</strong><br />
mysql&gt; UPDATE mytable SET mycolumn=&#8221;newinfo&#8221; WHERE mycolumn=&#8221;oldinfo&#8221;;</p>
<p><strong>Select data within a specific table in a previously selected database:</strong><br />
mysql&gt; SELECT * FROM mytable WHERE mycolumn=&#8217;mydata&#8217; ORDER BY mycolumn2;<br />
<strong><br />
Insert data into a table and its columns within a specific database:</strong><br />
mysql&gt; INSERT INTO mytable VALUES(&#8216;column1data&#8217;,'column2data&#8217;,'column3data&#8217;,'column4data&#8217;,'column5data&#8217;,'column6data&#8217;,'column7data&#8217;,'column8data&#8217;,'column9data&#8217;);</p>
<p><strong>Delete data from specific fields within a column:</strong><br />
mysql&gt; DELETE FROM mytable WHERE mycolumn=&#8221;mydata&#8221;;<br />
<strong><br />
Update data in a specific table, column, field:</strong><br />
mysql&gt; UPDATE mytable SET column1=&#8221;mydata&#8221; WHERE column2=&#8221;mydata&#8221;;</p>
<p><span style="text-decoration: underline;"><strong>Simple backup options:</strong></span></p>
<p><strong>Backup all databases uncompressed from the command line (not from within MySQL):</strong><br />
backup: mysqldump -u root -pmypass &#8211;all-databases &gt; alldatabases.sql</p>
<p>restore full: mysql -u username -pmypass &lt; alldatabases.sql (no space in between -p and mypass)</p>
<p>restore single: mysql -u username -pmypass mydb &lt; mydb.sql (no space in between -p and mypass)</p>
<p><strong>Backup all databases compressed from the command line (not from within MySQL):</strong><br />
With bzip2: mysqldump &#8211;all-databases | bzip2 -c &gt; databasebackup.sql.bz2 (use bunzip2 to uncompress)</p>
<p>With gzip: mysqldump &#8211;all-databases | gzip &gt; databasebackup.sql.gz (use gunzip to uncompress)</p>
<p><strong>Mini script to backup all databases and tables using gzip:</strong><br />
#!/bin/sh<br />
date=`date -I`<br />
mysqldump &#8211;all-databases | gzip &gt; /var/backup/dbbackup-$date.sql.gz</p>
<p><strong>Backup a specific database only:</strong><br />
mysqldump -u username -pmypass databasename &gt; backupfile.sql<br />
<strong><br />
Backup database structure only:</strong><br />
mysqldump &#8211;no-data &#8211;databases databasename &gt; structurebackup.sql</p>
<p><strong>Backup a specific database and specific tables within that database only:</strong><br />
mysqldump &#8211;add-drop-table -u username -pmypass databasename table_1 table_2 &gt; databasebackup.sql</p>
<p><strong>The syntax for the command to issue is:</strong><br />
mysqldump -u [username] -p[password] [databasename] [table1 table2 ....] &gt; backupfilename.sql</p>
<p>Backing up only the database structure of specific databases, not the actual data:<br />
mysqldump &#8211;no-data &#8211;databases db1 db2 db3 &gt; structurebackup.sql<br />
<span style="text-decoration: underline;"><br />
<strong>Improve local and remote access security:</strong></span></p>
<p>Disable the use of LOAD DATA LOCAL INFILE command, which will help to prevent against unauthorized reading from local files. This matters especially when new SQL Injection vulnerabilities in PHP applications are found. This can be set to 1 temporarily for a local admin to import a csv file into the database and then turned off again as well. The mysqld service will need to be restarted after each change.</p>
<p>For that purpose, the following parameter should be added in the [mysqld] section in /etc/my.cnf:</p>
<p>set-variable=local-infile=0</p>
<p>_____________________</p>
<p>The first change applies to the 3306/tcp port, on which MySQL listens by default. Because, according to the initial assumptions, the database will be used only by locally installed PHP applications, we can freely disable listening on that port. This will limit possibilities of attacking the MySQL database by direct TCP/IP connections from other hosts. Local communication will be still possible throw the mysql.sock socket.</p>
<p>In order to disable listening on the mentioned port, the following parameter should be added to the [mysqld] section of /etc/my.cnf:</p>
<p>skip-networking</p>
<p>SSH Tunneling can be used for remote backup scripts which require access to the machine.</p>
<p><span style="text-decoration: underline;"><strong><br />
</strong></span></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 497px; width: 1px; height: 1px; overflow: hidden;">
<pre class="TerminalCommand"><strong>Show all databases:</strong>
mysql&gt; SHOW DATABASES;

<strong>Create a database:</strong>
mysql&gt; CREATE DATABASE mydatabase;

<strong>Use a specific database:</strong>
mysql&gt; USE mydatabase;

<strong>Delete a database:</strong>
mysql&gt; DROP DATABASE mydatabase;

<strong>Rename a database from command line (not from within MySQL), there is purposely no space beween -p and mypass:</strong>

<span class="txtplain1"><span style="font-family: courier new,courier,mono;">mysqldump -u dbauser -pmypass databasename &gt; mybackup.sql</span></span>

<span class="txtplain1"><span style="font-family: courier new,courier,mono;">mysql -u dbauser -pmypass newdatabasename &lt; mybackup.sql</span></span>

<strong>Show the last 200 queries to your database with the sample table name "queries" and the sample field "query_id":</strong>

mysql&gt; SELECT * FROM queries ORDER BY query_id DESC LIMIT 200;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/servers/linux/centos/centos-mysql-must-know-commands-in-command-line-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install MySql on Centos</title>
		<link>http://www.irtaza.com/servers/linux/centos/install-mysql-on-centos/</link>
		<comments>http://www.irtaza.com/servers/linux/centos/install-mysql-on-centos/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 08:31:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOs]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=178</guid>
		<description><![CDATA[Installing mysql can be a bit pain when there are problems in setting up remote access or changing passwords. But it can be easily managed if all the steps are done correctly

Installing Repo
cd /etc/yum.repos.d
wget http://rpms.famillecollet.com/enterprise/remi.repo
Installing Mysql
yum &#8211;enablerepo=remi install mysql mysql-server mysql-devel php-mysql
 Configuring Mysql
 Set the MySQL service to start on boot
chkconfig &#8211;levels 235 mysqld [...]]]></description>
			<content:encoded><![CDATA[<p>Installing mysql can be a bit pain when there are problems in setting up remote access or changing passwords. But it can be easily managed if all the steps are done correctly</p>
<p><span id="more-178"></span></p>
<p><strong>Installing Repo</strong></p>
<p><strong>cd /etc/yum.repos.d<br />
wget <a href="http://rpms.famillecollet.com/enterprise/remi.repo">http://rpms.famillecollet.com/enterprise/remi.repo</a></strong></p>
<p><strong><a href="http://rpms.famillecollet.com/enterprise/remi.repo"></a>Installing Mysql</strong></p>
<p><strong>yum &#8211;enablerepo=remi install mysql mysql-server mysql-devel php-mysql</strong></p>
<p><strong> Configuring Mysql</strong></p>
<p><strong> </strong>Set the MySQL service to start on boot<br />
<span style="font-weight: bold;">chkconfig &#8211;levels 235 mysqld on</span></p>
<p>Start the MySQL service<br />
<span style="font-weight: bold;">service mysqld start</span></p>
<p><span style="font-weight: bold;"><br />
</span>Log into MySQL<br />
<span style="font-weight: bold;">mysql -u root<br />
</span><span style="font-weight: bold;">Set the root user password for all local domains<br />
</span><span style="font-weight: bold;">SET PASSWORD FOR &#8216;root&#8217;@'localhost&#8217; = PASSWORD(&#8216;</span><em>new-password</em><span style="font-weight: bold;">&#8216;);<br />
</span><span style="font-weight: bold;">SET PASSWORD FOR &#8216;root&#8217;@'localhost.localdomain&#8217; = PASSWORD(&#8216;</span><em>new-password</em><span style="font-weight: bold;">&#8216;);<br />
</span><span style="font-weight: bold;">SET PASSWORD FOR &#8216;root&#8217;@'127.0.0.1&#8242; = PASSWORD(&#8216;</span><em>new-password</em><span style="font-weight: bold;">&#8216;);|<br />
</span><span style="font-weight: bold;"> </span></p>
<p><span style="font-weight: bold;">Setting up remote access to database</span><br />
<strong> SET host FOR &#8216;root&#8217;@'localhost&#8217; = &#8216;%&#8217;;</strong></p>
<p>Drop the Any user<br />
<span style="font-weight: bold;">DROP USER &#8221;@&#8217;localhost&#8217;;<br />
</span><span style="font-weight: bold;">DROP USER &#8221;@&#8217;localhost.localdomain&#8217;;<br />
</span><span style="font-weight: bold;"><br />
Exit MySQL<br />
</span><span style="font-weight: bold;">exit</span></p>
<p><strong><br />
</strong></p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/servers/linux/centos/install-mysql-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lytebox not working after AJAX content change load with jquery</title>
		<link>http://www.irtaza.com/scripting/javascript/lytebox-not-working-after-ajax-content-change-load-with-jquery/</link>
		<comments>http://www.irtaza.com/scripting/javascript/lytebox-not-working-after-ajax-content-change-load-with-jquery/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 06:29:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[lytebox]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=175</guid>
		<description><![CDATA[if you are having problem loading lytebox when loading content with using ajax with jquery e.g.


The main problem was that Lytebox gets initialized during page load. Since AJAX bypasses page load, the problem arises.
The Lytebox run by this function initLytebox(); so we just need to call this functions when our ajax parsed data properly.
]]></description>
			<content:encoded><![CDATA[<p>if you are having problem loading lytebox when loading content with using ajax with jquery e.g.<br />
<span id="more-175"></span></p>
<pre class="brush: plain; title: ; notranslate">$(&quot;#insidebox&quot;).load(&quot;ajax.php?cat=&quot;+cat+&quot;&amp;amp;cache=&quot; + Math.random()*99999);</pre>
<p>
The main problem was that Lytebox gets initialized during page load. Since AJAX bypasses page load, the problem arises.</p>
<p>The Lytebox run by this function <strong>initLytebox();</strong> so we just need to call this functions when our ajax parsed data properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/javascript/lytebox-not-working-after-ajax-content-change-load-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting to mobile website through javascript</title>
		<link>http://www.irtaza.com/scripting/javascript/redirecting-to-mobile-website-through-javascript/</link>
		<comments>http://www.irtaza.com/scripting/javascript/redirecting-to-mobile-website-through-javascript/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 06:36:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=171</guid>
		<description><![CDATA[A small javascript snippet can help you redirect all your mobile traffic to its specific url.
]]></description>
			<content:encoded><![CDATA[<p>A small javascript snippet can help you redirect all your mobile traffic to its specific url.<span id="more-171"></span></p>
<pre class="brush: plain; title: ; notranslate">  &lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[  

	if (screen.width &lt;  800) {document.location = &quot;small/index.html&quot;;} 

// ]]&gt;&lt;/script&gt;    </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/javascript/redirecting-to-mobile-website-through-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Posting values through AJAX using jquery and getting a dynamic validation response without refreshing the page</title>
		<link>http://www.irtaza.com/scripting/php/posting-values-through-ajax-using-jquery-and-getting-a-dynamic-validation-response-without-refreshing-the-page/</link>
		<comments>http://www.irtaza.com/scripting/php/posting-values-through-ajax-using-jquery-and-getting-a-dynamic-validation-response-without-refreshing-the-page/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 07:27:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=156</guid>
		<description><![CDATA[It is now very simple to post values through AJAX using jquery for doing so we will use the following Jquery code
Step 1
&#8212;&#8212;&#8212;
Load Jquery
You can put this in the  tag
Step 2
&#8212;&#8212;&#8211;
Create a html form

 &#60;div class=&#34;left-sub&#34;&#62;Name: &#60;/div&#62;&#60;div class=&#34;left-sub&#34;&#62;&#60;input size=&#34;30&#34; name=&#34;name&#34; maxlength=&#34;45&#34; type=&#34;text&#34; id=&#34;name&#34;&#62;&#60;/div&#62; 

 &#60;div class=&#34;left-sub&#34;&#62;Company: &#60;/div&#62;&#60;div class=&#34;left-sub&#34;&#62;&#60;input size=&#34;30&#34; name=&#34;company&#34; maxlength=&#34;45&#34; type=&#34;text&#34; id=&#34;company&#34;&#62;&#60;/div&#62; 

 [...]]]></description>
			<content:encoded><![CDATA[<p>It is now very simple to post values through AJAX using jquery for doing so we will use the following Jquery code<span id="more-156"></span></p>
<p>Step 1<br />
&#8212;&#8212;&#8212;<br />
Load Jquery</p>
<pre class="brush: plain; title: ; notranslate">&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;	</pre>
<p>You can put this in the <head> tag</p>
<p>Step 2<br />
&#8212;&#8212;&#8211;<br />
Create a html form</p>
<pre class="brush: xml; title: ; notranslate">
 &lt;div class=&quot;left-sub&quot;&gt;Name: &lt;/div&gt;&lt;div class=&quot;left-sub&quot;&gt;&lt;input size=&quot;30&quot; name=&quot;name&quot; maxlength=&quot;45&quot; type=&quot;text&quot; id=&quot;name&quot;&gt;&lt;/div&gt; 

 &lt;div class=&quot;left-sub&quot;&gt;Company: &lt;/div&gt;&lt;div class=&quot;left-sub&quot;&gt;&lt;input size=&quot;30&quot; name=&quot;company&quot; maxlength=&quot;45&quot; type=&quot;text&quot; id=&quot;company&quot;&gt;&lt;/div&gt; 

 &lt;div class=&quot;left-sub&quot;&gt;Email: &lt;/div&gt;&lt;div class=&quot;left-sub&quot;&gt;&lt;input size=&quot;30&quot; name=&quot;email&quot; maxlength=&quot;45&quot; type=&quot;text&quot; id=&quot;email&quot;&gt;&lt;/div&gt;

 &lt;div class=&quot;left-sub&quot;&gt;&lt;/div&gt; &lt;div class=&quot;left-sub&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;click to subscribe&quot; class=&quot;myButton2&quot; name=&quot;news&quot; id=&quot;news&quot; onclick=&quot;subscribe();&quot;&gt;&lt;/div&gt;
</pre>
<p>you can notice there is a subscribe() function on the submit button which will execute the javascript function where we will have all the Jquery code</p>
<p>Step 3<br />
&#8212;&#8212;&#8212;-<br />
Creating Jquery Code</p>
<pre class="brush: jscript; title: ; notranslate">
function subscribe(){
		 var name = $(&quot;#name&quot;).val(); // get values from the name field
		  var email = $(&quot;#email&quot;).val();
		   var company = $(&quot;#company&quot;).val();

        if(name=='') // validates the name if empty
	{
    	alert(&quot;Please enter name!&quot;);   // displays alert if empty

    }else if(email==''){alert(&quot;Please enter email!&quot;);}else if(company==''){alert(&quot;Please enter company!&quot;);}

	else{
        $.ajax({
			type: &quot;POST&quot;,
			url: &quot;index.php&quot;,
			data: {

				name : $('#name').val(), company : $('#company').val(), email : $('#email').val(), news : $('#news').val() // This is the data that will be posting in this format you can retreive this data by using $_POST['name'] and so on in php.
			},
            cache: false,
success: function(response){
//alert($(response).find(&quot;#responsemessage&quot;).text());
$('#responsemessage').html($(response).find(&quot;#responsemessage&quot;).html()); //You can create a div with id responsemessage and echo the error message in that and this code will display that error or success

}
		});

		}
		}
</pre>
<p>to understand the code above read the comments next to the line of code</p>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/php/posting-values-through-ajax-using-jquery-and-getting-a-dynamic-validation-response-without-refreshing-the-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Points to remember when making newsletter compatible with gmail, outlook, yahoo and live.com</title>
		<link>http://www.irtaza.com/scripting/points-to-remember-when-making-newsletter-compatible-with-gmail-outlook-yahoo-and-live-com/</link>
		<comments>http://www.irtaza.com/scripting/points-to-remember-when-making-newsletter-compatible-with-gmail-outlook-yahoo-and-live-com/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 12:20:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Html]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[newsletter]]></category>
		<category><![CDATA[outlook]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=150</guid>
		<description><![CDATA[Creating a newsletter compatible with all the major email providers or email clients is a hectic job especially if all of them support different html codes. We have to create newsletters which very old html coding techniques which are as follows:
1) Make sure you remove the html and head tags.
2) Make sure to use tables [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a newsletter compatible with all the major email providers or email clients is a hectic job especially if all of them support different html codes. We have to create newsletters which very old html coding techniques which are as follows:<span id="more-150"></span></p>
<p>1) Make sure you remove the html and head tags.</p>
<p>2) Make sure to use tables instead of divs</p>
<p>3) You can only use inline style sheet </p>
<pre class="brush: plain; title: ; notranslate">e.g. &lt;td style=&quot;color:red&quot;&gt;&lt;/td&gt;.</pre>
<p>4) All TABLE and TD tags should should have a fixed height and width. </p>
<pre class="brush: plain; title: ; notranslate">e.g. &lt;td height=&quot;200&quot; width=&quot;100&quot;&gt;&lt;/td&gt;</pre>
<p>5) If you are using images inside the <TD> make sure in the style to make inline-height:0 </p>
<pre class="brush: plain; title: ; notranslate">e.g.&lt;td style=&quot; inline-height:0px&quot;&gt;</pre>
<p>6) To align or set font colors or styles text or even images inside the <TD> i would prefer to use <P> tag with inline style sheet</p>
<pre class="brush: plain; title: ; notranslate">e.g.&lt;p style=&quot;margin-left:23px&quot;&gt;text will come here&lt;/p&gt;</pre>
<p>7) If you still see spacing under the images try using float:left and display:block in side the image tag </p>
<pre class="brush: plain; title: ; notranslate">e.g.&lt;img src=&quot;img.jpg&quot; style=&quot;float:left; display:block&quot;&gt;</pre>
<p> <img src='http://www.irtaza.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> You cannot use background images only background colors</p>
<p>9) To align the whole newsletter to the center use the code below </p>
<pre class="brush: plain; title: ; notranslate"> &lt;table width=&quot;100%&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; bgcolor='#FEFAE7' &gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; align=&quot;center&quot;&gt;
&lt;strong&gt;here your enitire news letter will come with divs&lt;/strong&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TABLE&gt;
</pre>
<p>10) To change the background of the newsletter you can do that in the body tag.</p>
<pre class="brush: plain; title: ; notranslate">&lt;BODY  leftmargin=&quot;0&quot; marginwidth=&quot;0&quot; topmargin=&quot;0&quot; marginheight=&quot;0&quot; offset=&quot;0&quot; bgcolor='#212121'&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/points-to-remember-when-making-newsletter-compatible-with-gmail-outlook-yahoo-and-live-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Div height 100% not working with scrolling on IE fixed with Jquery.</title>
		<link>http://www.irtaza.com/scripting/div-100-height-scroll-issue-on-ie-fixed-with-jquery/</link>
		<comments>http://www.irtaza.com/scripting/div-100-height-scroll-issue-on-ie-fixed-with-jquery/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 11:33:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=147</guid>
		<description><![CDATA[Normally in the code with you put 100% height it with left, top, right 0 in css it would seem to work perfect in Firefox but it wont work in IE because it will not fill the area if the div is loaded with position:absolute or fixed when there is a scroll on this page. [...]]]></description>
			<content:encoded><![CDATA[<p>Normally in the code with you put 100% height it with left, top, right 0 in css it would seem to work perfect in Firefox but it wont work in IE because it will not fill the area if the div is loaded with position:absolute or fixed when there is a scroll on this page. For this reason we have to add a fixed height to the div and in order to calculate the height automatically we use JQuery height parameter. Example</p>
<p><span id="more-147"></span><br />
First Include Jquery</p>
<pre class="brush: jscript; title: ; notranslate">
 &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Then in the head tag write the following code</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
		  $(document).ready(function(){
	$(&quot;#nameofthediv&quot;).height( $(document).height() ); 

});
	&lt;/script&gt;
</pre>
<p>and the div you can use the style like this </p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;nameofthediv&quot; style=&quot;top:0; left:0; width:100%; background-color:black&quot;&gt;
 some text here&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/scripting/div-100-height-scroll-issue-on-ie-fixed-with-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to write rewrite url or clean url code for Nginx server</title>
		<link>http://www.irtaza.com/web-server/how-to-write-rewrite-url-or-clean-url-code-for-nginx-server/</link>
		<comments>http://www.irtaza.com/web-server/how-to-write-rewrite-url-or-clean-url-code-for-nginx-server/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 20:17:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.irtaza.com/?p=144</guid>
		<description><![CDATA[When using Nginx server the rewrite commands are using in the virtual host file not in the .htaccess. But the commands used are similar to that used in .htaccess.
the sample of the virtual host with rewrite url code will look like this 
]]></description>
			<content:encoded><![CDATA[<p>When using Nginx server the rewrite commands are using in the virtual host file not in the .htaccess. But the commands used are similar to that used in .htaccess.<span id="more-144"></span></p>
<p>the sample of the virtual host with rewrite url code will look like this </p>
<pre class="brush: plain; title: ; notranslate">
server {
    server_name examplesite.com;
    access_log /var/www/html/examplesite.com/logs/access.log;
    error_log /var/www/html/examplesite.com/logs/error.log;
    root /var/www/html/examplesite.com;

       index index.html index.htm index.php;

if (!-e $request_filename)
	{
rewrite  ^/channel/(.*)/(.*)/(.*)/(.*)$  /index.php?urd=$1&amp;uri=$2&amp;cat=$3&amp;title=$4 last;
rewrite  ^/channel/(.*)/(.*)/(.*)$  /index.php?urd=$1&amp;cat=$2&amp;title=$3 last;

break;

}

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/html/examplesite.com$fastcgi_script_name;
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.irtaza.com/web-server/how-to-write-rewrite-url-or-clean-url-code-for-nginx-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
