<?php
//session_start();
//include("dbf.php");
$oDOM = new DOMDocument();
$oDOM->loadXML(file_get_contents('http://websms.amootco.ir/Status.aspx?Username=no_tabatabaie&Password=98521456'));

foreach ($oDOM->getElementsByTagName('Reports') as $oBookNode)
{
  $mandeh=mysql_real_escape_string($oBookNode->getElementsByTagName('Balance')->item(0)->nodeValue);
  $fprice=mysql_real_escape_string($oBookNode->getElementsByTagName('UnicodePrice')->item(0)->nodeValue);
  $eprice=mysql_real_escape_string($oBookNode->getElementsByTagName('AnsiPrice')->item(0)->nodeValue);
  mysql_query("INSERT INTO `msgsms` (`mandeh`, `fprice`,`eprice`,`user`,`city`) VALUES ('$mandeh', '$fprice','$eprice','{$_SESSION['user']}','{$_SESSION['city']}')") or die( mysql_error());
}
?>