PHP-GTK2 Newsletter
|
Sample Code 29: How to hide sensitive business rules of your application securely? |
| Written by kksou | ||||||
| Thursday, 21 September 2006 | ||||||
|
Problem You want to hide some sensitive business rules of your application securely. Solution There are many different options for securing php-gtk applications. One method is to encode your script. But Here we present another method quite similar to the concept as described in the article How to distribute your PHP - GTK applications - Method 1? This method basically stores your sensitive business rules on your server. Your local php-gtk application sends in the input. The server does the computation and pass back the values to your php-gtk application for display. Please take a look first at the sample code below. Run the code, and you should get the output as shown below. Sample Code
Explanation PHP starts off as a web language, and PHP-GTK is an extension of PHP. By leveraging on PHP's strength in web and PHP-GTK's capability in GUI application development, one can come out with very interesting ways of doing things. Please first take a look at the article How to distribute your PHP - GTK applications - Method 1? if you haven't. Just like an secured_business_rules.php is as shown below:
Parse error: syntax error, unexpected $end in /home/fann/kksou.com/php-gtk2/util/phpgtk2_lib_t34.php(715) : eval()'d code on line 5 "; $z = htmlentities($z); $z = str_replace("\r\n", " ", $z); $z = str_replace("\n", " ", $z); $z = str_replace(" ", " ", $z); $z = str_replace("\t", " ", $z); print " $z "; ?>The statement The demo here simply computes the square of the number. Of course one can perform any kind of business rules and computations here. Note that this method is based on the assumption that the client running the php-gtk application is connected by LAN or broadband to your server. Note
This method of hiding your sensitive business rules of your application is as secured as how well your server is protected. User reviews Average user ratings: 5.0 (from 3 users) Note: You have to be a registered member to leave a comment. Free registration here. |
||||||
| < Prev | Next > |
|---|






July 25, 2007 10:39pm
I am trying to do remote access from linux server but getting following error:
Warning: include_once() [function.include-once]: URL file-access is disabled in the server configuration in file name on line 3
Warning: include_once(http://linux-host/php-gtk2/test.php) [function.include-once]: failed to open stream: no suitable wrapper could be found in file name on line 3
Warning: include_once() [function.include]: Failed opening 'http://linux host/php-gtk2/test.php' for inclusion
(include_path='.;C:\xampplite\php\pear\') in
file name on line 3
Please help me out
August 07, 2007 9:30pm
Pankti, that mesage means that your server
has fopen_url turned off, which is very very
good because many PHP security holes are
based on fopen_url. What you want to do is cURL
instead when you really want to retrieve a
remote file. See:
http://blog.unitedheroes.net/curl/
Alternatively, you can turn on fopen_url just for
that one short section of your script, then
turn it off again.
March 07, 2009 3:08pm