If you are running this as a standalone script, you will need to initialise the Magento environment first.
Put the following at the start of your PHP file:
==================
<?php
define("MAGE_BASE_DIR", '/path/to/magento'); require_once MAGE_BASE_DIR . '/app/Mage.php';
Mage::app(0);
This should remove problems with the Mage class not being found.
<code>
<blockcode>
<apache>
<bash>
<c>
<cpp>
<drupal5>
<drupal6>
<java>
<javascript>
<perl>
<php>
<python>
<ruby>
<xml>
<foo>
[foo]
More information about formatting options
If you are running this as a standalone script, you will need to initialise the Magento environment first.
Put the following at the start of your PHP file:
==================
<?php
define("MAGE_BASE_DIR", '/path/to/magento');
require_once MAGE_BASE_DIR . '/app/Mage.php';
Mage::app(0);
==================
This should remove problems with the Mage class not being found.