By webpoga on
I searched and failed, Please give me an example on what code to input inside..
Another Question:
Can I query the database and return values?
Actually, I already did that and what a surprise! It destroyed my drupal, so I removed the field manually in the database also truncated the cache table where it was being saved automatically. So, does inserting such database queries inside that "allowed values php code" field makes my drupal crash?
Comments
I should think there was a
I should think there was a problem with your code, or how you wrote it into the field? Perhaps this article might be of assistance: http://www.lullabot.com/articles/drupal_input_formats_and_filters
If you need to insert code there you should try out your code as a plain php file, just put it in the root of your drupal installation and point directly to it in the address field of your browser. If the code works in the PHP file, it will work in drupal.
For that excersize also look into bootstrap.inc, that's a way to include the Drupal API in a php file. (At least I think it was bootstrap.inc :)
Paul K Egell-Johnsen
Paul K Egell-Johnsen
Thanks a lot! I guess it is
Thanks a lot! I guess it is my fault since I am not reading instructions carefully. It says there that I should not include
, where I guess (because I don't actually remember) I put those. You reply explains it all.Thanks.
Dont
My guess is - If you dont know what to put in there, dont use it.
It is for fairly advanced use...
--
dafa
...
BTW, for practical examples, see:
Getting the 'allowed values' from a DB table, or from another node's body.
Thanks! really appreciated
Thanks! really appreciated it! bookmarked it for future use. Btw, tried them both and it works! Thanks!