i have forget how to write into a config file with the form when getting $do and $action write.
Anyway this is just a begining but now if i enter something into the form typ=text i wont be writed into the license.inc.php. Should be nice if someone could just corect it 4 me.
<?php
include ("phpclient.php");
require_once ("license.inc.php");
global $license_active, $license_key, $license_name_first, $license_name_last;
$server_url = "http://license.panthera.acespace.co.uk/server/licenseserver.php";
$license_array = processLicense($server_url);
if (isset($_GET["do"])) $do=$_GET["do"];
else $do = "";
if (isset($_GET["action"]))
$action=$_GET["action"];
if ( file_exists("install.license") && $license_active == 0)
{
echo "Decoded output:<BR>";
// Server version
echo ($license_array[0] == null) ? "Empty<BR>" : $license_array[0]."<BR>";
// Upgrade now
echo ($license_array[1] == null) ? "Empty<BR>" : $license_array[1]."<BR>";
echo '<b>Your license: </b>';
// License message
echo ($license_array[2] == null) ? "Empty<BR>" : $license_array[2]."<BR>";
// Upgrade URL
echo ($license_array[3] == null) ? "Empty<BR>" : $license_array[3]."<BR>";
// License key
echo ($license_array[4] == null) ? "Empty<BR>" : $license_array[4]."<BR>";
// License attributes
echo ($license_array[5] == null) ? "Empty<BR>" : $license_array[5]."<BR>";
// License state
echo ($license_array[6] == null) ? "Empty<BR>" : $license_array[6]."<BR>";
echo '<br>Your entered licenesekey in the config is: ';
print ("<b>$license_key</b>");
echo '<br>';
echo 'Please update it by add the new one it into the following box bellow';
print("<br><form action=\"client2.php?&do=config&action=write\" name=\"config\" method=\"post\">License: <input type=text name=license size=30 value=$license_key><br>Firstname: <input type=text name=name size=20><br>Lastname: <input type=text name=lastname size=20><br><input name=write type=submit value=Update></form>");
@chmod("install.license",0777);
@unlink("install.license");
}
elseif ($license_active == 0 && $license_key == none)
{
echo "Decoded output:<BR>";
// Server version
echo ($license_array[0] == null) ? "Empty<BR>" : $license_array[0]."<BR>";
// Upgrade now
echo ($license_array[1] == null) ? "Empty<BR>" : $license_array[1]."<BR>";
// License message
echo ($license_array[2] == null) ? "Empty<BR>" : $license_array[2]."<BR>";
// Upgrade URL
echo ($license_array[3] == null) ? "Empty<BR>" : $license_array[3]."<BR>";
// License key
echo ($license_array[4] == null) ? "Empty<BR>" : $license_array[4]."<BR>";
// License attributes
echo ($license_array[5] == null) ? "Empty<BR>" : $license_array[5]."<BR>";
// License state
echo ($license_array[6] == null) ? "Empty<BR>" : $license_array[6]."<BR>";
echo '<br>Your entered licenesekey in the config is: ';
print ("<b>$license_key</b>");
echo '<br>';
echo 'Please update it by add it into the following box bellow';
print("<br><form action=\"client2.php?&do=config&action=write\" name=\"config\" method=\"post\">License: <input type=text name=license size=30 value=$license_key><br>Firstname: <input type=text name=name size=20 value=$license_name_first><br>Lastname: <input type=text name=lastname size=20 value=$license_name_last><br><input name=write type=submit value=Update></form>");
}
//123
elseif ( $license_key == $license_array[4] && $license_active == 1)
{
echo '<font color=green>YOUR LICENSE IS VAILD</font> <br>';
echo 'Your License is: <br>';
print ("$license_array[4]");
echo '<br> Registerd to: <br>';
print ("$license_name_first $license_name_last");
echo '<br>';
echo 'If you have another license code or need to update your code<br>
you can do it by adding the new one bellow and click update<br>';
print("<br><form action=\"client2.php?&do=config&action=write\" name=\"config\" method=\"post\">License: <input type=text name=license size=30 value=$license_key><br>Firstname: <input type=text name=name size=20 value=$license_name_first><br>Lastname: <input type=text name=lastname size=20 value=$license_name_last><br><input name=write type=submit value=Update></form>");
echo '<br><br>';
echo "Decoded output from the LicenseServer:<BR>";
// Server version
echo '<b>License Server Version: </b>';
echo ($license_array[0] == null) ? "Empty<BR>" : $license_array[0]."<BR>";
// Upgrade now
echo ($license_array[1] == null) ? "Empty<BR>" : $license_array[1]."<BR>";
// License message
echo ($license_array[2] == null) ? "Empty<BR>" : $license_array[2]."<BR>";
// Upgrade URL
echo ($license_array[3] == null) ? "Empty<BR>" : $license_array[3]."<BR>";
echo '<b>Your License Key: </b>';
// License key
echo ($license_array[4] == null) ? "Empty<BR>" : $license_array[4]."<BR>";
// License attributes
echo ($license_array[5] == null) ? "Empty<BR>" : $license_array[5]."<BR>";
echo '<b>License Status:</b> ';
// License state
echo ($license_array[6] == null) ? "Empty<BR>" : $license_array[6]."<BR>";
}
else
{
echo '<font color=red>WARNING YOUR LICENSE IS INVAILD</font> <br>';
echo 'if u not have messed with the license system, please visit this url
<a href=http://license.panthera.acespace.co.uk/help target=_blank>License Help</a> for more info.';
}
//123
if ($do=="config" && $action=="write")
//elseif ($do=="config" && $action=="write")
{
if (isset($_POST["write"]) && $_POST["write"]==update)
{
@chmod("license.inc.php",0777);
// if I get an error chmod, I'll try to put change into the file
$fd = fopen("license.inc.php", "w") or die(CANT_WRITE_CONFIG);
$foutput.= "\$GLOBALS[\"license_key\"]=".$license_key.";\n";
$foutput.= "\$GLOBALS[\"name\"]=".$license_name_first.";\n";
$foutput.= "\$GLOBALS[\"lastname\"]=".$license_name_last.";\n";
fwrite($fd,$foutput) or die(CANT_SAVE_CONFIG);
fclose($fd);
@chmod("license.inc.php",0744);
redirect("client2.php");
exit;
}
}
?>
Should be awesome if someone could help me with this 🙂
Cheerz