By briantes on
Hello.
I need to add cck nodes from php, but creating the php file from the begining, that is, this file will be called from a PC application and a it submits POST method (to pass some parameters).
I know how to add cck nodes using node_save etc, but I don't know how to add this function to the php file in order to use it.
What includes or stuff should I add to the php file in order to use node_save and other drupal api functions?
Thanks
Comments
This probably belongs in the
This probably belongs in the Module Development forum. At any rate, I think the Services API will help you achieve this.
Yes. I agree with you. I
Yes. I agree with you. I moved it to Module Development forum.
Hi, You need to add this two
Hi,
You need to add this two lines at the start of your script, so that all drupal functions are available to your php script, remember this script will only if you place it in the root folder of drupal. I hope this helps.
Regard
Sagar
Acquia certified Developer, Back end and Front specialist
Need help? Please use my contact form
Thanks for your answer. I was
Thanks for your answer. I was a little lost.
I'll try it. But only one question, Could I put the php file into another directory? I should only change the path for "required_once", no?
thanks
Hi, I think you can use it
Hi,
I think you can use it inside any directory, Try this
Acquia certified Developer, Back end and Front specialist
Need help? Please use my contact form