1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Includes Alternative to external HTML FIle

Discussion in 'PHP & Perl' started by Ste Fishkin, Jul 15, 2012.

  1. Ste Fishkin

    Ste Fishkin "I'm watching you.." - Apricot Jr. VIP Premium Member UnGagged Attendee

    Joined:
    May 14, 2011
    Messages:
    1,836
    Likes Received:
    8,706
    Occupation:
    Rands Sex Slave
    Location:
    England
    I'm building websites for clients.


    As part of the contract I can add a 'built by' line to the footer unless they pay to remove this. I want control the line of code that does this and I will be storing it on my own server so the client cannot pay the lower rate then remove it (had people do this, want to fight it.)


    Something like this


    Code:
    <?php include 'http://www.link-to.com/file.html';?>
    

    This will then allow me to change the footer text or remove it completely if I feel like it in the future (if they pay) without accessing their webspace. This is what I want out of this, they get a great website and a good price, and I get a link I can control and point where I like (If I ever change my portfolio URL)


    Lets not get into the morals of this, if people don't like it I am not making them use it, they can pay to remove it and its not much (10% of the total cost)


    BUT


    problem with this is most hosts see including external files this way as a security problem and rightly so.


    So is there a way round this? I want ultimate and exact control over this line in the footer and hosting the text in my own webspace is the perfect answer to this in my head.. but with PHP this is a problem (out of 5 hosting providers I tried it on 4 did not work :/)


    I need another option...


    I've been up all night and my heads a little mashed, the answer could be easy as hell but I can't see it right now :/


    Any help would be much appreciated.
     
  2. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,148
    The only semi-reliable solution is to use an encoder like Ioncube.
     
  3. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    As Jazz said, use Ioncube. Should only cost you like 15 or 30 cents to use the online encrypter.

    You could use the less secure method of using multiple encoding schemes with an eval statement. In the eval'd code you can put a variable that has to exist and if it doesnt, the site doesn't work.
     
  4. ADHD-Dude

    ADHD-Dude Power Member

    Joined:
    Apr 17, 2010
    Messages:
    592
    Likes Received:
    119
    I would not buy a site that has encoded code. Usually they are a backdoor, sure there are encoded platforms but they are for a reason, they are worth it
     
  5. t0.sh

    t0.sh Registered Member

    Joined:
    Jun 6, 2012
    Messages:
    55
    Likes Received:
    24
    Location:
    UVB-76
    There is no way have total control over it, no matter how many ways you want to code this. Even using an encoder like ioncube doesn't provide total control since it can be decrypted. The encrypted code could always be removed, unless you want to encrypt the whole document, but I'd doubt most people would want to purchase custom scripts if they're encrypted.
     
  6. fluffypony

    fluffypony Newbie

    Joined:
    Mar 31, 2012
    Messages:
    21
    Likes Received:
    1
    As mentioned before, there is no way except to encode the entire file. That having been said, if you encode the file, then there is nothing stopping you from running a PHP SOAP service on your server that serves up the HTML for the "powered by" line, and then having the client site grab that. Bear in mind that you will be introducing lag this way - Apache will be unable to send data to satisfy a client request until the poll to your webservice has been successfully completed.
     
  7. phpdecoder

    phpdecoder Newbie

    Joined:
    Sep 1, 2012
    Messages:
    23
    Likes Received:
    0
    Home Page:
    You can try various encryption methods,but it's true that any encryption can be break.
     
  8. stratocentric

    stratocentric Junior Member

    Joined:
    Mar 12, 2012
    Messages:
    122
    Likes Received:
    35
    You could also just raise your prices 10% across the board and not worry whether they leave the link or not. I usually put something in the footer and most clients never say a thing. The ones that do complain get it removed.

    Obfuscating with javascript is not going to provide you with any link and like the others said, obfuscated code can be removed.