<?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>Albertech.net &#187; PHP</title>
	<atom:link href="http://albertech.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertech.net</link>
	<description>Guides and Reviews for WordPress, PHP, MySQL, Apache, CMS Systems, jQuery, and other Technologies</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:31:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Guide: Using PHP cURL for https requests and a CA certificate</title>
		<link>http://albertech.net/2011/10/guide-for-using-php-curl-with-https-requests-and-ca-certificate/</link>
		<comments>http://albertech.net/2011/10/guide-for-using-php-curl-with-https-requests-and-ca-certificate/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 23:30:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=790</guid>
		<description><![CDATA[<img class="alignnone size-medium wp-image-791" title="phpcurl1" src="http://albertech.net/wp-content/uploads/2011/10/phpcurl1-300x192.jpg" alt="" width="300" height="192" />

I've looked at a number of cURL PHP tutorials on the web and noticed "curl_setopt($RESTsession, CURLOPT_SSL_VERIFYPEER, false);" is often used for accessing secure websites via cURL. This is often seen when people ask "I cannot connect to HTTPS site using cURL" or  have the "SSL certificate problem, verify that the CA cert is OK" error with cURL.

Ideally, you should set the SSL_VERIFYPEER value to true unless the server you are connecting to does not have a signed certificate. If you are sending confidential data, wouldn't you want to make sure you are connecting to the correct server?

This guide will help you get the CA certificate from the remote server using Mozilla Firefox 6 and then use PHP with cURL to retrieve the information from the remote https server.]]></description>
		<wfw:commentRss>http://albertech.net/2011/10/guide-for-using-php-curl-with-https-requests-and-ca-certificate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix:  php_network_getaddresses: getaddrinfo failed: Name or service not known</title>
		<link>http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/</link>
		<comments>http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/#comments</comments>
		<pubDate>Tue, 31 May 2011 18:18:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[getaddrinfo]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=712</guid>
		<description><![CDATA[I ran across this error today after noticing a file_get_contents was not working. This was on a page that had been working fine for about a year.
"php_network_getaddresses: getaddrinfo failed: Name or service not known"

This issue is typically caused by the Apache/PHP host unable to contact the DNS server.

<strong>The first thing to check is to see if you can ping the remote host using console. </strong>
<ul>
	<li>If no, then your primary name server on /etc/resolv.conf (Debian) is not working. Find a working DNS and restart Apache.</li>
	<li>If yes, then Apache is still connecting to the broken DNS server. You should try restarting Apache ... ]]></description>
		<wfw:commentRss>http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Display page render time</title>
		<link>http://albertech.net/2009/06/php-display-page-render-time/</link>
		<comments>http://albertech.net/2009/06/php-display-page-render-time/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 19:06:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[render time]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=191</guid>
		<description><![CDATA[Here's what I currently use to determine how long it takes to generate a page in PHP. Its only 8 lines of code. ]]></description>
		<wfw:commentRss>http://albertech.net/2009/06/php-display-page-render-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Preventing MySQL injection with PHP</title>
		<link>http://albertech.net/2009/03/preventing-mysql-injection-with-php/</link>
		<comments>http://albertech.net/2009/03/preventing-mysql-injection-with-php/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 22:13:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[prevent injection]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=110</guid>
		<description><![CDATA[<strong>A good practice is to check input strings to make sure users don't put in mySQL commands in your server.</strong> For instance, if a username or password POST variable isn't filtered, there is a potential for an injection like 'OR myusername='. In the past, I've been using my own PHP toolkit to "clean" the input variables. But recently, I began searching to see if there are a built-in solution in PHP for this, especially since I'm converting a script written in Python that had the filter <B>MySQLdb.escape_string</B>. Enter <a href="http://us2.php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a>]]></description>
		<wfw:commentRss>http://albertech.net/2009/03/preventing-mysql-injection-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; MySQL datetime to seconds</title>
		<link>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/</link>
		<comments>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 02:53:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[datetime to seconds]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=59</guid>
		<description><![CDATA[<strong>$unixseconds = strtotime($mysqldate);</strong>

For instance, you can use this to write a timeout script for login failures. Usually, a system should lock after 3-5 consecutive failed login attempts. I save the timestamp after the 5th consecutive login failure, then run a check on this timestamp if the current time is within the ~5-10 minute lockout window. 5 minutes is 300 seconds, 10 minutes is 600 seconds.]]></description>
		<wfw:commentRss>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate MySQL date format in PHP</title>
		<link>http://albertech.net/2009/01/validate-mysql-date-format-in-php/</link>
		<comments>http://albertech.net/2009/01/validate-mysql-date-format-in-php/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 20:32:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ereg]]></category>
		<category><![CDATA[mysql date validation]]></category>
		<category><![CDATA[php 6]]></category>
		<category><![CDATA[preg_match]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=54</guid>
		<description><![CDATA[Validating the date in MySQL should be done using preg_match since ereg_* functions will be removed in PHP 6.

<strong>More info on PHP 6 changes</strong>: <a href="http://wiki.php.net/todo/php60">http://wiki.php.net/todo/php60</a> It appears there will be a module that you can use to utilize existing ereg expressions, so that'll buy some time to port code from ereg* to preg*.
function isValidDate($date){

if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $date))
{

return true;
}
else{
return false;
}

}]]></description>
		<wfw:commentRss>http://albertech.net/2009/01/validate-mysql-date-format-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Define variables in PHP 5</title>
		<link>http://albertech.net/2008/12/define-variables-in-php-5/</link>
		<comments>http://albertech.net/2008/12/define-variables-in-php-5/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 23:46:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[define variables]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=41</guid>
		<description><![CDATA[If you have older scripts, you may encounter warning messages such as "<strong>Notice:</strong> Undefined variable: "

As a standard practice, you should define variables in PHP by putting in the variable name = FALSE;
<code>$myvar = FALSE;</code>

This is primarily for local variable names that aren't passed in through a $_REQUEST or $_POST, etc.]]></description>
		<wfw:commentRss>http://albertech.net/2008/12/define-variables-in-php-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Uptime check</title>
		<link>http://albertech.net/2008/11/php-uptime-check/</link>
		<comments>http://albertech.net/2008/11/php-uptime-check/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 21:49:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[uptime]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=38</guid>
		<description><![CDATA[I found a useful script in PHP that can be used for checking uptime of a server. It can be useful for checking when the servers have a such a significant load that pages can't be displayed. The benefit or running it locally is that I can configure the script to perform failover functionality if necessary. Online uptime services are good too, but most of them aren't free. Maybe I should force the server to show a <a href="http://www.urbandictionary.com/define.php?term=failwhale">failwhale</a> when the site gets too busy...  j/k :D

Here's the link to the script.
<a href="http://www.programmingtalk.com/showthread.php?t=34999">http://www.programmingtalk.com/showthread.php?t=34999</a>

<code>
<?php 

// the URL you want to ... ]]></description>
		<wfw:commentRss>http://albertech.net/2008/11/php-uptime-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

