<?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>bloody error &#187; PHP</title>
	<atom:link href="http://www.bloodyerror.com/articles/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloodyerror.com</link>
	<description>hope something here may help you...</description>
	<lastBuildDate>Thu, 14 Jan 2010 17:29:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP : get Request protocol Http or HTTPS</title>
		<link>http://www.bloodyerror.com/2009/09/php-get-request-protocol-http-or-https/</link>
		<comments>http://www.bloodyerror.com/2009/09/php-get-request-protocol-http-or-https/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 05:51:51 +0000</pubDate>
		<dc:creator>Jeevan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[protocol]]></category>

		<guid isPermaLink="false">http://www.bloodyerror.com/?p=37</guid>
		<description><![CDATA[How to get Requested protocol Http or HTTPS in PHP?
This function will return True if HTTPS when called&#8230;
is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))==&#8217;https&#8217;? true : false;
}
 is_https()
{
return strtolower(substr($_SERVER[&#34;SERVER_PROTOCOL&#34;],0,5))=='https'? true : false;
} 
]]></description>
			<content:encoded><![CDATA[<p><strong>How to get Requested protocol Http or HTTPS in PHP?</strong></p>
<p>This function will return True if HTTPS when called&#8230;</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">is_https()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))==&#8217;https&#8217;? true : false;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<pre class="brush: php;"> is_https()
{
return strtolower(substr($_SERVER[&quot;SERVER_PROTOCOL&quot;],0,5))=='https'? true : false;
} </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bloodyerror.com/2009/09/php-get-request-protocol-http-or-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP URL Validate using RegEx</title>
		<link>http://www.bloodyerror.com/2009/06/php-url-validate-using-regex/</link>
		<comments>http://www.bloodyerror.com/2009/06/php-url-validate-using-regex/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 20:24:01 +0000</pubDate>
		<dc:creator>Jeevan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[RegEx]]></category>
		<category><![CDATA[URL validate]]></category>
		<category><![CDATA[URL validator]]></category>

		<guid isPermaLink="false">http://www.bloodyerror.com/?p=14</guid>
		<description><![CDATA[After going through lots and lots of url validation scripts, I come across this wonderful and easy RegEx validation script works perfectly. This information has been posted in phpcentral by fqa. Amazingly author has also given detailed information for switching how a URL should be. For example, http://localhost is a VALID URL and you may [...]]]></description>
			<content:encoded><![CDATA[<p>After going through lots and lots of url validation scripts, I come across this wonderful and easy RegEx validation script works perfectly. This information has been posted in <span style="color: #ffcc00;">phpcentral </span>by <span style="color: #ffcc00;">fqa</span>. Amazingly author has also given detailed information for switching how a URL should be. For example, http://localhost is a VALID URL and you may want to allow this as valid url. Maybe you want to validate <span style="color: #ff6600;">http://www.bloodyerror.com</span> as VALID URL and <span style="color: #ff6600;">http://localhost</span> as INVALID URL.</p>
<p lang="php">
<pre class="brush: php;">
// SCHEME
$urlregex = &quot;^(https?|ftp)\:\/\/&quot;;

// USER AND PASS (optional)
$urlregex .= &quot;([a-z0-9+!*(),;?&amp;=\$_.-]+(\:[a-z0-9+!*(),;?&amp;=\$_.-]+)?@)?&quot;;

// HOSTNAME OR IP
$urlregex .= &quot;[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*&quot;;  // http://x = allowed (ex. http://localhost, http://routerlogin)
//$urlregex .= &quot;[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)+&quot;;  // http://x.x = minimum
//$urlregex .= &quot;([a-z0-9+\$_-]+\.)*[a-z0-9+\$_-]{2,3}&quot;;  // http://x.xx(x) = minimum
//use only one of the above

// PORT (optional)
$urlregex .= &quot;(\:[0-9]{2,5})?&quot;;
// PATH  (optional)
$urlregex .= &quot;(\/([a-z0-9+\$_-]\.?)+)*\/?&quot;;
// GET Query (optional)
$urlregex .= &quot;(\?[a-z+&amp;\$_.-][a-z0-9;:@/&amp;%=+\$_.-]*)?&quot;;
// ANCHOR (optional)
$urlregex .= &quot;(#[a-z_.-][a-z0-9+\$_.-]*)?\$&quot;;

// check
if (eregi($urlregex, $url)) {echo &quot;good&quot;;} else {echo &quot;bad&quot;;}
</pre>
<p>It worked just the way I wanted and it saved me a lot of time figuring out how to write RegEx (It’s a Big Mess). Hope this help you too&#8230;</p>
<p>Source: <a href="http://www.phpcentral.com/208-url-validation-php.html" target="_blank">http://www.phpcentral.com/208-url-validation-php.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloodyerror.com/2009/06/php-url-validate-using-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
