PHP - Callback For License
Hey All,
I am looking for a way to setup licensing for a script i built, I am not to worried about the script being modified because I will have different tutorials on modifying things within the script, but I would like to restrict the use of the script to a Per Domain basis. I am looking for some resources or a foot in the right direction to achieve this. Basically, I am looking to setup an authentication code linked to a domain name. The user uploads the script, adds user/pass/authentication code. Are callbacks a way for me to setup a database with this info, and if the code doesn't match the domain it's not usable? perhaps by including an important file or command... thanks in advance for any info. Similar TutorialsHi, i want to sell php scripts/ready made sites in the near future on clickbank and on my sites and i wanted to know is it necessary to go to a copyrights office to protect my work? and to stop people from selling it? i was thinking to have a license txt file that tells buyer not to sell and etc instead of going to a copyrights office.i understand how copyrights work but i don't know if i can stop the person from selling and claiming my stuff without having ownership proof from the copyrights office. I might sell some stuff that doesn't have restrictions.thanks
I sell a webscript which is written in the php language. What I want to do is create a license for each user and limit the script installation to one domain only. Also, I want to distribute this same script as a free trial for 15 days. After that the user must upgrade. The script will call home to verify if the user has valid record in our server or not. What's the best and "hard to crack" way to distribute license in that way? Hi guys, I'm working on a customer appointment system using PHP where the users or admin adds customers to the system and book them an appointment for a specific date and time, and it all works fine. I've now been told the system should have a callback button, so for example, if a user is booking an customers appointment then at point the customer says am not interested at the moment call me back in 1months time for example, the user would click the callback button, keys in 1month into the text field and press save. the system would now store this information in the database but remove the customer from the customer list, then in 1months time that customer would appear back on the customer list and the admin can call back again. Making the customer appear back in 1months time or so seems very technical for me so would like you expertise on this one. Please I would more than welcome any input you may have or if you have a better or simplier idea. Thanks guys. Hello, I'm developing a script that includes an admincp. I want to know if anyone knows how to make it so when the administrator goes to the update section of the admin cp, it checks the scripts current version and displays the latest version released, then they have an option to install the latest version, using php to release the files needed with a list of files on the update server. Is there any possible way to do this? Is it possible to pass a callback function to other class's method?
Is what I am attempting to do a bad idea?
Thanks
<?php class validate { public function __construct($data,$callback) { //A bunch of script goes here, and I don't want to duplicate it if($callback) { //Use $callback function to modify $data } } } class controller { public function savePage() { //A bunch of script goes here, and I don't want to duplicate it $validate=new validate(array('hello'),$this->callback); } } class controller_page1 extends controller { public function callback() { //script which will be used to modify future $data } } ?> Hello there I was wondering if anyone could help me with this problem See I running a site where people can log in, and everytime they log in, a cookie is set, based on their username. so when a user complete a offer, my website send a link to a Network. (example: www.Network.com/offer=9384736) When the Network has receive the link with the offer (offer=9384736) , then they will do a postback call to my website. Example my site is www.mywebsite.com/PB.php/offer=9384736 Then my postback script will get the offer and check for the cookie when a postback call is made from the network to my script. So what i want is when someone giving me a postback call, a script will check for the cookie ( the user who have complete a offer) I was just think just to put this in echo $_COOKIE["user"];, but that dident work, because it was the network who called my postback. So have anyone any idea how i can do this? Would really appericate if someone could help me out Thanks! I have a small site that is based around maxbounty offers (incentives for leads as such) and I can't seem to work out a good way to adjust the database entry for 'currency' when the callback is performed.
Basically, I just need help finding a (fairly) secure php script (http://www.maxbounty.../help.cfm?id=12) that connects to my database and adjusts the user's balance to a certain amount on the call back.
In addition, one to deduct from the balance on call would also help heaps!
Is anybody able to help out?
I have a file I'm trying to split up to separate some HTML from PHP code. Everything works fine when all of the code is together but when I split it into two files the two call back functions in the html form will not work. No errors and when I view the page source my file is included with the form. Any help would be appreciated. Here is the file that has the include statement. add_action('admin_menu', 'sampleoptions_add_page_fn'); // Add sub page to the Settings Menu function sampleoptions_add_page_fn() { add_options_page('Options Example Page', 'Options Example', 'administrator', __FILE__, 'options_page_fn'); } function options_page_fn() { ?> <?php include('options_form.php'); ?> <?php } Here is the options_form.php file code. Code: [Select] <div class="wrap"> <div class="icon32" id="icon-options-general"><br></div> <h2>My Example Options Page</h2> Some optional text here explaining the overall purpose of the options and what they relate to etc. <form action="options.php" method="post"> <?php settings_fields('plugin_options'); ?> <?php do_settings_sections(__FILE__); ?> <p class="submit"> <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" /> </p> </form> </div> I'm guessing that it may have to do with this line of code, due to the page parameter but I don't know that much about that area. <?php do_settings_sections(__FILE__); ?> Thanks in advance Probably missing something really stupid here. My usort function: private function compareLastName($x, $y) { if($x['Name'] == $y['Name']) { return 0; } elseif ($x['Name'] < $y['Name']) { return -1; } else { return 1; } } is being called in this function, same file: public function loadAll() { //various SQL stuff $arrayNoNulls = $stmt->fetchAll(); //various SQL stuff $arrayNulls = $stmt->fetchAll(); $arrayAll = array_merge($arrayNoNulls, $arrayNulls); usort($arrayAll, "compareLastName"); print_r($arrayAll); } The page outputs the unsorted array, preceded by the warning. What am I missing? <td> <button onclick="alertdialog()"><span class="glyphicon glyphicon-trash"> </span></button></td> <script> function alertdialog(){ window.confirm("Are you sure you want to delete this post?"); } </script> This is my code. I need to have a callback to a PHP script when a user decides to delete a post. I think html POST is the most unobtrustive way to do this. What's the easiest / most robust way to send data to a script when the user clicks OK? Appreciated. Mark I am getting
set_exception_handler() expects the argument (static BugReporter::exception_handler) to be a valid callback in ....
The line is set_exception_handler(array('static BugReporter', 'exception_handler')); BugReporter is a class - eg
class BugReporter {
}
exception_handler is a function withing the class
I have no idea what is wrong. I haven't come across set_exception_handler() before
Can anyone see what is wrong - Thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=343702.0 I have a listener which executes a HTTP request to a remote API before the User entity is persisted and uses the response to set one of the entity's properties. It will also listen for update and remove and will make the appropriate HTTP request to the API but will not modify the entity. All works as desired... Almost. If when persisting the entity, I have some error, the remote API and my application become out of sync. I wish to change my application to perform a second call to the API if an error occurs and reverse the previous call. My thoughts on how to implement a Place a try/catch block when executing the query. Don't like this approach. Add an ExceptionListener which somehow retrieves the entity and makes the applicable changes. Maybe part of the solution, but too complicated to be the full solution. When adding, updating, or deleting a user from the remote API under UserListener's three methods, adding a callback which gets executed upon a PDOException. I think this is the best approach and expanded my thoughts below.
<?php namespace App\EventListener; use Doctrine\Persistence\Event\LifecycleEventArgs; use App\Service\HelpDeskClient; use App\Entity\AbstractUser; final class UserListner { private $helpDeskClient; public function __construct(HelpDeskClient $helpDeskClient) { $this->helpDeskClient = $helpDeskClient; } public function prePersist(AbstractUser $user, LifecycleEventArgs $event) { $this->helpDeskClient->addUser($user); //$user will be updated with the HTTP response } public function preUpdate(AbstractUser $user, LifecycleEventArgs $event) { $this->helpDeskClient->updateUser($user); } public function preRemove (AbstractUser $user, LifecycleEventArgs $event) { $this->helpDeskClient->deleteUser($user); } } Okay, how do I actually do this? Was thinking of modifying UserListner as follows: //... use Symfony\Component\HttpKernel\KernelEvents; final class UserListner { // ... public function prePersist(AbstractUser $user, LifecycleEventArgs $event) { $this->helpDeskClient->addUser($user); $event->getObjectManager()->getEventManager()->addEventListener(KernelEvents::EXCEPTION, function($something) use($user) { // Use $this->helpDeskClient to reverse the changes }); } // Similar for update and remove }
But when trying this approach, I get a PDOException, but my callback never gets excecated. I've also tried replacing KernelEvents::EXCEPTION with '\PDOException' (note the quotes) with no success. Any ideas what I should be doing differently? Maybe some totally different approach? I suppose I could make the request to the API after the DB query is complete for updating and deleting, but not for adding. |