Include a file inside another secretly?

Discussion in 'Programming' started by Jake-Johnson, Nov 28, 2008.

  1. #1
    I am going to sell a template.

    I don't want people able to see my source code, but I want a live demo.

    If there is an "index.php" and a "demo.php", how would I secretly make demo.php inside of index.php without users knowing it?

    Thank-you,
    Jake.
     
    Jake-Johnson, Nov 28, 2008 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    If you want to do it using php

    then

    <?php include("demo.php"); ?>
    Code (markup):
    Rep is appreciated
     
    Bohra, Nov 28, 2008 IP
  3. Jake-Johnson

    Jake-Johnson Peon

    Messages:
    839
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Doesn't this just integrate the HTML from the other file into your file and makes the source of demo.php totally viewable? So if you go View > Source you can't see the Demo.php file or name anywhere? Thanks.
     
    Jake-Johnson, Nov 28, 2008 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Than u can just use iframe but still if people see source they can see u are using iframe
     
    Bohra, Nov 28, 2008 IP
  5. peter_anderson

    peter_anderson Notable Member

    Messages:
    3,382
    Likes Received:
    152
    Best Answers:
    0
    Trophy Points:
    240
    #5
    Use a javascript encoder.
     
    peter_anderson, Nov 29, 2008 IP
  6. Limotek

    Limotek Peon

    Messages:
    165
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    A javascript encoder is probably the best thing although nothing will foolproof against someone who's determined.

    A common trick is to include demo.php and add part of your layout within this file. Then encrypt this code. You'll find that people won't be able to edit the demo.php easily as it's encrypted and if they try to remove it, the layout is broken as some of the code is deleted with it.
     
    Limotek, Dec 1, 2008 IP