amat123 Posted August 22, 2010 Share Posted August 22, 2010 I have a variable ($certificateID) in a script where string could be one of many values sample given below... <?php /* Settings for the e-junkie script, part of the HTML Executable Administration Kit This script is called by the e-junkie server: documentation available at http://www.e-junkie.com/ej/help.keygen.htm *** WARNING: ensure information is correct otherwise it won't work *** */ // e-junkie information $ejunkie_display_email = 'test@gmail.com'; // Your display email in e-junkie profile. $ejunkie_login_email = 'test@gmail.com'; // Your e-junkie login email $ejunkie_login_password_md5 = 'e32984cfdb4ccfa4855c752a0b103fda'; // md5 hashsum of your e-junkie password. // Can be generated online at http://www.adamek.biz/md5-generator.php // Ebook Details // Certificate ID = the "Unique Certificate Signature" of the registered certificate you want the user to activate. // See http://help.htmlexe.com/trialtools.htm $certificateID = '8EKzn601IkXH7ip4z'; ?> Each of my books has a unique ID value, and I need to specify the certificate ID for each. The support people who provided this script told me it could be done, but haven't told me how. Does anybody know how I can achieve this? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/211427-help-on-a-variable/ Share on other sites More sharing options...
premiso Posted August 22, 2010 Share Posted August 22, 2010 Without much more information all I can do is take a guess. You can set the certifcate ID from GET data if that is what you want: $certificateID = isset($_GET['certifcateid'])?$_GET['certificateid']:null; Then the url to that script would be http://www.yoursite.com/script.php?certificateid=8EKzn601lkXH7ip4z But I doubt that is what you want. You need to write a clearer explanation with how you plan on getting the certificate ID (where it is coming from). And if you have examples all the better. Quote Link to comment https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1102413 Share on other sites More sharing options...
amat123 Posted August 25, 2010 Author Share Posted August 25, 2010 Some background... Anybody who buys my book gets a generated reg key sent to them via ejunkie (third party service). I basically provide E-junkie with the URL of my code generator and then call my script (settings.php). All the order info is sent to the URL for each book in the order individually. This will include title, author, and the unique signature ($certificateID) I've assigned to each book. I've assigned different certificate IDs. This is used to check if the reg key entered is valid (and so as to ensure that the same reg key can't used to unlocked different books). The settings.php file calls another script (ejunkie.php - see below), which I assume passes all the info about the customer and the certificate ID. =============================================================== <?php /* Part of the HTML Executable Activation Kit Copyright G.D.G. Software 2009. All rights reserved. Redistribution of this code is stricly prohibited. This PHP script is for the e-junkie service available at http://www.e-junkie.com. HOW TO USE: - open the inc/settings.php and configure the variables. - in e-junkie, Product Configuration => enable "Send generated codes", click Next and in "Code Generator URL", enter the full URL to the ejunkiegen.php file placed on your server. */ include 'inc/settings.php'; include '../inc/init.php'; function addusertodatabase($name, $company, $certificate, $email, $comments) { // You could also even use the email address if you prefer. $cukey = $email; // We should actually check whether the record doesn't exist. $user = new HEAKUser(); // Store user info. $user->setUserkey($cukey); $user->setName($name); $user->setCompname($company); $user->setCertificate($certificate); $user->setEmail($email); $user->setComments($comments); $user->store(); // Return the registration key for future use (e.g. send it to the user by email). return $cukey; } // Verify that the call comes from e-junkie and not from somewhere else. if (strcmp($_POST['from_email'], $ejunkie_display_email) != 0) die("Error: this script cannot be called directly."); // Verify identity. if (strcmp($_POST['handshake'], md5($ejunkie_login_email.$ejunkie_login_password_md5)) != 0) die("Error: this script cannot be called directly or invalid security data"); // OK. Checking is done. // Adds user to the database $ret = addusertodatabase($_POST['first_name'].' '.$_POST['last_name'], $_POST['payer_business_name'], $certificateID, $_POST['payer_email'], 'From e-junkie, TXN-ID: '.$_POST['txn_id']); // Returns the key that the customer has to use in order to activate the publication. echo($ret); ?> ================================================================= Once the book is registered, the customer info is added into a database on my web server. Now according to the support team who wrote the settings.php (see my original post), I can mix certificates by editing the code but they haven't specified how. I know you can't just repeat the $certificateID variable over and over and assign a different unique certification signature to each instance of the $certificateID variable. How would you specify a different unique certification signature for each instance of a $certificateID? Quote Link to comment https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1103609 Share on other sites More sharing options...
AbraCadaver Posted August 25, 2010 Share Posted August 25, 2010 We need to see the code that determines what book the are buying/registering. Quote Link to comment https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1103616 Share on other sites More sharing options...
amat123 Posted August 25, 2010 Author Share Posted August 25, 2010 If you're talking about the code that E-junkie provide, I don't know what that is. All I can provide is this link: http://www.e-junkie.com/ej/help.keygen.htm under the heading of 'item specific .' are list of variables that pertain to the product/item You enter info about the products you're selling at the ejunkie website, thereby creating an inventory of all your stuff. Once entered, the buyer orders book through ebay, order goes via ejunkie - who have the info about the book you've created/added. Then ejunkie contacts my scripts parsing my order/book info to the license server. Quote Link to comment https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1103638 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.