Location: PHPKode > scripts > reGlobal > reGlobals.html
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
.style2 {color: #0000CC}
.style3 {color: #009966}
.style4 {color: #009933}
-->
</style>
<h1 class="style1"><strong>reGlobals class </strong></h1>
<p class="style1"><u>V1.0</u></p>
<p class="style1"> Setting register_globals=On in php.ini automatically fills variables like
  $userName with $HTTP_GET_VARS["username"], and so on.<br>
  As it represents a major security issue,
  its default value is Off from PHP4.2. To deal with this, reGlobals allows :<br>
  Phase 1 - 	To make all pages that needs register_globals=on to work on a server with register_globals=off<br>
  Phase 2 - 	Modifies automatically page source code to include $userName=$HTTP_GET_VARS["username"]-like statments
  so reGlobals() class can also be removed and the page is completely secure.<br>
  <br>
  See 	<a href="http://fr.php.net/manual/fr/configuration.directives.php#ini.register-globals">http://fr.php.net/manual/fr/configuration.directives.php#ini.register-globals</a><br>
  or	<a href="http://fr.php.net/manual/fr/configuration.directives.php#ini.register-globals">http://fr.php.net/manual/en/configuration.directives.php#ini.register-globals</a><br>
  for the risks of using register_globals=On<br>
</p>
<p class="style1">&nbsp;  </p>
<p class="style1"><u>Author</u></p>
<p class="style1">Logan Dugenoux - 2004<br>
  <a href="mailto:http://www.peous.com/logan/">hide@address.com</a><br>
  <a href="http://www.peous.com/logan/">http://www.peous.com/logan/</a></p>
<p class="style1">&nbsp;</p>
<p class="style1"><u>License</u></p>
<p class="style1">LGPL</p>
<p class="style1">&nbsp;</p>
<p class="style1"><u>Methods :</u> </p>
<p class="style1"> reGlobals( bool modify_sourcecode=false )</p>
<p class="style1">&nbsp;</p>
<p class="style1"><u>Example :</u></p>
<p class="style1 style2">new reGlobals();<br>
  echo <span class="style3">$value_of_any_post_var</span>;<br>
  echo <span class="style4">$value_of_any_get_var_also</span>;</p>
<p class="style1">&nbsp;</p>
<p class="style1">Have fun !!! </p>
Return current item: reGlobal