Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/211427-help-on-a-variable/
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1102413
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1103609
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/211427-help-on-a-variable/#findComment-1103638
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.