PHP Coding Help

Discussion in 'PHP' started by roopajyothi, May 12, 2010.

  1. #1
    I have written a licensing system for my script and now i saved it an file called lic.php in the root folder

    I am going to encrypt that with ioncube when giving to a client side
    and i will simply include

    include "lic.php" 
    PHP:
    to call the licensing system

    But the problem is when i simply include the code


    include "lic.php" 
    PHP:
    the user can directly remove the line to get the script worked
    So can some one help me in coding a script inside the lic.php which will make the script to prevent from running if the code i.e,


    include "lic.php" 
    PHP:
    is removed from the file

    Note that i will include the line


    include "lic.php" 
    PHP:
    in all the php files in my script

    Also do you face any issues with ioncube while running??

    Great Thanks!
     
    roopajyothi, May 12, 2010 IP
  2. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #2
    Put your some of your core classes/functions within lic.php, then if it's removed the script will no longer function.
     
    mfscripts, May 12, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3

    That's not possible since my core will be updated very soon
    So continuous encryption with ioncube costs a nice amount $$
    Any alternative suggestions for it??
     
    roopajyothi, May 12, 2010 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    But you will retain the php functions at your end, so if you change them, they wouldn't need to be encrypted ?

    Just on a side note, you would also only need to place the include instructions in the config file assuming each php file already requires the config file. ?
     
    MyVodaFone, May 12, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Umm...
    That's not possible as is said i periodically add new php variables to my script in config.php as you said
    Is there any other way that it can check whether the lic.php file is in the php file or not??

    Thanks :)
     
    roopajyothi, May 12, 2010 IP
  6. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #6
    Not sure I follow, the ioncube pricing is a single fee rather than a cost per encode.
     
    mfscripts, May 12, 2010 IP
  7. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Surely there are some crucial elements that remain constant though? Why not encrypt those along with your include, and then include the rest of the content which you regularly change?
     
    Rory M, May 12, 2010 IP
  8. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #8
    Thats well!!!
    But i can't say that those constant elements will be used in every pas of the script :)

    Also if it's constant once an a PHP Guys smells that he can easily add that in any page where the constant is require or used :)
     
    roopajyothi, May 12, 2010 IP
  9. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #9
    OK, why not encode all the php code? Separate your templates from your php code, then when you do a release you just run it through the encoder. The user can still mod the template as it's not encoded however they can't play around with the code. Far more secure that way.
     
    mfscripts, May 13, 2010 IP
  10. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #10
    Do you think encoding 185 PHP Files is economic???
    Tell me any alternative ideas please?? :)
     
    roopajyothi, May 13, 2010 IP
  11. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #11
    In short yes! As per my previous post...

     
    mfscripts, May 13, 2010 IP
  12. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #12
    Ah I see - are you using the $0.50 per job option on their website? You'd be far better buying the application, then you can encode an unlimited amount of times with no extra cost.
     
    mfscripts, May 13, 2010 IP
  13. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #13
    Yep! But as i said that if that product fails in the market then it will be loss of money!
    So any other function or options in php that can do the job :)
     
    roopajyothi, May 13, 2010 IP
  14. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #14
    Simply insert the core functionality of the script as a function then place that function within the ioncube'd file (lic.php), then if the included file is removed the script won't function.

    Example Usage:

    lic.php (needs to be encoded):
    
    <?php
    function content(){
    //if neccesary connect to your server etc...
    echo "your content goes here...";
    }
    ?>
    PHP:
    other.php (other non-encoded files...):

    <?php
    
    include "lic.php";
    
    content();
    
    ?>
    PHP:
     
    danx10, May 13, 2010 IP
  15. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #15
    Hmmm...
    Again you saved me!!
    You are great and Thanks a lot :)
     
    roopajyothi, May 13, 2010 IP
  16. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #16
    Ahh, did I miss something previously...

    Anyway, looks like you have a solution. Best of luck...
     
    mfscripts, May 14, 2010 IP
  17. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #17
    Thanks to you too! :)
     
    roopajyothi, May 14, 2010 IP