<?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>Open Script Solution&#187; exist</title>
	<atom:link href="http://www.openscriptsolution.com/tag/exist/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +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>How to Check Whether a URL Exists or Not Without Visitting The Page</title>
		<link>http://www.openscriptsolution.com/2009/12/25/how-to-check-whether-a-url-exists-or-not-without-visitting-the-page/</link>
		<comments>http://www.openscriptsolution.com/2009/12/25/how-to-check-whether-a-url-exists-or-not-without-visitting-the-page/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 16:54:59 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[exist]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[visit]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1076</guid>
		<description><![CDATA[This simple script is very useful for you if you want to check whether a URL exists or not without having to visit the page. This script using PHP, and I have tested it. It worked like a charm. Of course, you need to modify further the way you want, for example, this function will [...]]]></description>
			<content:encoded><![CDATA[<p>This simple script is very useful for you if you want to check whether a URL exists or not without having to visit the page. This script using PHP, and I have tested it. It worked like a charm. Of course, you need to modify further the way you want, for example, this function will be called when a button is clicked, and so on. But we are not here to discuss these details. This example as simple as possible in the hope that you can develop further according to individual needs. <span id="more-1076"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  
&nbsp;
   <span style="color: #000000; font-weight: bold;">function</span> checkURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
     <span style="color: #000088;">$check</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
     <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$check</span><span style="color: #009900;">&#41;</span>  
       <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>  
     <span style="color: #b1b100;">else</span>  
       <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>        
     <span style="color: #b1b100;">return</span> <span style="color: #000088;">$status</span><span style="color: #339933;">;</span>  
   <span style="color: #009900;">&#125;</span>  
&nbsp;
   <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.openscriptsolution.com&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// &lt;-- change with other URL</span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>checkURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
     <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #006699; font-weight: bold;">$url</span>&gt;<span style="color: #006699; font-weight: bold;">$url</span>&lt;/a&gt; &lt;b&gt;exists&lt;/b&gt;.&quot;</span><span style="color: #339933;">;</span>  
   <span style="color: #009900;">&#125;</span>  
   <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>  
     <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #006699; font-weight: bold;">$url</span>&gt;<span style="color: #006699; font-weight: bold;">$url</span>&lt;/a&gt; does &lt;b&gt;not&lt;/b&gt; exist.&quot;</span><span style="color: #339933;">;</span>  
   <span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F25%2Fhow-to-check-whether-a-url-exists-or-not-without-visitting-the-page%2F&amp;title=How%20to%20Check%20Whether%20a%20URL%20Exists%20or%20Not%20Without%20Visitting%20The%20Page" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/12/25/how-to-check-whether-a-url-exists-or-not-without-visitting-the-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
