Jump to content

JkennG

New Members
  • Posts

    1
  • Joined

  • Last visited

JkennG's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have 2 php files and in my index file im just getting a function but its returning 2 echo's instead of just one. index.php <?php require_once 'config_db.php'; require_once 'database_class.php'; $db = new database($conDB); echo '<br/>'; $fetch = $db->getData(); ?> other file <?php include('index.php'); class database{ function __construct($conDB) { $this->conDB = $conDB; } function getData() { $clientIP = $_SERVER['REMOTE_ADDR']; echo $clientIP; $query = $this->conDB->prepare(" INSERT INTO `ip log` (`Address`) VALUES ('$clientIP') "); $query->execute(); } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.