<?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>Request Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/request/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/request/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Mar 2021 12:38:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Super Global Variables in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Wed, 24 Mar 2021 12:06:58 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[Request]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Session]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5747</guid>

					<description><![CDATA[<p>What is Super Global Variable? Super global variable is a variable which can be used in two different files for [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/">Super Global Variables in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<ul class="wp-block-list"><li><strong>What is Super Global Variable?</strong></li></ul>



<p class="wp-block-paragraph">Super global variable is a variable which can be used in two different files for manipulation.</p>



<div class="wp-block-image is-style-default"><figure class="aligncenter size-large is-resized"><img fetchpriority="high" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Untitled.jpg" alt="" class="wp-image-5748" width="725" height="260" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Untitled.jpg 683w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Untitled-300x108.jpg 300w" sizes="(max-width: 725px) 100vw, 725px" /></figure></div>



<p class="wp-block-paragraph">For example we have a variable &#8220;<strong>a</strong>&#8221; in <strong>File1.php</strong> and we need to print, edit or any manipulation needed to be done in the variable in <strong>File2.php</strong> then we have to use <strong>Super Global Variable </strong>as a variable in <strong>File1.php</strong>.</p>



<ul class="wp-block-list"><li><strong>Types of Super Global Variable</strong> <strong>in PHP:-</strong></li></ul>



<p class="wp-block-paragraph">     &#8211; $_GET</p>



<p class="wp-block-paragraph">     &#8211; $_POST</p>



<p class="wp-block-paragraph">     &#8211; $_REQUEST</p>



<p class="wp-block-paragraph">     &#8211; $_COOKIE</p>



<p class="wp-block-paragraph">     &#8211; $_SESSION</p>



<p class="wp-block-paragraph">     &#8211; $_FILES</p>



<ul class="wp-block-list"><li>To see the u<strong>se of variable $_GET and $_POST</strong> follow the link given below:</li></ul>



<p class="wp-block-paragraph">/<a href="https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/" data-type="URL" data-id="https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/">https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/</a></p>



<ul class="wp-block-list"><li><strong>Use of variable $_REQUEST</strong></li></ul>



<p class="wp-block-paragraph">&nbsp;<strong>$_REQUEST</strong>&nbsp;can catch the data which is sent using both <strong>POST </strong>&amp;&nbsp;<strong>GET</strong>&nbsp;methods whereas <strong>$_GET </strong>and <strong>$_POST </strong>can catch the data which is sent by get and post.</p>



<ul class="wp-block-list"><li><strong>Use of variable $_SERVER</strong></li></ul>



<p class="wp-block-paragraph">When we use $_SERVER we can extract extra data from the client when the form is filled. Extra data in a sense we can extract:</p>



<p class="wp-block-paragraph">     &#8211; HTTP Connection</p>



<p class="wp-block-paragraph">     &#8211; Server Information</p>



<p class="wp-block-paragraph">     &#8211; Host Information</p>



<p class="wp-block-paragraph">     &#8211; URL Information</p>



<p class="wp-block-paragraph">We can see it with the example given below:</p>



<script src="https://gist.github.com/Joydeep-cotocus/f7edd33ae6249bf13b9410a1e2c11690.js"></script>



<p class="wp-block-paragraph">Now when we insert the data in the form.html we will see the following information:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="546" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-1024x546.jpg" alt="" class="wp-image-5754" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-1024x546.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-300x160.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-768x409.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15.jpg 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list"><li><strong>Use of $_COOKIE variable:</strong></li></ul>



<p class="wp-block-paragraph">Cookies are small file that the server embeds on the user&#8217;s computer each time the same computer requests a page with a browser it will send the cookie too. With PHP, we can both create and retrieve cookie values.</p>



<p class="wp-block-paragraph">To create a cookie we need to run the following command:</p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">setcookie()</span></code></pre>



<p class="wp-block-paragraph"><strong>Syntax:</strong></p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">setcookie(name, value, expire, path, domain, secure, httponly);</span></code></pre>



<p class="wp-block-paragraph">In the syntax only the name parameter is mandatory rest other parameters are optional.</p>



<p class="wp-block-paragraph">Example for creating a cookie:</p>



<script src="https://gist.github.com/Joydeep-cotocus/3cd00ee44b1dac2f1ceda0405a18979c.js"></script>



<ul class="wp-block-list"><li><strong>Use of $_SESSION variable</strong></li></ul>



<p class="wp-block-paragraph">For session variable refer the link given below:</p>



<p class="wp-block-paragraph"><blockquote class="wp-embedded-content" data-secret="xWUEbN9Xwv"><a href="https://www.scmgalaxy.com/tutorials/how-session-works-in-php/">How Session works in PHP</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;How Session works in PHP&#8221; &#8212; scmGalaxy" src="https://www.scmgalaxy.com/tutorials/how-session-works-in-php/embed/#?secret=eLUPc5cjtV#?secret=xWUEbN9Xwv" data-secret="xWUEbN9Xwv" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/">Super Global Variables in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
