PHP Classes

File: howto.html

Recommend this page to a friend!
  Classes of Tiago Night   secShield   howto.html   Download  
File: howto.html
Role: Documentation
Content type: text/plain
Description: HOWTO
Class: secShield
Encrypt parameters passed between pages
Author: By
Last change:
Date: 16 years ago
Size: 2,879 bytes
 

Contents

Class file image Download
<p><b><font size="5">SecShield Class</font></b></p> <p><font size="2"><br> <b>1.</b> You will use the function <font color="#008000"><strong>setQuery(QUERY) </strong></font>to build the url with the values, like this:</font></p> <div align="center"> <center> <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" bgcolor="#808080"> <tr> <td width="100%"><font color="#FFFFFF" size="2"><strong>$secShield-&gt;setQuery('example_1=value_1&amp;example_2=value_2&amp;example_3=value_3');</strong></font></td> </tr> </table> </center> </div> <p><font size="2">This</font><font size="2"> function will generate a $_GET method to pass the variables and values compressed and encrypted.</font></p> <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" bgcolor="#808080"> <tr> <td width="100%"> <a href="mailto:example.php?secShield=$REF#@$%#$" style="text-decoration: none; font-weight: 700"> <font color="#FFFFFF" size="2">http://www.yourwebsite.any/somepage.php?secShield=iT&amp;f7oF(&amp;6f*IUIUGOUyF*&amp;%Fo&amp;ryGOTo*&amp;5oo7¨8Y9*yH)*&amp;t*&amp;</font></a></td> </tr> </table> <p><font size="2">This</font><font size="2"> variable secShield as a $_GET method is perfectly protected, if you change anything there, the query will break and log (session and cookies) user as a possible attacker. After 10 times the user will be banned for 1 day.</font></p> <p><b><font size="2"><br> 2.</font></b><font color="#000000" size="2"> Now, to get the values back you will use the function </font><font color="#008000" size="2"><strong>getQuery();</strong></font></p> <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3" bgcolor="#808080"> <tr> <td width="100%"><b><font color="#FFFFFF" size="2">$example_response = $secShield-&gt;getQuery();</font></b></td> </tr> </table> <p><font color="#000000" size="2">witch returns an array with the <i>var-names</i> on the key and <i>var-values</i> in values, like this:</font></p> <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" bgcolor="#808080"> <tr> <td width="100%"><b><font size="2" color="#FFFFFF">echo $example_response[example_1]; // result: value_1<br> echo $example_response[example_2]; // result: value_2<br> echo $example_response[example_3]; // result: value_3</font></b><p> <font size="2" color="#FFFFFF"><b>OR</b></font></p> <p><font size="2" color="#FFFFFF"><b>print_r($example_response); // print all the variables name and values.</b></font></td> </tr> </table> <p>&nbsp;</p>