I get the following error when I point to http://localhost/testsite/get-data.php

Fatal error: Call to undefined function drupal_to_js() in C:\xampp\htdocs\testsite\get-data.php

get-data.php is just has one line of code and it is in testsite root directory

<?php
   print drupal_to_js(array('name'=>'Sky Line'));
?>

This is just a code added for debugging. What is the source of the error message?

Comments

WorldFallz’s picture

an external php script has no way of knowing what the drupal "drupal_to_js" function is. There's a way to let external scripts have access to the drupal api, but I don't remember what it is... googling around should find it.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz