<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PHP function to Redirect a user with a message</title>
	<atom:link href="http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/feed/" rel="self" type="application/rss+xml" />
	<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-function-to-redirect-a-user-with-a-message</link>
	<description>BlueDog Web Services</description>
	<lastBuildDate>Thu, 26 Jan 2012 21:06:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Paul</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-112</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 20 Apr 2011 22:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-112</guid>
		<description>Thanks a lot, just what I needed. God bless you!</description>
		<content:encoded><![CDATA[<p>Thanks a lot, just what I needed. God bless you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shabzo</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-111</link>
		<dc:creator>shabzo</dc:creator>
		<pubDate>Tue, 12 Apr 2011 21:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-111</guid>
		<description>thanks will give a shot</description>
		<content:encoded><![CDATA[<p>thanks will give a shot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron D. Campbell</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-110</link>
		<dc:creator>Aaron D. Campbell</dc:creator>
		<pubDate>Tue, 12 Apr 2011 14:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-110</guid>
		<description>Instead of displaying the message and THEN redirecting, just use the code from this post and display the message on the page you&#039;re redirecting to.

[sourcecode lang=&quot;php&quot;]
if ( /* Successfully changed pass */ ) {
    redirect( &quot;Your new password is updated&quot;, &quot;/page/where/success/goes.php&quot; );
} else {
    redirect( &quot;Your old password is invalid&quot;, &quot;/page/to/try/again.php&quot; );
}
[/sourcecode]

Then of course you need the code from above to display the messages on both &quot;/page/where/success/goes.php&quot; and &quot;/page/to/try/again.php&quot;:
[sourcecode lang=&quot;php&quot;]
if (isset($_GET[&#039;message&#039;]) &amp;&amp; isset($_SESSION[$_GET[&#039;message&#039;]])) {
	echo $_SESSION[$_GET[&#039;message&#039;]];
	unset($_SESSION[$_GET[&#039;message&#039;]]);
}
[/sourcecode] </description>
		<content:encoded><![CDATA[<p>Instead of displaying the message and THEN redirecting, just use the code from this post and display the message on the page you&#8217;re redirecting to.</p>
<pre class="brush: php; title: ; notranslate">
if ( /* Successfully changed pass */ ) {
    redirect( &amp;quot;Your new password is updated&amp;quot;, &amp;quot;/page/where/success/goes.php&amp;quot; );
} else {
    redirect( &amp;quot;Your old password is invalid&amp;quot;, &amp;quot;/page/to/try/again.php&amp;quot; );
}
</pre>
<p>Then of course you need the code from above to display the messages on both &#8220;/page/where/success/goes.php&#8221; and &#8220;/page/to/try/again.php&#8221;:</p>
<pre class="brush: php; title: ; notranslate">
if (isset($_GET['message']) &amp;amp;&amp;amp; isset($_SESSION[$_GET['message']])) {
	echo $_SESSION[$_GET['message']];
	unset($_SESSION[$_GET['message']]);
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: shabzo</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-109</link>
		<dc:creator>shabzo</dc:creator>
		<pubDate>Sat, 09 Apr 2011 17:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-109</guid>
		<description>when a user wants to change his password and is successfull i have this
	$msg[] = &quot;Your new password is updated&quot;;
	//header(&quot;Location: mysettings.php?msg=Your new password is updated&quot;);
	} else
	{
	 $err[] = &quot;Your old password is invalid&quot;;
	 //header(&quot;Location: mysettings.php?msg=Your old password is invalid&quot;);
	}
i want to display the message and then redirect to the login page</description>
		<content:encoded><![CDATA[<p>when a user wants to change his password and is successfull i have this<br />
	$msg[] = &#8220;Your new password is updated&#8221;;<br />
	//header(&#8220;Location: mysettings.php?msg=Your new password is updated&#8221;);<br />
	} else<br />
	{<br />
	 $err[] = &#8220;Your old password is invalid&#8221;;<br />
	 //header(&#8220;Location: mysettings.php?msg=Your old password is invalid&#8221;);<br />
	}<br />
i want to display the message and then redirect to the login page</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OpenBSD</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-108</link>
		<dc:creator>OpenBSD</dc:creator>
		<pubDate>Sun, 19 Dec 2010 10:39:04 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-108</guid>
		<description>if (isset($_GET[&#039;message&#039;]) &amp;&amp; isset($_SESSION[$_GET[&#039;message&#039;]])) {
	echo $_SESSION[$_GET[&#039;message&#039;]]&quot;;
	unset($_SESSION[$_GET[&#039;message&#039;]]);
}</description>
		<content:encoded><![CDATA[<p>if (isset($_GET['message']) &amp;&amp; isset($_SESSION[$_GET['message']])) {<br />
	echo $_SESSION[$_GET['message']]&quot;;<br />
	unset($_SESSION[$_GET['message']]);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OpenBSD</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-107</link>
		<dc:creator>OpenBSD</dc:creator>
		<pubDate>Sat, 18 Dec 2010 23:16:19 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-107</guid>
		<description>Sorry Your Comment system Block php tag !!!</description>
		<content:encoded><![CDATA[<p>Sorry Your Comment system Block php tag !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OpenBSD</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-106</link>
		<dc:creator>OpenBSD</dc:creator>
		<pubDate>Sat, 18 Dec 2010 23:14:31 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-106</guid>
		<description>Hi, 
can you send full php code with  tag ? i dont care this : $my_get[] = &quot;{$n}={$v}&quot;; 

thanks .
Best regards.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
can you send full php code with  tag ? i dont care this : $my_get[] = &quot;{$n}={$v}&quot;; </p>
<p>thanks .<br />
Best regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron D. Campbell</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-105</link>
		<dc:creator>Aaron D. Campbell</dc:creator>
		<pubDate>Thu, 12 Jul 2007 13:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-105</guid>
		<description>&lt;blockquote&gt;&lt;strong&gt;Session poisoning&lt;/strong&gt; (also referred to as &quot;Session data pollution&quot; and &quot;Session modification&quot;) is to exploit insufficient input validation in server applications which copies user input into session variables.&lt;/blockquote&gt;

&lt;p&gt;I&#039;m often guilty of forgetting some of the things that can cause these kinds of problems.  Chalk it up to being spoiled.  I work with custom written software (mine) on dedicated Rackspace servers.  However, there are a few ways that you can cause session poisoning.&lt;/p&gt;
&lt;p&gt;First, you can insufficiently validate content that you store in it.  To fix this, simply be careful about what you put in it, making sure it is what you mean to put there.  Don&#039;t assume a user put a number into the &quot;total cost&quot; field.  Assume your users are malicious.&lt;/p&gt;
&lt;p&gt;Secondly, you could have scripts or applications that use overlapping session variables.  I see this as a worse possibility because &quot;joe no coder&quot; could download and install two conflicting scripts without even knowing it.  To solve this, check out the applications you are using.  If you can&#039;t understand the code, at LEAST do some serious research.&lt;/p&gt;
&lt;p&gt;Lastly, you could have a poorly configured shared server.  Again, this is dangerous because people often don&#039;t have control over this.  Again, however, research is your friend.  Please like &lt;a href=&quot;http://www.webhostingtalk.com/&quot; onclick=&quot;&quot; rel=&quot;nofollow&quot;&gt;Web Hosting Talk&lt;/a&gt; often have hundreds of reviews on hosts.&lt;/p&gt;

&lt;p&gt;Jem: this isn&#039;t aimed at you.  This is aimed at filling in the gaps in the article above, for the users that need it.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<blockquote><p><strong>Session poisoning</strong> (also referred to as &#8220;Session data pollution&#8221; and &#8220;Session modification&#8221;) is to exploit insufficient input validation in server applications which copies user input into session variables.</p></blockquote>
<p>I&#8217;m often guilty of forgetting some of the things that can cause these kinds of problems.  Chalk it up to being spoiled.  I work with custom written software (mine) on dedicated Rackspace servers.  However, there are a few ways that you can cause session poisoning.</p>
<p>First, you can insufficiently validate content that you store in it.  To fix this, simply be careful about what you put in it, making sure it is what you mean to put there.  Don&#8217;t assume a user put a number into the &#8220;total cost&#8221; field.  Assume your users are malicious.</p>
<p>Secondly, you could have scripts or applications that use overlapping session variables.  I see this as a worse possibility because &#8220;joe no coder&#8221; could download and install two conflicting scripts without even knowing it.  To solve this, check out the applications you are using.  If you can&#8217;t understand the code, at LEAST do some serious research.</p>
<p>Lastly, you could have a poorly configured shared server.  Again, this is dangerous because people often don&#8217;t have control over this.  Again, however, research is your friend.  Please like <a href="http://www.webhostingtalk.com/" onclick="" rel="nofollow">Web Hosting Talk</a> often have hundreds of reviews on hosts.</p>
<p>Jem: this isn&#8217;t aimed at you.  This is aimed at filling in the gaps in the article above, for the users that need it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jem</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-99</link>
		<dc:creator>Jem</dc:creator>
		<pubDate>Thu, 12 Jul 2007 09:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-99</guid>
		<description>&lt;p&gt;I hope you didn&#039;t type all that out for my benefit :p&lt;/p&gt;
&lt;p&gt;&quot;However, if you simply don’t put bad data in, you won’t get bad data out.&quot; - obviously only an idiot do that, but that doesn&#039;t cover the risks of sessions on badly configured shared hosting coupled with possibility of session poisoning (I only realised it had it&#039;s own term last night, hehe): http://en.wikipedia.org/wiki/Session_poisoning&lt;/p&gt;
&lt;p&gt;A shared host user manipulates the session and then calls it using using $_GET? Sounds perfectly feasible to me. &lt;/p&gt;
&lt;p&gt;Call me paranoid but I would say ALWAYS sanitise, rather than simply &quot;when in doubt&quot;. Better safe than sorry, no?&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I hope you didn&#8217;t type all that out for my benefit :p</p>
<p>&#8220;However, if you simply don’t put bad data in, you won’t get bad data out.&#8221; &#8211; obviously only an idiot do that, but that doesn&#8217;t cover the risks of sessions on badly configured shared hosting coupled with possibility of session poisoning (I only realised it had it&#8217;s own term last night, hehe): <a href="http://en.wikipedia.org/wiki/Session_poisoning" rel="nofollow">http://en.wikipedia.org/wiki/Session_poisoning</a></p>
<p>A shared host user manipulates the session and then calls it using using $_GET? Sounds perfectly feasible to me. </p>
<p>Call me paranoid but I would say ALWAYS sanitise, rather than simply &#8220;when in doubt&#8221;. Better safe than sorry, no?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron D. Campbell</title>
		<link>http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-104</link>
		<dc:creator>Aaron D. Campbell</dc:creator>
		<pubDate>Wed, 11 Jul 2007 19:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://bluedogwebservices.com/php-function-to-redirect-a-user-with-a-message/#comment-104</guid>
		<description>Having said all that, when in doubt...SANITIZE!</description>
		<content:encoded><![CDATA[<p>Having said all that, when in doubt&#8230;SANITIZE!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

