How to change Ubuntu Password

Posted February 16th, 2011 in PHP Tutorial by Paran

Different purpose we need to change the password. It may OS or other device. Different device changing option different. So, I like to to discuss here how to change Ubuntu Password. This tips is important for novice Ubuntu user. Ok, Lets see how to do it.

First Technique:

Go to: System->Preferences->About Me

Click to Change Password Button

Then Enter the current password and click to the Authenticate

Then Enter the New Password, also Retype the new Password.

Then Click to the Change Password Button. Oh, Try to Enter the strong password.

Now your Current Password is establish.

VN:F [1.9.10_1130]
Rating: 1.0/10 (1 vote cast)
VN:F [1.9.10_1130]
Rating: +1 (from 1 vote)

How to print/retrieve current page link location

Posted October 28th, 2010 in PHP Tutorial by Paran

Several time we need to print or retrieve current page link location. Or Several time we need to pass the instant page link location. But how to do it? Ok, just I try to give you some hints about this. Just you can add this code on your page head or you can add the following function on your site configuration page.

<?php
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER["SERVER_PORT"] != “80″) {
$pageURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>

Now, you need to call this function on your desired place where you want to print this link location. Call system are as follows:

<?php
echo curPageURL();
?>

I hope it will be helpful.

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

How to Avoid the PHP_SELF exploits

Posted October 2nd, 2010 in PHP Tutorial by Paran

PHP_SELF exploits can be avoided by using the htmlentities() function. For example, the form code should be like this to avoid the PHP_SELF exploits:

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

The htmlentities() function encodes the HTML entities. Now if the user tries to exploit the PHP_SELF variable, the attempt will fail and the result of entering malicious code in URL will result in the following output: Continue Reading »

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

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)