I want a place to set the credentials needed for an API,
Right now I have rewritten the credentials in every php script that accesses the API, but If the credentials change later, I have to go through every script to make the change.
I need a place where I can define the credentials once and access then from any script inside of drupal. Maby using the term "global" was incorrect, but thats what Im trying to do.
In Drupal one would typically make a settings/configuration page for setting the values for the API. For system configuration forms they often end with a return of system_settings_form($form); in which case the values are stored in the variable table using the form element names. One can then use variable_get() to retrieve the values.
Comments
Using globals is a bad
Using globals is a bad practice so I wonder what you are actually trying to do.
I want a place to set the
I want a place to set the credentials needed for an API,
Right now I have rewritten the credentials in every php script that accesses the API, but If the credentials change later, I have to go through every script to make the change.
I need a place where I can define the credentials once and access then from any script inside of drupal. Maby using the term "global" was incorrect, but thats what Im trying to do.
In Drupal one would typically
In Drupal one would typically make a settings/configuration page for setting the values for the API. For system configuration forms they often end with a return of system_settings_form($form); in which case the values are stored in the variable table using the form element names. One can then use variable_get() to retrieve the values.