profile.php
<section id="blog-feature">
<div class="container">
<form method="post">
<input name="nameOfLicenseKey" type="text" placeholder="Name of license key">
<!-- <input name="LicenseKey" type="text" placeholder="License key">
--> <input id="activate-button" name="add" type="submit" value="add">
</form>
<br>
<br>
<br>
<form method="post">
<input id="activate-button" name="getLicenseKey" type="submit" value="License key">
</form>
</div>
<!-- -->
<?php
if (isset($_POST['getLicenseKey'])) {
$json = $firebase->get(DEFAULT_PATH . "/ARCusers/$id/License");
$json_ary = json_decode($json, true);
foreach ($json_ary as $licenseKey => $license) {
?>
<a type="submit" name="test"; href="licensekey.php?id=<?php echo $id ?>&licensekeyname=<?php echo $licenseKey ?>"
data-toggle="modal" data-target="#Expiration" class=""><?php echo $licenseKey ?></a>
<br>
<?php
}
}
?>
<div class="modal fade" id="Expiration" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content" style="text-align: center">
</div>
</div>
</div>
</section>
licensekey.php
<?php
include "dbsettings.php";
$id = $_GET['id'];
$licensekeyname = $_GET['licensekeyname'];
$json = $firebase->get(DEFAULT_PATH . "/ARCusers/$id/License/$licensekeyname");
$json_ary = json_decode($json, true);
foreach ($json_ary as $licenseKey) {
echo "Name of license key: ".$json_ary['Name'];
echo "<br>";
echo "License key: ".$json_ary['license key'];
echo "<br>";
echo "License key expiration date: ".$json_ary['license key date'];
break;
}