<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>PHP Scripts - WordPress Tutorials</title>
	
	<link>http://www.computersneaker.com</link>
	<description>PHP Scripts - WordPress Tutorials</description>
	<lastBuildDate>Thu, 18 Apr 2013 10:07:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/computersneaker" /><feedburner:info uri="computersneaker" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>computersneaker</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Sorting mysql data using PHP and AJAX</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/IuOSziuxfss/</link>
		<comments>http://www.computersneaker.com/sorting-mysql-data-using-php-and-ajax/#comments</comments>
		<pubDate>Thu, 18 Apr 2013 10:07:06 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=658</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>I am today going to provide Ajax sorting in PHP. I will use a “users”  MySQL table for my tutorial. I will divide my tutorial in few steps so that I can let you understand Sorting using AJAX easily. My very first step is to create a table in MySQL, you can copy this query [...]</p></p><p><a href="http://www.computersneaker.com/sorting-mysql-data-using-php-and-ajax/">Sorting mysql data using PHP and AJAX</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->I am today going to provide Ajax sorting in PHP. I will use a “users”  MySQL table for my tutorial. I will divide my tutorial in few steps so that I can let you understand Sorting using AJAX easily.</p>
<p>My very first step is to create a table in MySQL, you can copy this query and execute this in SQL section of your tool.</p>
<div id="fvch-codeblock-0" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-0"><span class="php">CREATE TABLE IF NOT EXISTS <span class="php-operator">`</span>users<span class="php-operator">`</span> <span class="php-brackets">(</span>

<span class="php-operator">`</span>id<span class="php-operator">`</span> <span class="php-var-type">int</span><span class="php-brackets">(</span><span class="php-number">1</span><span class="php-number">0</span><span class="php-brackets">)</span> NOT NULL AUTO_INCREMENT,

<span class="php-operator">`</span>saluation<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>firstname<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>surname<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>password<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>address<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>address<span class="php-number">2</span><span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>city<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>zip<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>country<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>phone<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>mobile<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>email<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT NULL,

<span class="php-operator">`</span>status<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> NOT NULL DEFAULT <span class="php-string">'inactive'</span>,

<span class="php-operator">`</span>start_date<span class="php-operator">`</span> timestamp NULL DEFAULT CURRENT_TIMESTAMP,

<span class="php-operator">`</span>expiry_date<span class="php-operator">`</span> datetime DEFAULT NULL,

<span class="php-operator">`</span>last_login<span class="php-operator">`</span> datetime DEFAULT NULL,

<span class="php-operator">`</span>last_logout<span class="php-operator">`</span> datetime DEFAULT NULL,

<span class="php-operator">`</span>flag<span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> DEFAULT <span class="php-string">'ofline'</span>,

PRIMARY KEY <span class="php-brackets">(</span><span class="php-operator">`</span>id<span class="php-operator">`</span><span class="php-brackets">)</span>

<span class="php-brackets">)</span></span></pre>
</td>
</tr>
</table>
</div>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2013/04/sorting-mysql-data-in-php-and-ajax.jpg"><img class="aligncenter size-full wp-image-663" style="border: 2px solid black;" alt="sorting mysql data in php and ajax" src="http://www.computersneaker.com/wp-content/uploads/2013/04/sorting-mysql-data-in-php-and-ajax.jpg" width="548" height="158" /></a></p>
<p><a href="http://www.lab.computersneaker.com/ajax-sorting/" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Demo</span></a>                                                                  <a href="http://www.lab.computersneaker.com/ajax-sorting/ajax-sorting.rar" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Download Code</span></a></p>
<p>Now we have table “users”, insert some dummy values in this table. So that we can have some data to see the demo.</p>
<p>Second step is to <a href="http://www.computersneaker.com/connect-mysql-using-php/">build connection between your PHP files and MySQL server</a>.</p>
<p>You need to create a file named as <em><strong>“config.php”</strong></em> and then copy and paste this code in that file.</p>
<div id="fvch-codeblock-1" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-1"><span class="php"><span class="php-var">$servername</span><span class="php-operator">=</span><span class="php-string">'localhost'</span>;

<span class="php-var">$dbusername</span><span class="php-operator">=</span><span class="php-string">'root'</span>;

<span class="php-var">$dbpassword</span><span class="php-operator">=</span><span class="php-string">''</span>;

<span class="php-var">$dbname</span><span class="php-operator">=</span><span class="php-string">'swissmetrics'</span>;

<span class="php-var">$link</span><span class="php-operator">=</span><span class="php-function">mysql_connect</span> <span class="php-brackets">(</span><span class="php-string">&quot;$servername&quot;</span>,<span class="php-string">&quot;$dbusername&quot;</span>,<span class="php-string">&quot;$dbpassword&quot;</span><span class="php-brackets">)</span>;

<span class="php-function">mysql_select_db</span><span class="php-brackets">(</span><span class="php-string">&quot;$dbname&quot;</span>,<span class="php-var">$link</span><span class="php-brackets">)</span><span class="php-operator"> or </span><span class="php-function">die</span> <span class="php-brackets">(</span><span class="php-string">&quot;could not open db&quot;</span><span class="php-operator">.</span>MySQL_error<span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;</span></pre>
</td>
</tr>
</table>
</div>
<p>if you want to understand this connection establishment deeply then read my article “<a href="http://www.computersneaker.com/connect-mysql-using-php/">Connection between MySQL and PHP</a>”</p>
<p>&nbsp;</p>
<p>Third step is to create a file <em>&#8220;<strong>main.php&#8221;</strong></em></p>
<p>And then create a form in that file, just copy and paste this code in main.php</p>
<div id="fvch-codeblock-2" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-2"><span class="php"><span class="php-operator">&lt;</span>form name<span class="php-operator">=</span><span class="php-string">&quot;ajaxlearning&quot;</span> id<span class="php-operator">=</span><span class="php-string">&quot;ajaxlearning&quot;</span><span class="php-operator">&gt;</span>

Sort By<span class="php-operator">:</span><span class="php-operator">&lt;</span>select name<span class="php-operator">=</span><span class="php-string">&quot;dropdown&quot;</span> id<span class="php-operator">=</span><span class="php-string">&quot;dropdown&quot;</span> onchange<span class="php-operator">=</span><span class="php-string">&quot;dynamic_Select(this.value)&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>option value<span class="php-operator">=</span><span class="php-string">&quot;&quot;</span><span class="php-operator">&gt;</span>Select Filter<span class="php-operator">&lt;</span><span class="php-operator">/</span>option<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>option value<span class="php-operator">=</span><span class="php-string">&quot;saluation&quot;</span><span class="php-operator">&gt;</span>Saluation<span class="php-operator">&lt;</span><span class="php-operator">/</span>option<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>option value<span class="php-operator">=</span><span class="php-string">&quot;surname&quot;</span><span class="php-operator">&gt;</span>Surname<span class="php-operator">&lt;</span><span class="php-operator">/</span>option<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>option value<span class="php-operator">=</span><span class="php-string">&quot;firstname&quot;</span><span class="php-operator">&gt;</span>First Name<span class="php-operator">&lt;</span><span class="php-operator">/</span>option<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>select<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>form<span class="php-operator">&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>You have observed that there is onchange function called in select of the form. This function is also part of this <em><strong>&#8220;main.php&#8221;</strong></em> File. This function will call ajax method to call the records from another file.</p>
<div id="fvch-codeblock-3" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-3"><span class="html"><span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;http://code.jquery.com/jquery-1.9.1.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>

<span class="html-script-element">&lt;script&gt;<span class="js"><span class="js">

<span class="js-function-keyword">function</span> dynamic_Select<span class="js-bracket">(</span>dropdown<span class="js-bracket">)</span> <span class="js-bracket">{</span>

$.ajax<span class="js-bracket">(</span><span class="js-bracket">{</span>

type<span class="js-operator">:</span> <span class="js-string">&quot;GET&quot;</span>,

url<span class="js-operator">:</span> <span class="js-string">'values.php'</span>,

data<span class="js-operator">:</span> <span class="js-string">&quot;ch=&quot;</span> <span class="js-operator">+</span> dropdown,

dataType<span class="js-operator">:</span> <span class="js-string">&quot;html&quot;</span>,

success<span class="js-operator">:</span> <span class="js-function-keyword">function</span><span class="js-bracket">(</span>html<span class="js-bracket">)</span><span class="js-bracket">{</span>$<span class="js-bracket">(</span><span class="js-string">&quot;#txtResult&quot;</span><span class="js-bracket">)</span>.html<span class="js-bracket">(</span>html<span class="js-bracket">)</span>; $<span class="js-bracket">(</span><span class="js-string">&quot;#firstresult&quot;</span><span class="js-bracket">)</span>.css<span class="js-bracket">(</span><span class="js-string">&quot;display&quot;</span>, <span class="js-string">&quot;none&quot;</span><span class="js-bracket">)</span>;<span class="js-bracket">}</span>

<span class="js-bracket">}</span><span class="js-bracket">)</span>;

<span class="js-bracket">}</span>

</span></span>&lt;/script&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>This will get value of your selected option and then pass that value to the file <em><strong>“values.php”</strong></em>, this file will call the values accordingly. And then display those values on your page without refreshing your page.</p>
<p>Here is the code for <em><strong>&#8220;values.php&#8221;</strong></em>:</p>
<div id="fvch-codeblock-4" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-4"><span class="php"><span class="php-script-tag">&lt;?php</span>

<span class="php-keyword">include</span><span class="php-brackets">(</span><span class="php-string">'config.php'</span><span class="php-brackets">)</span>;

<span class="php-var">$order </span> <span class="php-operator">=</span>             <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'ch'</span><span class="php-brackets">]</span>;

<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$order</span><span class="php-operator">!</span><span class="php-operator">=</span><span class="php-string">''</span><span class="php-brackets">)</span>

<span class="php-brackets">{</span>

<span class="php-var">$query </span> <span class="php-operator">=</span>             <span class="php-string">&quot;SELECT * FROM users Order By $order ASC&quot;</span>;

<span class="php-brackets">}</span>

<span class="php-keyword">else</span>

<span class="php-brackets">{</span>

<span class="php-var">$query </span> <span class="php-operator">=</span>             <span class="php-string">&quot;SELECT * FROM users&quot;</span>;

<span class="php-brackets">}</span>

<span class="php-var">$res      </span> <span class="php-operator">=</span>             <span class="php-function">mysql_query</span><span class="php-brackets">(</span><span class="php-var">$query</span><span class="php-brackets">)</span>;

<span class="php-script-tag">?&gt;<span class="html">

<span class="html-table-element">&lt;table id=<span class="html-attribute">&quot;mytable&quot;</span> cellspacing=<span class="html-attribute">&quot;0&quot;</span> summary=<span class="html-attribute">&quot;Sorting MySQL Data Using PHP and Ajax&quot;</span>&gt;</span>

<span class="html-other-element">&lt;caption&gt;</span>Sorting MySQL Data Using PHP and Ajax<span class="html-other-element">&lt;/caption&gt;</span>

<span class="html-table-element">&lt;tr&gt;</span>

<span class="html-table-element">&lt;th scope=<span class="html-attribute">&quot;col&quot;</span>&gt;</span>Saluation<span class="html-table-element">&lt;/th&gt;</span>

<span class="html-table-element">&lt;th scope=<span class="html-attribute">&quot;col&quot;</span>&gt;</span>Surname<span class="html-table-element">&lt;/th&gt;</span>

<span class="html-table-element">&lt;th scope=<span class="html-attribute">&quot;col&quot;</span>&gt;</span>FirstName<span class="html-table-element">&lt;/th&gt;</span>

<span class="html-table-element">&lt;/tr&gt;</span>

</span>&lt;?php</span>

<span class="php-keyword">while</span><span class="php-brackets">(</span><span class="php-var">$row</span> <span class="php-operator">=</span> <span class="php-function">mysql_fetch_array</span><span class="php-brackets">(</span><span class="php-var">$res</span><span class="php-brackets">)</span><span class="php-brackets">)</span>

<span class="php-brackets">{</span>

<span class="php-keyword">echo</span> <span class="php-string">'&lt;tr&gt;

&lt;td&gt;'</span><span class="php-operator">.</span><span class="php-var">$row</span><span class="php-brackets">[</span><span class="php-string">'saluation'</span><span class="php-brackets">]</span><span class="php-operator">.</span><span class="php-string">'&lt;/td&gt;

&lt;td&gt;'</span><span class="php-operator">.</span><span class="php-var">$row</span><span class="php-brackets">[</span><span class="php-string">'surname'</span><span class="php-brackets">]</span><span class="php-operator">.</span><span class="php-string">'&lt;/td&gt;

&lt;td&gt;'</span><span class="php-operator">.</span><span class="php-var">$row</span><span class="php-brackets">[</span><span class="php-string">'firstname'</span><span class="php-brackets">]</span><span class="php-operator">.</span><span class="php-string">'&lt;/td&gt;

&lt;/tr&gt;'</span>;

<span class="php-brackets">}</span>

<span class="php-script-tag">?&gt;<span class="html">

<span class="html-table-element">&lt;/table&gt;</span></span></span></span></pre>
</td>
</tr>
</table>
</div>
<p><a href="http://www.lab.computersneaker.com/ajax-sorting/" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Demo</span></a>                                                                  <a href="http://www.lab.computersneaker.com/ajax-sorting/ajax-sorting.rar" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Download Code</span></a></p>
<p>I hope you will like my tutorial. Please don’t forget to comment and subscribe my blog.
<div class="shr-publisher-658"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/sorting-mysql-data-using-php-and-ajax/">Sorting mysql data using PHP and AJAX</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/IuOSziuxfss" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/sorting-mysql-data-using-php-and-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/sorting-mysql-data-using-php-and-ajax/</feedburner:origLink></item>
		<item>
		<title>Export MySQL As CSV</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/uK862rYAFnQ/</link>
		<comments>http://www.computersneaker.com/export-mysql-as-csv/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 21:16:17 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=646</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>Export mysql as csv is mostly needed when you need to import data to some other database, wherever you wanted to use. I am giving my today&#8217;s release in that case, this is complete tested code to export MySQL as csv, whatever you need is to change the query section of this code. I hope [...]</p></p><p><a href="http://www.computersneaker.com/export-mysql-as-csv/">Export MySQL As CSV</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->Export mysql as csv is mostly needed when you need to import data to some other database, wherever you wanted to use.</p>
<p>I am giving my today&#8217;s release in that case, this is complete tested code to export MySQL as csv, whatever you need is to change the query section of this code.</p>
<p>I hope it would full fill all your requirements, it it does then do&#8217;t forget to comment.</p>
<p>Here it goes!</p>
<div id="fvch-codeblock-0" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-0"><span class="php"><span class="php-comment">/*

* establish database connection
*/</span>

<span class="php-var">$conn</span> <span class="php-operator">=</span> <span class="php-function">mysql_connect</span><span class="php-brackets">(</span><span class="php-string">'server_name'</span>, <span class="php-string">'server_username'</span>, <span class="php-string">'your_password'</span><span class="php-brackets">)</span><span class="php-operator"> or </span><span class="php-function">die</span><span class="php-brackets">(</span><span class="php-function">mysql_error</span><span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;
<span class="php-function">mysql_select_db</span><span class="php-brackets">(</span><span class="php-string">'Database_name'</span>, <span class="php-var">$conn</span><span class="php-brackets">)</span><span class="php-operator"> or </span><span class="php-function">die</span><span class="php-brackets">(</span><span class="php-function">mysql_error</span><span class="php-brackets">(</span><span class="php-var">$conn</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;

<span class="php-var">$query</span> <span class="php-operator">=</span> <span class="php-string">'SELECT * FROM users'</span>;

<span class="php-var">$result</span> <span class="php-operator">=</span> <span class="php-function">mysql_query</span><span class="php-brackets">(</span><span class="php-var">$query</span>, <span class="php-var">$conn</span><span class="php-brackets">)</span><span class="php-operator"> or </span><span class="php-function">die</span><span class="php-brackets">(</span><span class="php-function">mysql_error</span><span class="php-brackets">(</span><span class="php-var">$conn</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;

<span class="php-comment">/*
* send response headers to the browser
* following headers instruct the browser to treat the data as a csv file called export.csv
*/</span>

<span class="php-function">header</span><span class="php-brackets">(</span><span class="php-string">'Content-Type: text/csv'</span><span class="php-brackets">)</span>;
<span class="php-function">header</span><span class="php-brackets">(</span><span class="php-string">'Content-Disposition: attachment;filename=export.csv'</span><span class="php-brackets">)</span>;

<span class="php-var">$row</span> <span class="php-operator">=</span> <span class="php-function">mysql_fetch_assoc</span><span class="php-brackets">(</span><span class="php-var">$result</span><span class="php-brackets">)</span>;
<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$row</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
getcsv<span class="php-brackets">(</span><span class="php-function">array_keys</span><span class="php-brackets">(</span><span class="php-var">$row</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;
<span class="php-brackets">}</span>

<span class="php-operator">&amp;</span>nbsp;

<span class="php-keyword">while</span> <span class="php-brackets">(</span><span class="php-var">$row</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
getcsv<span class="php-brackets">(</span><span class="php-var">$row</span><span class="php-brackets">)</span>;
<span class="php-var">$row</span> <span class="php-operator">=</span> <span class="php-function">mysql_fetch_assoc</span><span class="php-brackets">(</span><span class="php-var">$result</span><span class="php-brackets">)</span>;
<span class="php-brackets">}</span>

<span class="php-comment">/*
* echo the input array as csv data maintaining consistency with most CSV implementations
*/</span>

<span class="php-function">function</span> getcsv<span class="php-brackets">(</span><span class="php-var">$fields</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-var">$separator</span> <span class="php-operator">=</span> <span class="php-string">''</span>;
<span class="php-keyword">foreach</span> <span class="php-brackets">(</span><span class="php-var">$fields</span> <span class="php-keyword">as</span> <span class="php-var">$field</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-function">preg_match</span><span class="php-brackets">(</span><span class="php-string">'/\\r|\\n|,|&quot;/'</span>, <span class="php-var">$field</span><span class="php-brackets">)</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-var">$field</span> <span class="php-operator">=</span> <span class="php-string">'&quot;'</span> <span class="php-operator">.</span> <span class="php-function">str_replace</span><span class="php-brackets">(</span><span class="php-string">'&quot;'</span>, <span class="php-string">'&quot;&quot;'</span>, <span class="php-var">$field</span><span class="php-brackets">)</span> <span class="php-operator">.</span> <span class="php-string">'&quot;'</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">echo</span> <span class="php-var">$separator</span> <span class="php-operator">.</span> <span class="php-var">$field</span>;
<span class="php-var">$separator</span> <span class="php-operator">=</span> <span class="php-string">','</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">echo</span> <span class="php-string">&quot;\r\n&quot;</span>;
<span class="php-brackets">}</span></span></pre>
</td>
</tr>
</table>
</div>
<div class="shr-publisher-646"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/export-mysql-as-csv/">Export MySQL As CSV</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/uK862rYAFnQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/export-mysql-as-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/export-mysql-as-csv/</feedburner:origLink></item>
		<item>
		<title>8 Important Places to Add Subscription Box</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/oBbUVi10TLo/</link>
		<comments>http://www.computersneaker.com/important-places-to-add-subscription-box/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 21:18:56 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Make Money]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=636</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>Money is in the list of every single person in the world. All of us know this. That’s why you should care about increasing your subscribers if you are running a blog. A lot of blogs shows to you the most common places to add your subscription box, but I thought why don’t we share [...]</p></p><p><a href="http://www.computersneaker.com/important-places-to-add-subscription-box/">8 Important Places to Add Subscription Box</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->
<p>Money is in the list of every single person in the world.</p>
<p>All of us know this. That’s why you should care about increasing your subscribers if you are running a blog.</p>
<p>A lot of blogs shows to you the most common places to add your subscription box, but I thought why don’t we share the rarely used places and that can bring us more subscribers.</p>
<p>So, <em>usual places + unusual places = more subscribers</em> and most importantly more money.</p>
<p>If you are actually looking for places to increase your subscribers, you are on the right place.</p>
<p>Let’s start with an additional benefit and show you the most common places:</p>
<h2>1- On the sidebar “but at the top”:</h2>
<p>so that new visitors will check it after they enter your site.</p>
<h2>2- After the post:</h2>
<p><strong></strong> If a reader read all the post to the end then he may like your stuff and he may want to get further updates, so this is the place to ask them to subscribe.</p>
<h2>3- Popup Box:</h2>
<p>I think that no one these days doesn’t use these boxes, It attracts attention of your first time visitors + you have a lot of space to show them the features of signing up to your blog.</p>
<p>But now what are the 5 Unusual But Important Places to Add Subscription Box? Let’s see them:</p>
<h2>4- Feature Box:</h2>
<p>Feature Box is the box that is at the top of your blog after the header directly. It attracts attention, and you have a big place to share with your reader what will they get from subscribing.</p>
<p>Many had started to use it, but also not that much. That’s why it isn’t common. I encourage you to try it.</p>
<h2>5- About pages:</h2>
<p>Yes, about pages, but there is a big question mark that how this page helps you to get more subscribers?</p>
<p>If a new reader came across your blog, he may go to your about page to know more about your site. If they did not like it, then no problem. But what if they liked it, will you let them to go away without subscribing your blog?</p>
<p>If they liked it, this mean they can be your super readers, so don’t leave them go without any action.</p>
<h2>6- Other landing pages:</h2>
<p>If you have content landing pages, or what Brian Clark call cornerstone content, then you must add your subscription box there too.</p>
<p>It maybe any other pages “not only cornerstone content”, it maybe your page that you shows in it your income every month, like this one by Pat Flynn “<a href="http://www.smartpassiveincome.com/my-income-reports/" target="_blank">Income Reports</a>“.</p>
<p>You show people that you want business, and that you create content that they like, so ask them to subscribe.</p>
<h2>7- Top Bar:</h2>
<p>I think you may have heard about HelloBar.</p>
<p>Yes, that bar that appears at the top of your blog.</p>
<p>There is no well place than this to ask your readers to subscribe. Forward them to a page which shows them what will they get and then ask them to subscribe.</p>
<p>The best thing about it is that it can be scrolling all the way down with the reader, so if you reader liked your content, then he will click on it.</p>
<h2>8- Footer of your site:</h2>
<p>The footer, why?</p>
<p>If someone scrolled all the way down then he might be interested to subscribe.</p>
<h2>Conclusion:</h2>
<p>These were some of the places to add your subscription box and increase subscribers. Some of them may seem common, but maximum of the blogs don’t use it.</p>
<p>I don’t use them all and I don’t encourage you to do so, but try them and test the one that increases your subscribers.</p>
<p>Now, its your turn to tell us about any other place we may have missed, also tell us about the places that you are using  plus the places you will try to use.</p>
<p>&nbsp;</p>
<div class="shr-publisher-636"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/important-places-to-add-subscription-box/">8 Important Places to Add Subscription Box</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/oBbUVi10TLo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/important-places-to-add-subscription-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/important-places-to-add-subscription-box/</feedburner:origLink></item>
		<item>
		<title>Send Email Using PHPMailer</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/Nob4_gLfxXk/</link>
		<comments>http://www.computersneaker.com/send-email-using-phpmailer/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 17:35:51 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=606</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>I am happy to write about PHPMailer class, let&#8217;s learn that how to send and email using PHPMailer. In this tutorial we will talk about how to use HTML Templates as an email, attatch files with your email using PHPMailer. Here we will use the following files to as sample for newbies. index.php send_email.php contents.html [...]</p></p><p><a href="http://www.computersneaker.com/send-email-using-phpmailer/">Send Email Using PHPMailer</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->I am happy to write about PHPMailer class, let&#8217;s learn that how to send and email using PHPMailer. In this tutorial we will talk about how to use HTML Templates as an email, attatch files with your email using PHPMailer. Here we will use the following files to as sample for newbies.</p>
<ul>
<li><span style="line-height: 13px;">index.php</span></li>
<li>send_email.php</li>
<li>contents.html</li>
<li>images/logo1.png</li>
<li>images/engr_mudasir.jpg</li>
</ul>
<p>Our index file contains a form that will ask for an email address and on submit it will send an email to your email address you entered. In any other constraint you could say that it is front end page.</p>
<p><a href="http://www.lab.computersneaker.com/send_email_using_phpMailer/" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Demo</span></a>                                                                  <a href="http://www.lab.computersneaker.com/send_email_using_phpMailer/email_using_phpMailer.rar" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Download Code</span></a></p>
<h3>index.php</h3>
<div id="fvch-codeblock-0" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-0"><span class="html"><span class="html-other-element">&lt;html&gt;</span>
<span class="html-other-element">&lt;head&gt;</span>
<span class="html-other-element">&lt;title&gt;</span>Send and Email Using PHPMaier<span class="html-other-element">&lt;/title&gt;</span>
<span class="html-other-element">&lt;/head&gt;</span>
<span class="html-other-element">&lt;body&gt;</span>
<span class="html-other-element">&lt;h2&gt;</span>Send an Email Using PHPMailer Demo<span class="html-other-element">&lt;/h2&gt;</span>
<span class="html-form-element">&lt;form enctype=<span class="html-attribute">&quot;multipart/form-data&quot;</span> method=<span class="html-attribute">&quot;post&quot;</span> action=<span class="html-attribute">&quot;send_mail.php&quot;</span>&gt;</span>
<span class="html-table-element">&lt;table width=<span class="html-attribute">&quot;461&quot;</span> height=<span class="html-attribute">&quot;138&quot;</span> border=<span class="html-attribute">&quot;1&quot;</span>&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td width=<span class="html-attribute">&quot;141&quot;</span>&gt;</span>Enter Your Email Here<span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;td width=<span class="html-attribute">&quot;187&quot;</span>&gt;</span>
<span class="html-form-element">&lt;input name=<span class="html-attribute">&quot;email&quot;</span> id=<span class="html-attribute">&quot;email&quot;</span> type=<span class="html-attribute">&quot;text&quot;</span> /&gt;</span>
<span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;submit&quot;</span> name=<span class="html-attribute">&quot;btnsend&quot;</span> id=<span class="html-attribute">&quot;btnsend&quot;</span> value=<span class="html-attribute">&quot;Send Email&quot;</span> /&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td colspan=<span class="html-attribute">&quot;2&quot;</span>&gt;</span><span class="html-special-char">&amp;nbsp;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td&gt;</span><span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;&quot;</span>&gt;</span>Main Tutorial Here<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;td&gt;</span><span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;http://www.engrmudasir.computersneaker.com&quot;</span>&gt;</span>By Engr Mudasir<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;/table&gt;</span>
<span class="html-form-element">&lt;/form&gt;</span>
<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>Our second file contains contents to send to the user as email body, this contains an image too.</p>
<h3>contents.html</h3>
<div id="fvch-codeblock-1" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-1"><span class="html"><span class="html-other-element">&lt;body style=<span class="html-attribute">&quot;<span class="css"><span class="css"><span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 10px</span></span>;</span></span>&quot;</span>&gt;</span>
<span class="html-other-element">&lt;div style=<span class="html-attribute">&quot;<span class="css"><span class="css"><span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 640px</span></span>; <span class="css-property">font-family<span class="css-selector">:</span><span class="css-value"> Arial, Helvetica, sans-serif</span></span>; <span class="css-property">font-size<span class="css-selector">:</span><span class="css-value"> 11px</span></span>;</span></span>&quot;</span>&gt;</span>
<span class="html-other-element">&lt;div align=<span class="html-attribute">&quot;center&quot;</span>&gt;</span><span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;images/logo1.png&quot;</span> style=<span class="html-attribute">&quot;<span class="css"><span class="css">height: 90px; <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 340p</span</span></span></span>&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span><span class="html-other-element">&lt;br&gt;</span>
<span class="html-other-element">&lt;br&gt;</span>
<span class="html-special-char">&amp;nbsp;</span>This is a Demo of PHPMailer.<span class="html-other-element">&lt;br&gt;</span>
<span class="html-other-element">&lt;br&gt;</span>
This particular example uses <span class="html-other-element">&lt;strong&gt;</span>HTML<span class="html-other-element">&lt;/strong&gt;</span>, with a <span class="html-special-char">&amp;lt;</span>div<span class="html-special-char">&amp;gt;</span> tag and inline<span class="html-other-element">&lt;br&gt;</span>
styles.<span class="html-other-element">&lt;br&gt;</span>
<span class="html-other-element">&lt;br&gt;</span>
Also note the use of the PHPMailer logo above with no specific code to handle
including it.<span class="html-other-element">&lt;br /&gt;</span>
Included are two attachments:<span class="html-other-element">&lt;br /&gt;</span>
logo1.png is an attachment and used inline as a graphic (above)<span class="html-other-element">&lt;br /&gt;</span>
engr_mudasir.jpg is an attachment<span class="html-other-element">&lt;br /&gt;</span>
<span class="html-other-element">&lt;br /&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;/body&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>Third file is action for the above form, this action file will send an email to the email address entered in the form.</p>
<p>Include the PHPMailer class and create an object for the PHPMailer class. Object will call the functions from the PHPMailer class. Defined are the characteristics to be used and keep in focus to send email.</p>
<h3>send_email.php</h3>
<div id="fvch-codeblock-2" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-2"><span class="php"><span class="php-keyword">require_once</span><span class="php-brackets">(</span><span class="php-string">'class.phpmailer.php'</span><span class="php-brackets">)</span>;
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-keyword">isset</span><span class="php-brackets">(</span><span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'btnsend'</span><span class="php-brackets">]</span><span class="php-brackets">)</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-var">$mail</span> <span class="php-operator">=</span> <span class="php-keyword">new</span> PHPMailer<span class="php-brackets">(</span><span class="php-brackets">)</span>; <span class="php-comment">// defaults to using php &quot;mail()&quot;</span>

<span class="php-var">$body</span> <span class="php-operator">=</span> <span class="php-function">file_get_contents</span><span class="php-brackets">(</span><span class="php-string">'contents.html'</span><span class="php-brackets">)</span>;

<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>SetFrom<span class="php-brackets">(</span><span class="php-string">'engrmudasirmalik@gmail.com'</span>, <span class="php-string">'ComputerSneaker.com'</span><span class="php-brackets">)</span>;

<span class="php-var">$address</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'email'</span><span class="php-brackets">]</span>;
<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>AddAddress<span class="php-brackets">(</span><span class="php-var">$address</span>, <span class="php-string">&quot;Guest&quot;</span><span class="php-brackets">)</span>;

<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>Subject <span class="php-operator">=</span> <span class="php-string">&quot;PHPMailer Demo Test From ComputerSneaker&quot;</span>;

<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>AltBody <span class="php-operator">=</span> <span class="php-string">&quot;To view the message, please use an HTML compatible email viewer!&quot;</span>; <span class="php-comment">// optional</span>

<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>MsgHTML<span class="php-brackets">(</span><span class="php-var">$body</span><span class="php-brackets">)</span>;

<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>AddAttachment<span class="php-brackets">(</span><span class="php-string">&quot;images/logo1.png&quot;</span><span class="php-brackets">)</span>; <span class="php-comment">// attachment</span>
<span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>AddAttachment<span class="php-brackets">(</span><span class="php-string">&quot;images/engr mudasir.jpg&quot;</span><span class="php-brackets">)</span>; <span class="php-comment">// attachment</span>

<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-operator">!</span><span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>Send<span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span> <span class="php-brackets">{</span>
<span class="php-keyword">echo</span> <span class="php-string">&quot;Mailer Error: &quot;</span> <span class="php-operator">.</span> <span class="php-var">$mail</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>ErrorInfo;
<span class="php-brackets">}</span> <span class="php-keyword">else</span> <span class="php-brackets">{</span>
<span class="php-keyword">echo</span> <span class="php-string">&quot;A test email sent to your email address '&quot;</span><span class="php-operator">.</span><span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'email'</span><span class="php-brackets">]</span><span class="php-operator">.</span><span class="php-string">&quot;' Please Check Email and Spam too.&quot;</span>;
<span class="php-keyword">echo</span> <span class="php-string">'&amp;lt;meta http-equiv=&quot;refresh&quot; content=&quot;5;url=http://www.computersneaker.com/send-email-using-phpmailer/&quot;&amp;gt;'</span>;
<span class="php-brackets">}</span>
<span class="php-brackets">}</span></span></pre>
</td>
</tr>
</table>
</div>
<p><a href="http://www.lab.computersneaker.com/send_email_using_phpMailer/" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Demo</span></a>                                                                  <a href="http://www.lab.computersneaker.com/send_email_using_phpMailer/email_using_phpMailer.rar" class="su-button su-button-style-1 su-button-class" style="background-color:#f2263b;border:1px solid #c21e2f;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;" target="_blank"><span style="color:#fee9eb;padding:12px 25px;font-size:18px;height:18px;line-height:18px;border-top:1px solid #fbbec4;border-radius:7px;text-shadow:-1px -1px 0 #c21e2f;-moz-border-radius:7px;-moz-text-shadow:-1px -1px 0 #c21e2f;-webkit-border-radius:7px;-webkit-text-shadow:-1px -1px 0 #c21e2f;">Download Code</span></a></p>
<p>And here comes the email as Email Body :</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2013/02/send-email-using-phpmailer.jpg"><img class="aligncenter  wp-image-607" style="border: 2px solid black;" alt="send email using phpmailer" src="http://www.computersneaker.com/wp-content/uploads/2013/02/send-email-using-phpmailer.jpg" width="650" height="450" /></a></p>
<p>I hope you enjoyed this tutorial, don&#8217;t forget to provide feedback and subscribe for our blog.
<div class="shr-publisher-606"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/send-email-using-phpmailer/">Send Email Using PHPMailer</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/Nob4_gLfxXk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/send-email-using-phpmailer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/send-email-using-phpmailer/</feedburner:origLink></item>
		<item>
		<title>Learn Blogging Right Now</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/_uSP59j41AI/</link>
		<comments>http://www.computersneaker.com/learn-blogging-right-now/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 07:22:52 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=562</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>Blogging is a very pretty source since it gives you an chance to share your voice and views on any topic. It is also becoming more and more popular by every passing day. Many people want to start blogging but they are not sure of how to start with it. What to do, how to [...]</p></p><p><a href="http://www.computersneaker.com/learn-blogging-right-now/">Learn Blogging Right Now</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->Blogging is a very pretty source since it gives you an chance to share your voice and views on any topic. It is also becoming more and more popular by every passing day. Many people want to start blogging but they are not sure of how to start with it. What to do, how to do and things like that. If you want to start blogging, I would suggest you to start with a wordpress.com blog. You can start with a blog in no cost at wordpress.com and it provides all that you need to start blogging. There are certain restrictions of having a blog at wordpress.com like you don’t have all the controls, you can’t display ads etc. and that’s why people who are professional bloggers go for self hosted blogs but if you are beginner then a wordpress.com blog will be more than enough for you.<br />
What? Don’t know how to start with a wordpress.com blog? No problem, WordPress is here to help you.</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2013/01/how-to-blog-blackboard.jpg"><img class="aligncenter  wp-image-563" style="border: 2px solid black;" alt="how-to-blog-blackboard" src="http://www.computersneaker.com/wp-content/uploads/2013/01/how-to-blog-blackboard.jpg" width="650" height="368" /></a></p>
<p>WordPress <a href="http://en.blog.wordpress.com/2011/01/14/want-to-share-learn-wordpress/">announced</a> the launch of <a href="http://learn.wordpress.com/">Learn WordPress</a> , A step-by-step tutorial that includes lessons on how to start a blog, customize your site, and connect with other bloggers in the WordPress.com community. It’s a great resource for anyone who:</p>
<ul>
<li> Wants to create a blog but isn’t quite sure where to start</li>
<li> Needs help choosing a blog topic</li>
<li> Wants to better understand how blogging works</li>
<li> Is interested in attracting more blog visitors</li>
</ul>
<p style="text-align: left;">It is a very well-organized book kind of guide which you can go through to learn blogging and WordPress.</p>
<div class="shr-publisher-562"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/learn-blogging-right-now/">Learn Blogging Right Now</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/_uSP59j41AI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/learn-blogging-right-now/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/learn-blogging-right-now/</feedburner:origLink></item>
		<item>
		<title>Add a NewsLetter Box After your post</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/sh504Giz-hw/</link>
		<comments>http://www.computersneaker.com/add-a-newsletter-box-after-your-post/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 18:04:43 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=527</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>I have been asked several times a simple question “How I can add a newsletter box after your post?”, then I think that I should write about that and made a subscriber newsletter box as shown in image. Here you need to follow some simple steps and you will get a subscribe box after your [...]</p></p><p><a href="http://www.computersneaker.com/add-a-newsletter-box-after-your-post/">Add a NewsLetter Box After your post</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->I have been asked several times a simple question “How I can add a newsletter box after your post?”, then I think that I should write about that and made a subscriber newsletter box as shown in image.</p>
<p><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/news-letter1.jpg"><img class="aligncenter size-full wp-image-532" title="news-letter" alt="" src="http://www.computersneaker.com/wp-content/uploads/2012/10/news-letter1.jpg" width="561" height="213" /></a></p>
<p>Here you need to follow some simple steps and you will get a subscribe box after your post as I have done.</p>
<h2>Step#1</h2>
<p>You need to open your style.css file and copy and paste the following code at the end of your style.css</p>
<p>To open your style.css, just click, Appearance-&gt;editor-&gt;style.css</p>
<div id="fvch-codeblock-0" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-0"><span class="css"><span class="css-comment">/* eNews and Update Widget

------------------------------------------------------------ */</span>

.enews-widget {

<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #e7e7e7</span></span>;

<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> 10px solid #ddd</span></span>;

<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 0 50px</span></span>;

}

.enews-widget .widget-wrap {

<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> 1px solid #fff</span></span>;

}

.enews {

<span class="css-property">background<span class="css-selector">:</span><span class="css-value"> url(images/enews-ribbon.png) no-repeat top left</span></span>;

<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> -17px -18px</span></span>;

<span class="css-property">overflow<span class="css-selector">:</span><span class="css-value"> hidden</span></span>;

<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 45px 50px 40px</span></span>;

<span class="css-property">text-align<span class="css-selector">:</span><span class="css-value"> center</span></span>;

<span class="css-property">text-shadow<span class="css-selector">:</span><span class="css-value"> 1px 1px #fff</span></span>;

}

.enews #subbox {

<span class="css-property">-moz-box-shadow<span class="css-selector">:</span><span class="css-value"> 0 0 3px #bbb</span></span>;

<span class="css-property">-webkit-box-shadow<span class="css-selector">:</span><span class="css-value"> 0 0 3px #bbb</span></span>;

<span class="css-property">background<span class="css-selector">:</span><span class="css-value"> #fff url(images/enews-subbox.png) no-repeat center left</span></span>;

<span class="css-property">box-shadow<span class="css-selector">:</span><span class="css-value"> 0 0 3px #bbb</span></span>;

<span class="css-property">color<span class="css-selector">:</span><span class="css-value"> #999</span></span>;

<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 10px -7px 10px 0</span></span>;

<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 13px 0 13px 37px</span></span>;

<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 250px</span></span>;

}

.enews #subbutton {

<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #666</span></span>;

<span class="css-property">color<span class="css-selector">:</span><span class="css-value"> #fff</span></span>;

<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 13px 12px</span></span>;

}

.enews #subbutton:hover {

<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #555</span></span>;

}</span></pre>
</td>
</tr>
</table>
</div>
<h2>Step#2:</h2>
<p>You need to <a href="http://www.computersneaker.com/wp-content/uploads/2012/10/newsletter.zip">Download</a> these images, extract files and upload images to your child’s theme directory.</p>
<p>Wp-content/themes/Your-active-theme/images/</p>
<h2>Step#3:</h2>
<p>Now just do one simple thing, open appearance-&gt;editor-&gt;single-post.php</p>
<p>Now copy and paste the following code before wp-content();</p>
<div id="fvch-codeblock-1" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-1"><span class="php"><span class="php-operator">&lt;</span>div id<span class="php-operator">=</span><span class="php-string">&quot;newsletter&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>div<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>div <span class="php-keyword">class</span><span class="php-operator">=</span><span class="php-string">&quot;newsletter-wrap&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>h<span class="php-number">4</span><span class="php-operator">&gt;</span>Sign up <span class="php-keyword">for</span> my Newsletter<span class="php-operator">&lt;</span><span class="php-operator">/</span>h<span class="php-number">4</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>p<span class="php-operator">&gt;</span>Receive WordPress tips<span class="php-operator"> and </span>learn how to customize the Genesis Framework with detailed tutorials<span class="php-operator">.</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>p<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>form id<span class="php-operator">=</span><span class="php-string">&quot;subscribe&quot;</span> action<span class="php-operator">=</span><span class="php-string">&quot;http://feedburner.google.com/fb/a/mailverify&quot;</span> method<span class="php-operator">=</span><span class="php-string">&quot;post&quot;</span> target<span class="php-operator">=</span><span class="php-string">&quot;popupwindow&quot;</span> onsubmit<span class="php-operator">=</span><span class="php-string">&quot;window.open( 'http://feedburner.google.com/fb/a/mailverify?uri=computersneaker', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>input value<span class="php-operator">=</span><span class="php-string">&quot;enter your email address&quot;</span> id<span class="php-operator">=</span><span class="php-string">&quot;subbox&quot;</span> onfocus<span class="php-operator">=</span><span class="php-string">&quot;if ( this.value == 'enter your email address') { this.value = ''; }&quot;</span> onblur<span class="php-operator">=</span><span class="php-string">&quot;if ( this.value == '' ) { this.value = 'enter your email address'; }&quot;</span> name<span class="php-operator">=</span><span class="php-string">&quot;email&quot;</span> type<span class="php-operator">=</span><span class="php-string">&quot;text&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>input name<span class="php-operator">=</span><span class="php-string">&quot;uri&quot;</span> value<span class="php-operator">=</span><span class="php-string">&quot;computersneaker&quot;</span> type<span class="php-operator">=</span><span class="php-string">&quot;hidden&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>input name<span class="php-operator">=</span><span class="php-string">&quot;loc&quot;</span> value<span class="php-operator">=</span><span class="php-string">&quot;en_US&quot;</span> type<span class="php-operator">=</span><span class="php-string">&quot;hidden&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span>input value<span class="php-operator">=</span><span class="php-string">&quot;Sign Up&quot;</span> id<span class="php-operator">=</span><span class="php-string">&quot;subbutton&quot;</span> type<span class="php-operator">=</span><span class="php-string">&quot;submit&quot;</span><span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>form<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>div<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>div<span class="php-operator">&gt;</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>div<span class="php-operator">&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>Everyone wants to get more and more subscribers in order to get more traffic to your website. So Don’t forget to subscribe to my Website.
<div class="shr-publisher-527"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/add-a-newsletter-box-after-your-post/">Add a NewsLetter Box After your post</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/sh504Giz-hw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/add-a-newsletter-box-after-your-post/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/add-a-newsletter-box-after-your-post/</feedburner:origLink></item>
		<item>
		<title>Verifying email address in PHP</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/gchVpNVKqBo/</link>
		<comments>http://www.computersneaker.com/verifying-email-address-in-php/#comments</comments>
		<pubDate>Sat, 20 Oct 2012 19:09:35 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=467</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>In this tutorial we will create 4 PHP Scripts files and one Database. signup.html sgnup_action.php confirmation.php config.php Note that this is not necessary, you can change the scenario. This all is just to provide you a simple concept that how you can verify an email using php. First of all create a database with name [...]</p></p><p><a href="http://www.computersneaker.com/verifying-email-address-in-php/">Verifying email address in PHP</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->In this tutorial we will create 4 PHP Scripts files and one Database.</p>
<ol>
<li>signup.html</li>
<li>sgnup_action.php</li>
<li>confirmation.php</li>
<li>config.php</li>
</ol>
<p>Note that this is not necessary, you can change the scenario. This all is just to provide you a simple concept that how you can verify an email using php.<br />
First of all create a database with name “users”.</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/users_table.jpg"><img class="aligncenter size-full wp-image-468" style="border: 2px solid black;" title="users_table" alt="" src="http://www.computersneaker.com/wp-content/uploads/2012/10/users_table.jpg" width="351" height="300" /></a></p>
<p>Next step to proceed is to write code for config.php file. Code is :</p>
<div id="fvch-codeblock-0" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-0"><span class="php"><span class="php-var">$host  </span>  <span class="php-operator">=</span>    <span class="php-string">'localhost'</span>;
<span class="php-var">$user  </span>  <span class="php-operator">=</span>    <span class="php-string">'abc'</span>;
<span class="php-var">$pwd  </span>  <span class="php-operator">=</span>    <span class="php-string">'your_password'</span>;
<span class="php-var">$db  </span>      <span class="php-operator">=</span>    <span class="php-string">'database'</span>;
<span class="php-var">$conn  </span>  <span class="php-operator">=</span>    <span class="php-function">mysql_connect</span><span class="php-brackets">(</span><span class="php-var">$host</span>,<span class="php-var">$user</span>,<span class="php-var">$pwd</span><span class="php-brackets">)</span>;
<span class="php-function">mysql_select_db</span><span class="php-brackets">(</span><span class="php-var">$db</span>,<span class="php-var">$conn</span><span class="php-brackets">)</span>;</span></pre>
</td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<p>We are all done with the config.php, now we have to simply design a simple registration form for that. This file would be named as ‘signup.php’</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/signup_form.jpg"><img class="aligncenter size-full wp-image-469" style="border: 2px solid black;" title="signup_form" alt="" src="http://www.computersneaker.com/wp-content/uploads/2012/10/signup_form.jpg" width="259" height="120" /></a></p>
<div id="fvch-codeblock-1" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-1"><span class="html"><span class="html-other-element">&lt;body&gt;</span>
<span class="html-form-element">&lt;form action=<span class="html-attribute">&quot;signup_action.php&quot;</span> enctype=<span class="html-attribute">&quot;multipart/form-data&quot;</span> name=<span class="html-attribute">&quot;form&quot;</span> id=<span class="html-attribute">&quot;form&quot;</span> method=<span class="html-attribute">&quot;post&quot;</span>&gt;</span>
<span class="html-table-element">&lt;table width=<span class="html-attribute">&quot;200&quot;</span> border=<span class="html-attribute">&quot;0&quot;</span>&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td&gt;</span>Name:<span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;td&gt;</span><span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;text&quot;</span> name=<span class="html-attribute">&quot;name&quot;</span> id=<span class="html-attribute">&quot;name&quot;</span> /&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td&gt;</span>Email:<span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;td&gt;</span><span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;text&quot;</span> name=<span class="html-attribute">&quot;email&quot;</span> id=<span class="html-attribute">&quot;email&quot;</span> /&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td&gt;</span>Password:<span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;td&gt;</span><span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;password&quot;</span> name=<span class="html-attribute">&quot;password&quot;</span> id=<span class="html-attribute">&quot;password&quot;</span> /&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td colspan=<span class="html-attribute">&quot;2&quot;</span> align=<span class="html-attribute">&quot;center&quot;</span>&gt;</span><span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;submit&quot;</span> name=<span class="html-attribute">&quot;submit&quot;</span> id=<span class="html-attribute">&quot;submit&quot;</span> value=<span class="html-attribute">&quot;Submit&quot;</span> /&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;/table&gt;</span>
<span class="html-form-element">&lt;/form&gt;</span>
<span class="html-other-element">&lt;/body&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>After that is to develop a code that will enter the user information into the database along with a confirmation key and the initial status of the user is ‘0’ it means that user is not active yet.</p>
<p>Once I filled the form and press submit button.</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/filled_signUp.jpg"><img class="aligncenter size-full wp-image-470" style="border: 2px solid black;" title="filled_signUp" alt="" src="http://www.computersneaker.com/wp-content/uploads/2012/10/filled_signUp.jpg" width="240" height="115" /></a></p>
<div id="fvch-codeblock-2" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-2"><span class="php"><span class="php-comment">//======Include Files</span>
<span class="php-keyword">include</span><span class="php-brackets">(</span><span class="php-string">'config.php'</span><span class="php-brackets">)</span>;
<span class="php-comment">//================ Variables=======</span>
<span class="php-var">$name  </span>  <span class="php-operator">=</span>    <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'name'</span><span class="php-brackets">]</span>;
<span class="php-var">$email  </span>  <span class="php-operator">=</span>    <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'email'</span><span class="php-brackets">]</span>;
<span class="php-var">$password</span><span class="php-operator">=</span>    <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'password'</span><span class="php-brackets">]</span>;
<span class="php-var">$confirm_code</span><span class="php-operator">=</span><span class="php-function">md5</span><span class="php-brackets">(</span><span class="php-function">uniqid</span><span class="php-brackets">(</span><span class="php-function">rand</span><span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;
<span class="php-var">$status  </span>  <span class="php-operator">=</span>    <span class="php-number">0</span>;
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-keyword">isset</span><span class="php-brackets">(</span><span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'submit'</span><span class="php-brackets">]</span><span class="php-brackets">)</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-comment">// =====Form Validation=====</span>
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$password</span><span class="php-operator">!</span><span class="php-operator">=</span><span class="php-string">''</span><span class="php-operator">&amp;</span><span class="php-operator">&amp;</span><span class="php-var">$email</span><span class="php-operator">!</span><span class="php-operator">=</span><span class="php-string">''</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-comment">//====To test if email already exists===</span>
<span class="php-var">$query  </span>  <span class="php-operator">=</span>    <span class="php-string">&quot;SELECT * FROM users WHERE email='$email'&quot;</span>;
<span class="php-var">$res  </span>  <span class="php-operator">=</span>    <span class="php-function">mysql_query</span><span class="php-brackets">(</span><span class="php-var">$query</span><span class="php-brackets">)</span>;
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-function">mysql_num_rows</span><span class="php-brackets">(</span><span class="php-var">$res</span><span class="php-brackets">)</span><span class="php-operator">&gt;</span><span class="php-number">0</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-keyword">echo</span> <span class="php-string">'&lt;h3 style=&quot;color:red&quot;&gt;This email is Already Registered&lt;/h3&gt;'</span>;

<span class="php-brackets">}</span>
<span class="php-var">$query  </span>  <span class="php-operator">=</span>    <span class="php-string">&quot;INSERT INTO users(name,email,password,status,confirm_code)VALUES('$name','$email','$password','$status','$confirm_code')&quot;</span>;

<span class="php-var">$res  </span>  <span class="php-operator">=</span>    <span class="php-function">mysql_query</span><span class="php-brackets">(</span><span class="php-var">$query</span><span class="php-brackets">)</span>;
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$res</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-comment">// send e-mail to ...</span>
<span class="php-var">$to</span><span class="php-operator">=</span><span class="php-var">$email</span>;
<span class="php-comment">// Your subject</span>
<span class="php-var">$subject</span><span class="php-operator">=</span><span class="php-string">&quot;Your confirmation Link&quot;</span>;
<span class="php-comment">// From</span>
<span class="php-var">$header</span><span class="php-operator">=</span><span class="php-string">&quot;from: Nidfo Administrator&quot;</span>;
<span class="php-comment">// Your message</span>
<span class="php-var">$message</span><span class="php-operator">=</span><span class="php-string">&quot;Your Comfirmation link \r\n&quot;</span>;
<span class="php-var">$message</span><span class="php-operator">.</span><span class="php-operator">=</span><span class="php-string">&quot;Click on this link to activate your account \r\n&quot;</span>;
<span class="php-var">$host  </span>  <span class="php-operator">=</span>    <span class="php-var">$_SERVER</span><span class="php-brackets">[</span><span class="php-string">'HTTP_HOST'</span><span class="php-brackets">]</span>;
<span class="php-var">$message</span><span class="php-operator">.</span><span class="php-operator">=</span><span class="php-string">&quot;http://$host/examples/email_verification/confirmation.php?passkey=$confirm_code&quot;</span>;
<span class="php-comment">// send email</span>
<span class="php-var">$sentmail</span> <span class="php-operator">=</span> <span class="php-function">mail</span><span class="php-brackets">(</span><span class="php-var">$to</span>,<span class="php-var">$subject</span>,<span class="php-var">$message</span>,<span class="php-var">$header</span><span class="php-brackets">)</span>;
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$sentmail</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
<span class="php-keyword">echo</span> <span class="php-string">&quot;Your Confirmation link Has Been Sent To Your Email Address&quot;</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">else</span> <span class="php-brackets">{</span>
<span class="php-keyword">echo</span> <span class="php-string">&quot;Cannot send Confirmation link to your e-mail address&quot;</span>;
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>
<span class="php-keyword">else</span>
<span class="php-brackets">{</span>

<span class="php-brackets">}</span></span></pre>
</td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<p>I have received an email with a link from where I can activate my account. At the start, situation of the table is also shown below.</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/table_after_request.jpg"><img class="aligncenter size-full wp-image-471" alt="" /> </a></p>
<div class="shr-publisher-467"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/verifying-email-address-in-php/">Verifying email address in PHP</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/gchVpNVKqBo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/verifying-email-address-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/verifying-email-address-in-php/</feedburner:origLink></item>
		<item>
		<title>Building a Simple Quiz in PHP</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/UFP3P1mPhuQ/</link>
		<comments>http://www.computersneaker.com/building-a-simple-quiz-in-php/#comments</comments>
		<pubDate>Fri, 19 Oct 2012 17:16:41 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=477</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>I have to develop a code for a simple quiz in PHP page. I figured it out and found it to be very simple and easy to do. All the steps you need to do is to create a simple form and after that a PHP Script that will calculate the answers of the specific [...]</p></p><p><a href="http://www.computersneaker.com/building-a-simple-quiz-in-php/">Building a Simple Quiz in PHP</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->I have to develop a code for a simple quiz in PHP page. I figured it out and found it to be very simple and easy to do.</p>
<p>All the steps you need to do is to create a simple form and after that a PHP Script that will calculate the answers of the specific question.</p>
<p>I have followed some simple steps, created a form as below.</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/simple-quiz.jpg"><img class="aligncenter size-full wp-image-478" style="border: 2px solid black;" title="simple quiz" alt="" src="http://www.computersneaker.com/wp-content/uploads/2012/10/simple-quiz.jpg" width="261" height="170" /></a></p>
<p>Next step I followed is that I have simply action my form with another file “quiz_result.php”</p>
<p>My file will elaborate all the results and then display the correct answers on the next page.</p>
<p>So first of all created a form with following qualities.</p>
<div id="fvch-codeblock-0" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-0"><span class="php"><span class="php-operator">&lt;</span>form action<span class="php-operator">=</span><span class="php-string">&quot;quiz_result.php&quot;</span> method<span class="php-operator">=</span><span class="php-string">&quot;post&quot;</span><span class="php-operator">&gt;</span>……<span class="php-operator">.</span><span class="php-operator">.</span>Form Here……<span class="php-operator">.</span><span class="php-operator">.</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>form<span class="php-operator">&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>Next to that I have created a simple single question with four multiple choice, I have preferred radio buttons so that user can select only single option.</p>
<div id="fvch-codeblock-1" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-1"><span class="html">HTML Stands for...

<span class="html-form-element">&lt;input id=<span class="html-attribute">&quot;question-1-answers-A&quot;</span> type=<span class="html-attribute">&quot;radio&quot;</span> name=<span class="html-attribute">&quot;question-1-answers&quot;</span> value=<span class="html-attribute">&quot;A&quot;</span> /&gt;</span>

<span class="html-other-element">&lt;label for=<span class="html-attribute">&quot;question-1-answers-A&quot;</span>&gt;</span>A) Hypertext Markup Language <span class="html-other-element">&lt;/label&gt;</span>
<span class="html-other-element">&lt;div&gt;</span>

<span class="html-form-element">&lt;input id=<span class="html-attribute">&quot;question-1-answers-B&quot;</span> type=<span class="html-attribute">&quot;radio&quot;</span> name=<span class="html-attribute">&quot;question-1-answers&quot;</span> value=<span class="html-attribute">&quot;B&quot;</span> /&gt;</span>

<span class="html-other-element">&lt;label for=<span class="html-attribute">&quot;question-1-answers-B&quot;</span>&gt;</span>B) Hypertext Markup<span class="html-other-element">&lt;/label&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div&gt;</span>

<span class="html-form-element">&lt;input id=<span class="html-attribute">&quot;question-1-answers-C&quot;</span> type=<span class="html-attribute">&quot;radio&quot;</span> name=<span class="html-attribute">&quot;question-1-answers&quot;</span> value=<span class="html-attribute">&quot;C&quot;</span> /&gt;</span>

<span class="html-other-element">&lt;label for=<span class="html-attribute">&quot;question-1-answers-C&quot;</span>&gt;</span>C) Hypertext Programming<span class="html-other-element">&lt;/label&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div&gt;</span>

<span class="html-form-element">&lt;input id=<span class="html-attribute">&quot;question-1-answers-D&quot;</span> type=<span class="html-attribute">&quot;radio&quot;</span> name=<span class="html-attribute">&quot;question-1-answers&quot;</span> value=<span class="html-attribute">&quot;D&quot;</span> /&gt;</span>

<span class="html-other-element">&lt;label for=<span class="html-attribute">&quot;question-1-answers-D&quot;</span>&gt;</span>D) None of the above<span class="html-other-element">&lt;/label&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>At the end of this form before the ending of &lt;/form&gt; I have placed a button that will let me redirect to the next page to display the results.</p>
<div id="fvch-codeblock-2" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-2"><span class="html"><span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;submit&quot;</span> value=<span class="html-attribute">&quot;Submit Quiz&quot;</span> /&gt;</span>;</span></pre>
</td>
</tr>
</table>
</div>
<p>And main thing was my PHP Script file “quiz_result.php”.</p>
<div id="fvch-codeblock-3" class="fvch-codeblock">
<table>
<tr>
<td class="fvch-line-numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre>
</td>
<td class="fvch-code">
<pre id="fvch-code-3"><span class="php"><span class="php-var">$answer1</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'question-1-answers'</span><span class="php-brackets">]</span>;

<span class="php-var">$answer2</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'question-2-answers'</span><span class="php-brackets">]</span>;

<span class="php-var">$answer3</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'question-3-answers'</span><span class="php-brackets">]</span>;

<span class="php-var">$answer4</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'question-4-answers'</span><span class="php-brackets">]</span>;

<span class="php-var">$answer5</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'question-5-answers'</span><span class="php-brackets">]</span>;

<span class="php-var">$totalCorrect</span> <span class="php-operator">=</span> <span class="php-number">0</span>;

<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$answer1</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-string">&quot;B&quot;</span><span class="php-brackets">)</span> <span class="php-brackets">{</span> <span class="php-var">$totalCorrect</span><span class="php-operator">+</span><span class="php-operator">+</span>; <span class="php-brackets">}</span>

<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$answer2</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-string">&quot;A&quot;</span><span class="php-brackets">)</span> <span class="php-brackets">{</span> <span class="php-var">$totalCorrect</span><span class="php-operator">+</span><span class="php-operator">+</span>; <span class="php-brackets">}</span>

<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$answer3</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-string">&quot;C&quot;</span><span class="php-brackets">)</span> <span class="php-brackets">{</span> <span class="php-var">$totalCorrect</span><span class="php-operator">+</span><span class="php-operator">+</span>; <span class="php-brackets">}</span>

<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$answer4</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-string">&quot;D&quot;</span><span class="php-brackets">)</span> <span class="php-brackets">{</span> <span class="php-var">$totalCorrect</span><span class="php-operator">+</span><span class="php-operator">+</span>; <span class="php-brackets">}</span>

<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$answer5</span><span class="php-brackets">)</span> <span class="php-brackets">{</span> <span class="php-var">$totalCorrect</span><span class="php-operator">+</span><span class="php-operator">+</span>; <span class="php-brackets">}</span>

<span class="php-keyword">echo</span> <span class="php-string">&quot;
&lt;div id=&quot;</span>results<span class="php-string">&quot;&gt;$totalCorrect / 5 correct&lt;/div&gt;
&quot;</span>;</span></pre>
</td>
</tr>
</table>
</div>
<div class="shr-publisher-477"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/building-a-simple-quiz-in-php/">Building a Simple Quiz in PHP</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/UFP3P1mPhuQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/building-a-simple-quiz-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/building-a-simple-quiz-in-php/</feedburner:origLink></item>
		<item>
		<title>Add More Security To Your Blog With WordPress Firewall 2</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/d5-dtH7cqOk/</link>
		<comments>http://www.computersneaker.com/add-more-security-to-your-blog-with-wordpress-firewall-2/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 18:50:07 +0000</pubDate>
		<dc:creator>Mudasir Nazir</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=506</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>Last night I had a discussion at a forum and I have some friend who was tensed because of his blog getting hacked again and again. Then I wonder some issues that my blog might not be secure in that case, decided to make my blog secure. Downloaded WordPress Firewall 2 that adds more security [...]</p></p><p><a href="http://www.computersneaker.com/add-more-security-to-your-blog-with-wordpress-firewall-2/">Add More Security To Your Blog With WordPress Firewall 2</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->Last night I had a discussion at a forum and I have some friend who was tensed because of his blog getting hacked again and again. Then I wonder some issues that my blog might not be secure in that case, decided to make my blog secure.</p>
<p>Downloaded <a href="http://wordpress.org/extend/plugins/wordpress-firewall-2">WordPress Firewall 2</a> that adds more security to your blog.</p>
<p style="text-align: center;"><a href="http://www.computersneaker.com/wp-content/uploads/2012/10/WordPress-Firewall-2-computersneaker.jpg"><img class="aligncenter  wp-image-507" title="WordPress Firewall 2-computersneaker" src="http://www.computersneaker.com/wp-content/uploads/2012/10/WordPress-Firewall-2-computersneaker.jpg" alt="" width="600" height="400" /></a></p>
<p>&nbsp;</p>
<p>This plugin arrange for a layer of security to your site by examining web requests to your blog and blocking the most obvious attacks.  It blocks following attacks:</p>
<ul>
<li>Directory Traversal</li>
<li>SQL Injection</li>
<li>WordPress specific SQL Injection</li>
<li>Executable File Upload</li>
<li>Field Truncation</li>
<li>Remote File Execution</li>
</ul>
<p>Whenever a mistrusted attack comes to pass on my site, <a href="http://wordpress.org/extend/plugins/wordpress-firewall-2">WordPress Firewall 2</a> will block it and send an email with the details to the admin.  In the short time that I’ve been using this plugin I’ve received about 5 emails, 4 of which were the result of me fiddling around with my theme’s function file.  The other email was to notify me of a legitimate attack against my site.</p>
<p>I briefly considered white listing my theme’s function file to avoid triggering the firewall plugin when editing the file from the WordPress admin area, but chose not to.  I would rather work around this issue than leave the door open to a potential security issue.</p>
<p>If you don’t want to allow anyone to hack your blog, struggle and your inflexible work, Install WordPress Firewall 2 and sleep well at night.  You must take these precautions and stay safe.
<div class="shr-publisher-506"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/add-more-security-to-your-blog-with-wordpress-firewall-2/">Add More Security To Your Blog With WordPress Firewall 2</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/d5-dtH7cqOk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/add-more-security-to-your-blog-with-wordpress-firewall-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/add-more-security-to-your-blog-with-wordpress-firewall-2/</feedburner:origLink></item>
		<item>
		<title>Are You Deciding For Make Money Blogging?</title>
		<link>http://feedproxy.google.com/~r/computersneaker/~3/zB94LTY22Qo/</link>
		<comments>http://www.computersneaker.com/make-money-blogging/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 19:21:25 +0000</pubDate>
		<dc:creator>ella</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Make Money]]></category>

		<guid isPermaLink="false">http://www.computersneaker.com/?p=495</guid>
		<description><![CDATA[<p><p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p>Everyone wanted to get job with handsome salary package. If you are also thinking the same thing then I have some suggestions for you especially for my female fellows. I want to inspire you about earning money with your blog, simple is that, stay home, set your own hours and start writing about the thing [...]</p></p><p><a href="http://www.computersneaker.com/make-money-blogging/">Are You Deciding For Make Money Blogging?</a></p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.computersneaker.com">PHP Scripts - WordPress Tutorials</a></p><p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->Everyone wanted to get job with handsome salary package. If you are also thinking the same thing then I have some suggestions for you especially for my female fellows.</p>
<p>I want to inspire you about earning money with your blog, simple is that, stay home, set your own hours and start writing about the thing that you mostly like and you have the acknowledgment of that, whether it be cooking, decorating, parenting, fitness or just everyday life.<a href="http://www.computersneaker.com/wp-content/uploads/2012/10/make-money-blogging.jpg"><img class="alignright size-full wp-image-497" src="http://www.computersneaker.com/wp-content/uploads/2012/10/make-money-blogging.jpg" alt="" width="379" height="263" /></a></p>
<p>Then a question arises in every single mind “is it possible to actually make a living off of this?” And if possible then, how much could you make and how do you do that?</p>
<p>Being blunt, it takes a lot time to truly make an adequate amount of money blogging to replace your full-time job. The truth is, only a very small percentage of bloggers actually bring in an income. And it takes <em>months</em> to get to that point.</p>
<p>If you have decided to quit your job and start earning with a blog, I would highly recommend following steps before leaving your job.</p>
<h2><strong>Discover Followers </strong></h2>
<p>Chief and leading, you have to have a significant number of readers to even consider about making money. The best way to get followers is to get involved with the blogging community (by following other bloggers, commenting on their posts, emailing them, etc.), post your own blog posts on social networking sites such as Facebook and Twitter and other blogs and share your blog with family and friends. Remember one thing always, the more readers you have, the more expected you are to be able to bring in a significant income. I have an example here, a blog with 6K page views per month take along $6,000-$7,000 a month.<a href="http://feedburner.google.com/fb/a/mailverify?uri=computersneaker&amp;amp;loc=en_UShttp://" target="_blank"> Subscribe to My Blog by Email</a></p>
<h2><strong>Advertise</strong></h2>
<p>Now if you&#8217;ve generated a handsome amount of traffic, start advertising. A good place to begin is <a href="www.google.com/adsense/home" target="_blank">Adsense</a>. Google Adsense is free program run by Google, where you place Google ads on your website or blog and are paid per click. You have to decide what types of ads you want to display and where you want them to be displayed. As concerns earnings, approximately you have 1,000 viewers per day and a click rate of 1 percent. At 25 cents per click, you will receive $2.50 per day. This isn&#8217;t going to make you rich, but it does add up. And remember, the more page views you have, the more likely you are to be successful. So if you are beginner then focus on you are traffic first before planning to earn money from your blog.</p>
<h2><strong>Affiliate Marketing</strong></h2>
<p>Affiliate marketing is another form of advertising where companies post an ad on your blog and you earn income either per click, per sale or per lead. This has many advantages to you as you don&#8217;t need to pay anything straight or even do anything for that matter, except, of course, be generating enough traffic so companies will want to advertise on your site. <a href="http://www.amazon.com/" target="_blank">Amazon</a>  and <a href="www.clickbank.com/" target="_blank">ClickBank</a> is a great place to start. All you need to do is sign up for their affiliate program and provide a link to the product on your blog. You will be paid if the reader makes a purchase from your link.</p>
<h2><strong>Sponsors</strong></h2>
<p>This is where companies pay you to post an ad on your blog. Sometimes, sponsors will find you and contact you directly. More often than not, though, you need to let people and companies know you are looking for sponsors. A great way to do this is through your own blog! Advertise how many page views you&#8217;re getting per month and businesses will want to have a spot on your blog.</p>
<p>Doing all of these things is a great way to start making money on your blog. As you can see, it takes a lot of work, patience and dedication. Once you have the followers, though, the opportunities are infinite. Remember blogging can bring in huge revenue if done correctly.
<div class="shr-publisher-495"></div>
<p><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --></p>
<p><a href="http://www.computersneaker.com/make-money-blogging/">Are You Deciding For Make Money Blogging?</a></p><img src="http://feeds.feedburner.com/~r/computersneaker/~4/zB94LTY22Qo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.computersneaker.com/make-money-blogging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.computersneaker.com/make-money-blogging/</feedburner:origLink></item>
	</channel>
</rss>
