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.
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.
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Notify me of new posts via email.
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 288 other followers
Blog at WordPress.com.