Drupal – Get node id from URL
$nid = explode(“/”, $_SERVER['REQUEST_URI']);
$nid = end($nid);
echo “Node id:”.$nid;
Posted on October 20, 2010, in Drupal, Node id. Bookmark the permalink. 4 Comments.
Posted by selvam4win
$nid = explode(“/”, $_SERVER['REQUEST_URI']);
$nid = end($nid);
echo “Node id:”.$nid;
Posted on October 20, 2010, in Drupal, Node id. Bookmark the permalink. 4 Comments.
Blog at WordPress.com. Theme: Mystique by digitalnature.
echo “Node id:”.arg(1);
I tried the same you have posted. It doesn’t work…
It solves problem when we have a classic link (node/12), but how I get a node id when I have alias for node (/contact.html) ?
Hi… I am out of station for now. I will reply shortly.