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
This is the error I received when creating a checkout page
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;
}
this is the function it refers to
<?php
if(!isset($_SESSION['customer_email'])) {
include("customer_login.php");
}else{
include("payment.php");
}
?>
and it happens after this is not set function