Undefined variable - base_url in include() in Drupal 7 html.tpl.php I am getting this error, but everything else is fine; even that variable is getting printed. Then why does the error appear?

Notice: Undefined variable: base_url in include() (line 26 of htdocs\atins\drupal\sites\all\themes\live\html.tpl.php).
Notice: Undefined variable: base_path in include() (line 26 of htdocs\atins\drupal\sites\all\themes\live\html.tpl.php).

This is my code:
&lt;a href=&quot;&lt;?php print $base_url;?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php print $base_path . $directory; ?&gt;/img/logo.png&quot; height=&quot;35&quot; width=&quot;211&quot; alt=&quot;AtinsLive Logo&quot; title=&quot;Home&quot; /&gt;&lt;/a&gt;
You will need to bring the variable $base_url and $base_path into the global scope. At the top of your function or template file add:

global $base_path, $base_url;


or call base_path()