title: calling php function from another file
body: <p>I am a PHP beginner and trying to write PHP classes that work with HTML and MySql.
  I am facing the following problem,
  I have created a class called DatabaseManager that contains the function get_value. This function simply returns a value. In another file, I am calling this function on a button click using java script. But the link doesn't seem to work between the two files....Can someone help me?
  thank you.</p>
  
  <p>Here's my file that contains the PHP class.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
  &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
  &lt;title&gt;Untitled 1&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;?php
  
  class DatabaseManager {
  
  private $value=1;
  
  
      public function get_value ()
      {   
      return value;
      }
  
  
  }
  
  /php&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and here's the other file that calls it.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;?php include("DatabaseManager.php"); ?&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function connect()
  {
  
  &lt;?php
  
  $database_manager= new DatabaseManager;
  echo "the value is" . $database_manager-&gt;get_value();
  
  ?&gt;
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;input type="button" value="Search " onclick="connect()"&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The name of the file that contains the function get_value is DatabaseManager.php</p>