OK, I have been working on a website using WordPress and need to run a small linux script to generate registration codes for some software I developed. The customer enters a number generated by his computer onto this webpage:

http://www.blindbidpro.com/register/
here is an example of a computer code: BC79-2AAE-9628-8892

and a registration number is supposed to be generated. Here is a link to the software providers explanation of what needs to happen:

http://www.LockXLS.com/help/index.asp?topic=ht_keygen

I have this so far for the HTML coding for the registration form page, what you see on www.blindbidpro.com/register:

<html>
	<head>
	<style type="text/css">
		.myText {font-family:Verdana; font-size:10px;}
	</style>
	</head>
<body>

<div class="myText">
This page is available only to authorized customers. It allows to generate Activation Code for a product with
Product Code <b>My Product</b>. <div style="color:Red;font-weight:bold;">Please note, in working file you should not share Product Code to your customers.
It must be kept in secret.</div>
</div>

<div style="height:10px;"></div>

<div class="myText">
You can test this Activation Code on the locked file created in <b>Sample Project</b>,
which is included into LockXLS setup and described in the <b>Help | Getting Started</b> topic.
</div>

<div style="height:30px;"></div>

<div class="myText">Please, enter your Computer Code:</div>
<form action="gen_ac.php" method="post">
<table border="0">
<tr>
<td><input class="myText" id="sCC" name="sCC" type="text" style="width:200px;" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input class="myText" type="submit" value="Generate" /></td>
</tr>
</table>
</form>

</body>
</html>

And here is what I have for the PHP that is supposed to execute the script and generate the registration code:

<html>
	<head>
	<style type="text/css">
		.myText {font-family:Verdana; font-size:10px;}
	</style>
	</head>
<body>

<?php
$ActivationCode = shell_exec("./keygen 80311927548D0E53 sCC");
echo $ActivationCode;
?>

<div class="myText" style="width:100%;" align="center">

Thank you for using Blind Bid Pro!

</body>
</html>

The documentation on the providers website states that you just need to call the script (./keygen) and place the software code (80311927548D0E53) and computer code (sCC, from the HTML form) together and out comes the registration code. I think the script is running, but I am not getting any registration code to display.

Any help on this would be awesome, I really appreciate it!

    before calling the keygen script have you made sure that shell is in the correct directory?

    you should echo the output of the "pwd" command to see which directory shell is in, then you will most likely need to cd to the correct directory.

      I verified that the script is in the correct directory, but still not working 🙁 The shell is in the same directory as the two files that I posted earlier. Any more ideas? Thanks for the quick response!

        Write a Reply...