is there any Drupal built-in function to get the current full URL?
thanks a lot.
you could try request_uri() ... you might also need $_SERVER['HTTP_HOST']
// i haven't tested this $uri = $_SERVER['HTTP_HOST'] . '/' . request_uri(); print $uri;
I'm not aware of a drupal function for this, but it's easy enough with PHP:
<?php $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; print $url; ?>
=== "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu "God helps those who help themselves." - Ben Franklin "Search is your best friend." - Worldfallz
echo url(NULL, array('absolute' => TRUE));
To get the host name like http://www.yourdonmainname.com
use
Global $base_url; $base_url; print_r($base_url);
will give u http://www.yourdonmainname.com
u can extend this by $url=$base_url.path_to_theme();
to get full path to theme.
for module path u can use drupal_get_path('module', 'screencast')
also check base_path() by using the print_r(base_path());
to get full url with the base_url has prefix:
print url('node/NID', array('absolute' => TRUE));
Comments
you could try request_uri()
you could try request_uri() ... you might also need $_SERVER['HTTP_HOST']
I'm not aware of a drupal
I'm not aware of a drupal function for this, but it's easy enough with PHP:
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
<?phpecho url(NULL,
base url and path to theme and modules
To get the host name like http://www.yourdonmainname.com
use
will give u http://www.yourdonmainname.com
u can extend this by $url=$base_url.path_to_theme();
to get full path to theme.
for module path u can use drupal_get_path('module', 'screencast')
also check base_path() by using the print_r(base_path());
to get full url with the base
to get full url with the base_url has prefix: