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

<channel>
	<title>Philhosting Company Blog &#124; Internet Articles &#124; Updates &#124; Tips &#38; Tricks &#187; Programming</title>
	<atom:link href="http://blog.philhosting.net/topic/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.philhosting.net</link>
	<description>Philhosting Company Blog&#124; Internet Articles &#124; Updates &#124; Tips &#38; Tricks</description>
	<lastBuildDate>Sun, 11 Sep 2011 01:40:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HTML Codes and Tips</title>
		<link>http://blog.philhosting.net/programming/html-codes-and-tips.html</link>
		<comments>http://blog.philhosting.net/programming/html-codes-and-tips.html#comments</comments>
		<pubDate>Fri, 12 Jun 2009 07:38:53 +0000</pubDate>
		<dc:creator>Root</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[codes]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.philhosting.net/articles/?p=93</guid>
		<description><![CDATA[When you begin designing your HTML web pages, you may find that many HTML courses fall short when it comes to providing you with special effect HTML codes and tips. However, there are many special effect HTML codes that will enable you to enhance your visitors&#8217; experience tremendously. When trying to decide what HTML codes [...]]]></description>
			<content:encoded><![CDATA[<p><span>When you begin designing your HTML web pages, you may 		    find that many HTML courses fall short when it comes to providing you with 		    special effect HTML codes and tips. </p>
<p> However, there are many special effect HTML codes that will enable you to 		    enhance your visitors&#8217; experience tremendously. </p>
<p> When trying to decide what HTML codes to use within your web pages, keep 		    in mind, if it doesn&#8217;t enhance your web page, it&#8217;s probably best to leave 		    it out, as the more special effects you add to your page, the longer your 		    page will take to load.</p>
<p> In addition, prior to using any of these HTML codes and tips within your 		    web pages, you must ensure that the effect you&#8217;re trying to achieve doesn&#8217;t 		    irritate your visitors. </p>
<p> For example, using HTML codes that load web pages within web pages may crash 		    your visitors browser. In addition, using excessive pop up windows, frames 		    and placing scrolling text within the status bar can be very irritating and 		    cause your visitors to leave your web site and never return.</p>
<p> Please ensure you select your special HTML codes very carefully and use them 		    to your fullest advantage.</p>
<p> <strong>Web Design Mistakes</strong> </p>
<p> </span> </p>
<table style="width: 19px;" border="0" cellspacing="0" align="right">
<tbody>
<tr>
<td width="17">
<script type="text/javascript">&lt;!--
			  google_ad_client = "pub-8805985990345636";
			  google_ad_width = 336;
			  google_ad_height = 280;
			  google_ad_format = "336x280_as";
			  google_ad_type = "text";
			  google_ad_channel ="";
			  google_color_border = "FFFFFF";
			  google_color_bg = "FFFFFF";
			  google_color_link = "0000FF";
			  google_color_url = "999999";
			  google_color_text = "000000";
			  //--&gt;</script><br />
<script style="display: none;" src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
			  </script>
</td>
</tr>
<tr>
<td width="17">
<script type="text/javascript">&lt;!--
			  google_ad_client = "pub-8805985990345636";
			  google_ad_width = 336;
			  google_ad_height = 280;
			  google_ad_format = "336x280_as";
			  google_ad_type = "text";
			  google_ad_channel ="";
			  google_color_border = "FFFFFF";
			  google_color_bg = "FFFFFF";
			  google_color_link = "0000FF";
			  google_color_url = "999999";
			  google_color_text = "000000";
			  //--&gt;</script><br />
<script style="display: none;" src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
			  </script>
</td>
</tr>
</tbody>
</table>
<p><span>Confusing<br />
 Pop up messages<br />
 Poor load time<br />
 Over use of Java<br />
 Poor overall appearance<br />
 Poor use of HTML tables<br />
 Spelling/Grammar mistakes<br />
 Poor organization<br />
 Inconsistent page design<br />
 No contact information<br />
 No &#8216;about us&#8217; page<br />
 No privacy policy<br />
 Different backgrounds on each page<br />
 Poor content<br />
 Poor navigation<br />
 Over powering music set to auto play<br />
 Broken HTML code links and graphics<br />
 Poor browser compatibility<br />
 Large slow loading graphics<br />
 Too many graphics<br />
 Large Welcome banners<br />
 Flashing banners<br />
 Pages scrolling to oblivion<br />
 Multiple colored text<br />
 Multiple use of animated graphics<br />
 Text difficult to read<br />
 Animated bullets<br />
 No Meta tags<br />
 Too many graphic and/or line dividers<br />
 Multiple use of different fonts<br />
 Under construction signs<br />
 Busy, distracting backgrounds<br />
 Scrolling text in the status bar<br />
 Multiple banners and buttons<br />
 Large scrolling text across the page<br />
 Poor use of HTML code frames<br />
 Large fonts<br />
 Poor use of mouse over effect</p>
<p>
 When you begin designing your web site, try to keep your main HTML page as 		    small as possible. For example, instead of trying to cram all your information 		    into a single web page, consider creating sections for your content. These 		    sections can contain highlights of your content with a link to further 		    information. You can set up your content sections in HTML tables with colored 		    heading sections for information such as articles, products or whatever you&#8217;d 		    like.</span> </p>
<p> <span>To keep your main HTML page smaller, it is much better 		    to keep it down to the most essential elements. You can then use links to 		    additional pages to provide the detailed information. A good rule of thumb 		    is <em>Less is More</em>.</p>
<p> To enhance your web page, you can format your text using bold headlines, 		    colored HTML table cells, and graphic bullets and/or arrows.</p>
<p> If you use the same graphic bullets and arrows throughout your page, you 		    can enhance your page&#8217;s appearance, but you won&#8217;t add any additional time 		    to your web page load time. When you reuse an image, your image only has 		    to load once. When the image has loaded, it will instantly be displayed in 		    all of the other locations.<br />
 </span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philhosting.net/programming/html-codes-and-tips.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP : Optimizing</title>
		<link>http://blog.philhosting.net/programming/php/php-optimizing.html</link>
		<comments>http://blog.philhosting.net/programming/php/php-optimizing.html#comments</comments>
		<pubDate>Thu, 25 Sep 2008 07:52:40 +0000</pubDate>
		<dc:creator>Root</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Optimizing]]></category>

		<guid isPermaLink="false">http://philhosting.net/articles/?p=47</guid>
		<description><![CDATA[So you have a huge site with multiple PHP Scripts and you get a load of traffic all of a sudden, when you built the site you didn&#8217;t figured 0.01 second load time was fine right? Well, say you get 5,000 visitors daily; that 0.01 can turn into 50 seconds!!! Don&#8217;t know how to benchmark [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a huge site with multiple PHP Scripts and you get a load of traffic all of a sudden, when you built the site you didn&#8217;t figured 0.01 second load time was fine right? Well, say you get 5,000 visitors daily; that 0.01 can turn into 50 seconds!!!</p>
<p>Don&#8217;t know how to benchmark your script? It&#8217;s easy:</p>
<div class="code">$start = microtime();<br />
 //your script here<br />
 $end = microtime();<br />
 $time = $start &#8211; $end;<br />
 echo(round($time, 3));<br />
 //your script here<br />
 $end = microtime();<br />
 $time = $start &#8211; $end;<br />
 echo(round($time, 3));</div>
<p><strong>Now, lets turn that frown of yours upside-down.</strong></p>
<p>Echo is faster than Print (marginally, but it all adds up)</p>
<div class="code">Benchmark:<br />
 Print:<br />
 0.000314<br />
 0.00031<br />
 0.000387</p>
<p>Echo:<br />
 0.000177<br />
 0.000168<br />
 0.000235</p>
</div>
<p>Unset variables and arrays (especially); this will only help load speeds if your servers ram is full and strangling it, though it is still a good practice to unset variables and arrays when you no longer need them.</p>
<p>Use full paths in Include and Requires, this allows the server to be a zombie; and not have to resolve the filepath constantly.</p>
<div class="code">Benchmark<br />
 include(&#8220;file&#8221;)<br />
 0.014752 (omit)<br />
 0.000335<br />
 0.000331<br />
 0.000327</p>
<p>include(&#8220;./file&#8221;)<br />
 0.000179<br />
 &lt; 0.000001 (omit)<br />
 0.000117<br />
 0.000111</p>
</div>
<p>Don&#8217;t limit yourself to just Logic statements, use select() for statements that would better suit it, don&#8217;t just assume that if/then/else will cover it all, because it might; but it can become slow if you have a huge list of redundancies.</p>
<p>Suppressing errors with the @ sign can be extremely slow. Instead use error_reporting(0)</p>
<div class="code">Benchmark:<br />
 @include(&#8220;file-does-not-exist.php&#8221;)<br />
 0.000241<br />
 0.000243<br />
 0.000238<br />
 0.000251</p>
<p>error_reporting(0);<br />
 include(&#8220;file-does-not-exist.php&#8221;)<br />
 &lt; 0.000001<br />
 &lt; 0.000001<br />
 0.000122<br />
 0.00012</p>
</div>
<p>Close DB connections when you no-longer need them, this is along the same lines as unsetting variables; but will give your database some breathing room.</p>
<p>Calling arrays with single quotes is much faster than no quotes ($array['1'] is faster than $array[1])</p>
<div class="code">Benchmark:<br />
 No Quotes<br />
 0.000128<br />
 0.000136<br />
 0.000137<br />
 0.000133</p>
<p>Single Quotes<br />
 &lt; 0.000001<br />
 &lt; 0.000001<br />
 &lt; 0.000001<br />
 &lt; 0.000001</p>
</div>
<p>Globals are marginally slower than variables (only noticeable in duplicate applications).</p>
<div class="code">Benchmark:<br />
 echo($_SERVER['REMOTE_PORT']); (x5)<br />
 0.000173<br />
 0.000785<br />
 0.00017<br />
 0.000169</p>
<p>$var = $_SERVER['REMOTE_PORT'];<br />
 echo($var); (x5)<br />
 &lt; 0.000001<br />
 0.000157<br />
 &lt; 0.000001<br />
 &lt; 0.000001</p>
</div>
<p>Use single quotes for strings instead of double quotes (if you use double quotes, PHP searches for strings inside the string)</p>
<div class="code">Benchmark:<br />
 Double:<br />
 0.000146<br />
 0.000149<br />
 0.000155<br />
 0.00015</p>
<p>Single:<br />
 &lt; 0.000001<br />
 &lt; 0.000001<br />
 &lt; 0.000001<br />
 &lt; 0.000001</p>
</div>
<p>Use static HTML where possible, PHP can be up to <em>TWENTY</em> times slower than HTML. This is due to the fact that PHP compiles the script every time you call it, go learn how to cache the files. If you run a dedicated or VPS server, you will want to ask your host about ZendOptimizer for your PHP Installation. You can check to see if you already have it: php_info your server and CTRL+F for &#8220;Zend&#8221; and it should bring up it&#8217;s own block of info. If it&#8217;s installed, you should have at least basic caching setup.</p>
<p>$add++ is slower than ++$add</p>
<div class="code">Benchmark:</p>
<p>$var++<br />
 0.00032<br />
 0.000314<br />
 0.000319<br />
 0.000273</p>
<p>++$var<br />
 0.000161<br />
 0.000173<br />
 0.00018<br />
 0.00012</p>
</div>
<p>Don&#8217;t make everything in OOP, as this will end up just adding overhead, use OOP for things that should be in OOP, and nothing more.</p>
<p>Use the default PHP functions where possible, no sense in making your own function that does the same thing as a pre-defined default function.</p>
<p>For those of you that have servers buckling under the stress of traffic, you may consider taking all PHP out of your site&#8217;s pages and making different scripts that are run once nightly by a cronjob that will then build the HTML files for your site. This keeps the site dynamic, but also keeps the server from dropping to it&#8217;s knees every time a page is loaded by a visitor.</p>
<p>Also: If you believe my benchmark&#8217;s are skewed because I ran them at the same time, you will be happy to know that I ran the slower methods before running the faster methods. I&#8217;ve also put (omit) next to each of the results that seem to have hit extreme peaks or dips in performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philhosting.net/programming/php/php-optimizing.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending Email through PHP scripts</title>
		<link>http://blog.philhosting.net/programming/php/sending-email-through-php-scripts.html</link>
		<comments>http://blog.philhosting.net/programming/php/sending-email-through-php-scripts.html#comments</comments>
		<pubDate>Wed, 09 Jul 2008 01:18:20 +0000</pubDate>
		<dc:creator>Root</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mail()]]></category>
		<category><![CDATA[php mail]]></category>
		<category><![CDATA[phpmailer]]></category>

		<guid isPermaLink="false">http://philhosting.net/articles/?p=37</guid>
		<description><![CDATA[Most Linux hosting doesn&#8217;t allow direct mail sending through PHP mail() function due to spam security issue. In order to send email through PHP mail() function, you need to be authenticate first by the SMTP server. Simplest way to do is to use the PHPMailer. Below is the sample php code using PHPMailer. &#60;?php include(&#8220;class.phpmailer.php&#8221;); [...]]]></description>
			<content:encoded><![CDATA[<div id="article_content">
<p>Most Linux hosting doesn&#8217;t allow direct mail sending through PHP mail() function due to spam security issue. In order to send email through PHP mail() function, you need to be authenticate first by the SMTP server. Simplest way to do is to use the <a href="http://sourceforge.net/project/showfiles.php?group_id=26031" target="_blank">PHPMailer</a>. Below is the sample  php code using PHPMailer.</p>
<p class="p1"><span style="color: #0000ff; font-size: x-small;"><strong>&lt;?php</strong></span></p>
<p class="p1"><span style="color: #0000ff; font-size: x-small;"><strong> include(&#8220;class.phpmailer.php&#8221;);<br />
 $mail = new PHPMailer();<br />
 $mail-&gt; IsSMTP();<br />
 $mail-&gt;Host = &#8220;mail.yourdomain.com&#8221;;<br />
 $mail-&gt;SMTPAuth = true;<br />
 $mail-&gt;Username = &#8220;youruseremail@yourdomain.com&#8221;;<br />
 $mail-&gt;Password = &#8220;yourpassword&#8221;;<br />
 $mail-&gt;From = &#8220;youremail@yourdomain.com&#8221;;<br />
 $mail-&gt;FromName = &#8220;YourName&#8221;;<br />
 $mail-&gt;AddAddress($To-EmailAddress);<br />
 $mail-&gt;AddReplyTo(&#8220;youremail@yourdomain.com&#8221;, &#8220;YourName&#8221;);<br />
 $mail-&gt;IsHTML(true);<br />
 $mail-&gt;Subject = &#8220;subject is here&#8221;;<br />
 $mail-&gt;Body = &#8220;full body message here&#8221;;<br />
 $mail-&gt;AltBody = &#8220;full body message same here&#8221;;</strong></span></p>
<p class="p1"><span style="color: #0000ff; font-size: x-small;"><strong> if(!$mail-&gt;Send())<br />
 <span class="Apple-converted-space"> </span>{<br />
 $Confirm = &#8220;Error in sending!<span class="Apple-converted-space"> </span>Message hasn&#8217;t been sent&#8221;;<br />
 }<br />
 else<br />
 {<br />
 <span class="Apple-converted-space"> </span>$Confirm = &#8220;Message has been sent&#8221;;<br />
 }<br />
 ?&gt;</strong></span></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.philhosting.net/programming/php/sending-email-through-php-scripts.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

