What are PHP_SELF exploits and how to avoid them

Posted October 2nd, 2010 in PHP Tutorial by Paran

The PHP_SELF variable is used to get the name and path of the current file but it can be used by the hackers too. If PHP_SELF is used in your page then a user can enter a slash (/) and then some Cross Site Scripting (XSS) commands to execute.

See below for an example:

<form name="test" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

Now, if a user has entered the normal URL in the address bar like “http://www.yourdomain.com/form-action.php”, the above code will be translated as:

<form name="test" action="form-action.php" method="post">

This is the normal case. Continue Reading »

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: +1 (from 3 votes)

Explain About $_server['PHP_SELF']

Posted October 1st, 2010 in PHP Tutorial by Paran
  • $_SERVER is an array defined in PHP and it stores information about your server and execution environment information.
  • $_SERVER['PHP_SELF'] variable:

This array element points out the filename of the currently executing script. For example, if you run www.cyberciti.biz/index.php, $_SERVER['PHP_SELF'] would be /index.php. This is relative to the document root. This is useful to referring HTML forms and other element.

What is PHP_SELF variable?

PHP_SELF is a variable that returns the current script being executed. This variable returns the name and path of the current file (from the root folder). You can use this variable in the action field of the FORM. There are also certain exploits that you need to be aware of. We shall discuss all these points in this article.

We will now see some examples.echo $_SERVER['PHP_SELF'];

a) Suppose your php file is located at the address:

 http://www.yourserver.com/form-action.php

In this case, PHP_SELF will contain:

 "/form-action.php"

b) Suppose your php file is located at the address:

 http://www.yourserver.com/dir1/form-action.php

For this URL, PHP_SELF will be :

 "/dir1/form-action.php"
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)

How to Google Search Box Add on your site

Posted August 27th, 2010 in PHP Tutorial by Paran

Several time we need to add google search box in our site or client site. But how can we add this. Just I will provide you some HTML code, copy this code and paste on your desire place. Ok lets go to copy this code. Just follow the bellow code

<form method="get" action="http://www.google.com/search">

<input type="text"   name="q" size="31" maxlength="255" value="" />

<input type="submit" value="SearchSite" />

</form>
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)

User Guide of CakePHP

Posted May 18th, 2010 in Framework by Paran

Those who are newcomer in cakephp platform. He is important feel about it user guide or manual. So, For the better performance of the newcomer add here some user guide and manual. Please download  the user guide. CakePHP manual

VN:F [1.9.10_1130]
Rating: 7.5/10 (2 votes cast)
VN:F [1.9.10_1130]
Rating: +2 (from 2 votes)