title: Php function not define
body: <p>I have a function with a default value of nothing, example:</p>
  
  <pre><code>function output_message($message="") {
    if (!empty($message)) { 
      return "&lt;p class=\"message\"&gt;{$message}&lt;/p&gt;";
    } else {
      return "";
    }
  }
  </code></pre>
  
  <p>I then am echoing the message on my log in form.  If there are errors it will display a message but if there are no errors it should just do nothing.  When my page loads it says my function is not defined.  Below is my html page.</p>
  
  <pre><code>&lt;?php
  require_once("../../includes/functions.php");
  require_once("../../includes/session.php");
  require_once("../../includes/database.php");
  require_once("../../includes/user.php");
  
  if($session-&gt;is_logged_in()) {
    redirect_to("index.php");
  }
  
  // Remember to give your form's submit tag a name="submit" attribute!
  if (isset($_POST['submit'])) { // Form has been submitted.
  
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
  
    // Check database to see if username/password exist.
    $found_user = User::authenticate($username, $password);
  
    if ($found_user) {
      $session-&gt;login($found_user);
      redirect_to("index.php");
    } else {
      // username/password combo was not found in the database
      $message = "Username/password combination incorrect.";
    }
  
  } else { // Form has not been submitted.
    $username = "";
    $password = "";
  }
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Photo Gallery&lt;/title&gt;
      &lt;link href="../stylesheets/main.css" media="all" rel="stylesheet" type="text/css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="header"&gt;
        &lt;h1&gt;Photo Gallery&lt;/h1&gt;
      &lt;/div&gt;
      &lt;div id="main"&gt;
          &lt;h2&gt;Staff Login&lt;/h2&gt;
          &lt;?php echo output_message($message); ?&gt;
  
          &lt;form action="login.php" method="post"&gt;
            &lt;table&gt;
              &lt;tr&gt;
                &lt;td&gt;Username:&lt;/td&gt;
                &lt;td&gt;
                  &lt;input type="text" name="username" maxlength="30" value="&lt;?php echo htmlentities($username); ?&gt;" /&gt;
                &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                &lt;td&gt;Password:&lt;/td&gt;
                &lt;td&gt;
                  &lt;input type="password" name="password" maxlength="30" value="&lt;?php echo htmlentities($password); ?&gt;" /&gt;
                &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                &lt;td colspan="2"&gt;
                  &lt;input type="submit" name="submit" value="Login" /&gt;
                &lt;/td&gt;
              &lt;/tr&gt;
            &lt;/table&gt;
          &lt;/form&gt;
      &lt;/div&gt;
      &lt;div id="footer"&gt;Copyright &lt;?php echo date("Y", time()); ?&gt;, Kevin Skoglund&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php if(isset($database)) { $database-&gt;close_connection(); } ?&gt;
  </code></pre>
  
  <p>I am not sure why I am getting this error because in my function i am setting the default value of $message in the function. output_message($message="").</p>
  
  <p>Can someone look at my code and tell me why it is telling me my function is not defined. Thanks.</p>