drupal 7, paths and urls are not working properly
Use the global variables for resolving the issue of path of files as below:


Use base_path if your fine with domain name not to be included:
It will return path respect to the drupal root.
Eg:  "/" for drupal root(http://localhost:81/my_website), and
"/images/header" for http://localhost:81/my_website/image/header/header

Example:


/*Assuming image path: http://localhost:81/my_website/image/header/headerR.png*/
global $base_path; /* will return "/" for http://localhost:81/my_website*/
$image_path = $base_path . 'image/header/headerR.png';



Note: Don't use trailing slash / for adding path of files with $base_path as it adds a "/" to the beginning and end of the returned path. 
Use base_url if you want to get the full path: It will return
base URL of the Drupal installation.

Example:


/*Assuming image path: http://localhost:81/my_website/image/header/headerR.png*/
global $base_url; /* will return http://localhost:81/my_website in you case*/
$image_path = $base_url . '/image/header/headerR.png';