<?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>techcosupport.com &#187; Redirect</title>
	<atom:link href="http://techcosupport.com/press/tag/redirect/feed/" rel="self" type="application/rss+xml" />
	<link>http://techcosupport.com/press</link>
	<description>Techco Support Site - We support your business through Technology, Training and Coaching</description>
	<lastBuildDate>Thu, 29 Jul 2010 07:08:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Make sure you exit after a PHP Header Location</title>
		<link>http://techcosupport.com/press/make-sure-you-exit-after-a-php-header-location/</link>
		<comments>http://techcosupport.com/press/make-sure-you-exit-after-a-php-header-location/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 21:51:39 +0000</pubDate>
		<dc:creator>bgt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Header]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Redirect]]></category>

		<guid isPermaLink="false">http://techcosupport.com/press/?p=304</guid>
		<description><![CDATA[<p>We came accross a bug in a bot filtering page the other day.  The page called a routine which used a regular expression to check for validly formatted input.  The function was called from several places and worked fine.  In just one branch it appeared to fail to validate the input, and [...]]]></description>
			<content:encoded><![CDATA[<p>We came accross a bug in a bot filtering page the other day.  The page called a routine which used a regular expression to check for validly formatted input.  The function was called from several places and worked fine.  In just one branch it appeared to fail to validate the input, and continued execution of the page instead of redirecting to the   target page.</p>
<p>The reason?   Someone left out the exit; after the Header Location call, which allows the execution to continue down the page.  Moral:  Make sure you call <strong>exit</strong> after a PHP Header call to Location if you want execution to branch immediately!</p>
<p><code><?php<br />
if (InvalidInput($Stuff))<br />
  {<br />
    header("Location: http://www.example.com/"); /* Redirect browser */<br />
    exit; /* Make sure that code below does not get executed when we redirect. */<br />
  }<br />
/* Execute on valid input */<br />
?></code></p>
]]></content:encoded>
			<wfw:commentRss>http://techcosupport.com/press/make-sure-you-exit-after-a-php-header-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
