I want pass node id to webform.
I have added code field with diplay suite like these
<a href="http://www.bedmyboat.com/?q=node/119?id=<?php print $node->$nid; ?>">Contattaci</a>
But show an error
Notice: Undefined variable: node in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).
Notice: Undefined variable: nid in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).
Notice: Trying to get property of non-object in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).
Can you help me ?

Comments

Lose the $ sign from nid -

Lose the $ sign from nid - nid is a property of the $node object, not a variable.

Should be $node->nid

also, make sure you have access to node - it's hard to know without knowing where you are calling the above code.
Does print_r($node) give you any results?

Hope that helps

Merry Christmas

<a href="http://www.bedmyboat.com/?q=node/119?id=<?php print_r($node)->nid; ?>">Contattaci</a>

I have try these but show error

Notice: Undefined variable: node in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).
Notice: Trying to get property of non-object in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).

Why ?

i can't pass nid to webform

i can't pass nid to webform.
I try use:
<a href="http://www.bedmyboat.com/?q=node/119?id=<?php print_r($node)->nid; ?>">Contattaci</a>
but have error

Notice: Undefined variable: node in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).
Notice: Trying to get property of non-object in eval() (line 1 of /home/bedmyboa/public_html/modules/php/php.module(80) : eval()'d code).

Should be

Should be print_r($node->nid);

Why are you putting ->nid outside of the brackets?

don't understand

my situation:
I have a list of ads, and I wish to use the information for each announcement in form.
Should I create a link to the webform field that pass me the information of the announcement to the form before sending.
Use drupal 7, display suite, token, webform.

Have a google around for

Have a google around for pre-filling webform field component from URL, something like this:
https://www.google.co.uk/search?q=drupal+webform+prefill+from+url&ie=UTF...
I'm away from my main computer so can't give you a long answer, although what you're asking is possible.

Also, have a quick search of

Also, have a quick search of the webform issue queue, you could also post there, you'll get more help there as opposed to in the general forum as this question is webform specific.

One last thing, I think you

One last thing, I think you can get webform to do this by default with no extra code.
Here's an event registration we did that uses the technique.

Have a look at this page http://www.fitzpatricklearning.com/events/healing-hands-wound-management and click the register for this event.
Then look at the url

Thank you for help

Thank you i look for webforme