Jump to content

aileia

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aileia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks cognito, I found the solution in drupal's forum, which states globals should be also defined in the main part of the php code. Then it worked fine. Thank you for your help.
  2. thanks, cognito. Do you know drupal?
  3. No, it doesn't change anything. Actually, doesn't it necessary for only string inputs, for numbers don't we just write it without ".
  4. Hi Cognito, I tried it with echo, it gives the same thing, I can't define the variable in the function.
  5. I am using drupal 4.7x. I write the following code in the blog entry <?php $life=42; function meaningOfLife() { global $life; print "The meaning of life is $life<br />"; } meaningOfLife(); ?> and then select php code as input format. The result turn out to be The meaning of life is which is wrong, apparently, what i want is The meaning of life is 42. This is an example given in php.net so it should be correct. Moreover since the function is executed, it confirms I installed php. However I can't define the variable $life in the function. It is printing the text, so it is calling the function however it is not calling the variable. Can anyone tell me what went wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.