<?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>WebPaws.com &#187; variable</title>
	<atom:link href="http://webpaws.com/blog/tag/variable/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpaws.com/blog</link>
	<description>Internet Marketing and Design Services for Turnkey Web Solutions</description>
	<lastBuildDate>Thu, 10 May 2012 02:17:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>PHP 5.2.6 include function with URL query string variables</title>
		<link>http://webpaws.com/blog/29/php-526-include-function-with-url-query-string-variables/</link>
		<comments>http://webpaws.com/blog/29/php-526-include-function-with-url-query-string-variables/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 06:51:17 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[5.2.6]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=29</guid>
		<description><![CDATA[Having issues with your website no longer handling your includes with query string variables after a server upgrade to PHP version 5.2.6?<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/29/php-526-include-function-with-url-query-string-variables/">PHP 5.2.6 include function with URL query string variables</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F29%2Fphp-526-include-function-with-url-query-string-variables%2F&amp;title=PHP+5.2.6+include+function+with+URL+query+string+variables&amp;summary=Having+issues+with+your+website+no+longer+handling+your+includes+with+query+string+variables+after+a+server+upgrade+to+PHP+version+5.2.6%3F&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p>Having issues with your website no longer handling your includes with query string variables after a server upgrade to PHP version 5.2.6?</p>
<p>Look at your include code:</p>
<p><code>include 'myfile.com?v1=foo&#038;v2=555'</code></p>
<p>First off, you need to remove your virtual paths and replace them with full ones</p>
<p><code>include 'http://www.myWebSite.com/myFile.com?v1=foo&#038;v2=555'</code></p>
<p>And lastly, you need to edit the php.ini file and add the following php.ini directive:</p>
<p><code><br />
;to fix include function w/URL functions in v 5.2.6<br />
allow_url_include = 1<br />
</code></p>
<p>This will re-activate existing include codes that worked in previous versions of PHP.</p>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/29/php-526-include-function-with-url-query-string-variables/">PHP 5.2.6 include function with URL query string variables</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div><span class="facebook-like"><fb:like layout="box_count" show_faces="false" width="45" href="http://webpaws.com/blog/29/php-526-include-function-with-url-query-string-variables/"></fb:like></span>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/29/php-526-include-function-with-url-query-string-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostBack in ASP.net &#8211; passing variables on postback</title>
		<link>http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/</link>
		<comments>http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 21:22:35 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[postback]]></category>
		<category><![CDATA[variable]]></category>
		<category><![CDATA[viewstate]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=5</guid>
		<description><![CDATA[Be aware that if you set a variable before postback and then check it after postback it will be reset, use Session or ViewState to keep variable values regardless of postback state. ViewState is a collection bag which holds key value pairs of changed control attributes. You can also utilize it to store your own [&#8230;] <a class="more-link" href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/">&#8595; Read the rest of this entry...</a><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/">PostBack in ASP.net &#8211; passing variables on postback</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F5%2Fpostback-in-aspnet-passing-variables-on-postback%2F&amp;title=PostBack+in+ASP.net+%26%238211%3B+passing+variables+on+postback&amp;summary=Be+aware+that+if+you+set+a+variable+before+postback+and+then+check+it+after+postback+it+will+be+reset%2C+use+Session+or+ViewState+to+keep+variable+values+regardless+of+postback+state.%0AViewState+is+a+collection+bag+which+holds+key+value+pairs+of+changed+control+attributes.+You+can+also+utilize+it+to+store+your+own+values+%5B%26hellip%3B%5D+%3Ca+class%3D%22more-link%22+href%3D%22http%3A%2F%2Fwebpaws.com%2Fblog%2F5%2Fpostback-in-aspnet-passing-variables-on-postback%2F%22%3E%26darr%3B+Read+the+rest+of+this+entry...%3C%2Fa%3E&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p>Be aware that if you set a <span class="highlight">variable</span> before <span class="highlight">postback</span> and then check it after <span class="highlight">postback</span> it will be reset, use Session or ViewState to keep <span class="highlight">variable</span> values regardless of <span class="highlight">postback</span> state.</p>
<p>ViewState is a collection bag which holds key value pairs of changed control attributes. You can also utilize it to store your own values which will persist though a Page&#8217;s postbacks. ViewState is a member of Page, which means it is globably accessible throughout your Page. The ViewState is loaded early on in the Page creation (life cycle), and towards the end it is encrypted and outputed into the HTML. Therefore, when you add some data to the ViewState on the first page load, that data is being stored (encrypted) in the __ViewState hidden field you&#8217;ll find in the HTML source.  When <span style="text-decoration: underline;">t</span>he page is loaded again (after you click the button), that value is decrypted and loaded into the ViewState bag, which means you&#8217;ll be able to access it.</p>
<p>Remember to always check if the value you are getting (either from ViewState or Session) is null or not. If not, you&#8217;re users will get the infamous &#8220;Object reference not sent to an instance of an object.&#8221; exception.</p>
<p>ViewState is the mechanism that allows state values to be preserved across page postbacks.</p>
<p>Because of the stateless nature of web pages, regular page member variables will not maintain their values across postbacks.  When we need a page variable to maintain its value across page post backs, we can use ViewState to store that value.  Values stored in ViewState will be serialized and sent to the client browser as the value of a hidden form input.  When you view the page source (in your browser) of a page the uses ViewState, you may see this hidden viewstate input which will look something like this:</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;__VIEWSTATE&#8221; id=&#8221;__VIEWSTATE&#8221; value=&#8221;/wQPDwAKMTn1ODM5Rj&#8230;&#8230;.&#8221; /&gt;</p>
<p>This single hidden field contains all the viewstate values for all the page controls. This is an important aspect of viewstate that you need to consider.</p>
<h3>Example</h3>
<p>One simple way to store small values in viewstate is to use a property instead of a member variable.  This property can use viewstate to store its value rather than a member variable that would lose the value over a postback. For example, storing an Integer in viewstate can be accomplished like this:</p>
<p>VB</p>
<div style="padding: 5px; color: black; font-family: Courier New; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<p style="margin: 0px;"><span style="color: blue;">Public</span> <span style="color: blue;">Property</span> SomeInteger() <span style="color: blue;">As</span> <span style="color: blue;">Integer</span></p>
<p style="margin: 0px;"><span style="color: blue;">Get</span></p>
<p style="margin: 0px;"><span style="color: blue;">Dim</span> o <span style="color: blue;">As</span> <span style="color: blue;">Object</span> = ViewState(<span>&#8220;SomeInteger&#8221;</span>)</p>
<p style="margin: 0px;"><span style="color: blue;">If</span> <span style="color: blue;">Not</span> o <span style="color: blue;">Is</span> <span style="color: blue;">Nothing</span> <span style="color: blue;">Then</span> <span style="color: blue;">Return</span> <span style="color: blue;">DirectCast</span>(o, <span style="color: blue;">Integer</span>)</p>
<p style="margin: 0px;"><span style="color: blue;">Return</span> 0 <span style="color: green;">&#8216;a default</span></p>
<p style="margin: 0px;"><span style="color: blue;">End</span> <span style="color: blue;">Get</span></p>
<p style="margin: 0px;"><span style="color: blue;">Set</span>(<span style="color: blue;">ByVal</span> value <span style="color: blue;">As</span> <span style="color: blue;">Integer</span>)</p>
<p style="margin: 0px;">ViewState(<span>&#8220;SomeInteger&#8221;</span>) = value</p>
<p style="margin: 0px;"><span style="color: blue;">End</span> <span style="color: blue;">Set</span></p>
<p style="margin: 0px;"><span style="color: blue;">End</span> <span style="color: blue;">Property</span></p>
<p style="margin: 0px;">
</div>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/">PostBack in ASP.net &#8211; passing variables on postback</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div><span class="facebook-like"><fb:like layout="box_count" show_faces="false" width="45" href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/"></fb:like></span>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

