Magento Coding Solutions

magento call a .phtml file in template

 .phtml file location is "opc/onepage/incart.phtml" is location

echo $this->getLayout()->createBlock('core/template')->setTemplate('opc/onepage/incart.phtml')->toHtml();

how to get cart total in custom php page in magento

<?php
    $mageFilename = '../app/Mage.php';
    require_once $mageFilename;
    Mage::init();
$coreSession = Mage::getSingleton('core/session', array('name' => 'frontend'));

 $cart = Mage::getModel('checkout/cart')->getQuote();
 $pricecartTotal=0;
    foreach ($cart->getAllItems() as $item) {
       $productName = $item->getPrice();
  $pricecartTotal=$pricecartTotal+$item->getPrice();
       //echo $productPrice = $item->getProduct()->getPrice();
       //echo $productName = $item->getProduct()->getName();
    }

/* $cartObjTotal= Mage::getModel('checkout/cart')->getQuote();
$pricecartTotal=0;
foreach($cartObjTotal->getAllItems() as $item) {
$pricecartTotal=$pricecartTotal+$item->getPrice();
} */
echo number_format($pricecartTotal,2)
?>