variable $base_path is not working

Posted by Nidhi Prasad on Stack Overflow See other posts from Stack Overflow or by Nidhi Prasad
Published on 2012-10-09T09:27:31Z Indexed on 2012/10/09 9:37 UTC
Read the original article Hit count: 160

Filed under:

I am trying to get the value of base_path variable in PHP (on lamp server) .

I have kept the code insider beta_test directory inside www directly.

i.e, base path function should return " /beta_test/ " . But it is returning just single slash ( "/" ) .

The code that I tried is

<script type="text/javascript" src="<?php print base_path(); ?>sites/all/themes/people10/slider/call.js"></script> 

Expected output is

<script type="text/javascript" src="/beta_test/sites/all/themes/people10/slider/call.js"></script> 

But its giving

<script type="text/javascript" src="/sites/all/themes/people10/slider/call.js"></script> 

I am using php version 5.3.3.Can anyone please help me in getting this issue solved? I am newbie to php and drupal .

© Stack Overflow or respective owner

Related posts about php