title: Fatal error: Cannot redeclare a function previously declared PHP
body: <blockquote>
    <p>Fatal error: Cannot redeclare getIp() (previously declared in C:\xampp\htdocs\ecommerce\functions\functions.php:12) in C:\xampp\htdocs\ecommerce\functions\functions.php on line 21</p>
  </blockquote>
  
  <p>This is the error I received when creating a checkout page</p>
  
  <pre><code>function getIp() {
      $ip = $_SERVER['REMOTE_ADDR'];
  
      if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
          $ip = $_SERVER['HTTP_CLIENT_IP'];
      } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
          $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
      }
  
      return $ip;
  }
  </code></pre>
  
  <p>this is the function it refers to</p>
  
  <pre><code>&lt;?php 
    if(!isset($_SESSION['customer_email'])) {
  
      include("customer_login.php");
  
    }else{
  
      include("payment.php");
    }
  ?&gt;
  </code></pre>
  
  <p>and it happens after this is not set function</p>