...

View Full Version : I need help protecting some code lines



unforgotten
06-17-2006, 12:31 AM
Hello,

I have a template I designed and coded for php-nuke platform that I would like to give for free but the only thing is that I want the person which will download the template to not be able to alter nor delete my copyrights. My copyrights are represented as an jpg image linking to my web-site. I am not a coder I only know the basics to get me around so I would like to know if there is a way to protect that jpg image displaying my copyrights from been alter or delete.

A friend of mine suggested something like this:

$keepimage = "dir/to/image/image.jpg";

and somewhere in the footer.php file to put in a rule like


if $keepimage === TRUE; { } else{ echo "THIS IMAGE IS MISSING";}

I am not a coder so I would like to know if there is a way to protect this and if so how?

There might not be a way to fully protect this as I have to give them the source code of the template so they can use it but than I would not mind at least making it harder for those regular people with not much of coding experience so they are unable to alter nor delete the copyrights on it due to their low coding knowledge.

Thanks!,
John

fci
06-17-2006, 01:14 AM
something like this...


if (!is_file('relative/path/to/file.jpg'))
die('file.jpg is missing!');

I would suggest using a file that is part of the template...

now, what would be funnier is if it emailed you when the image wasn't there.. or drop some tables.

unforgotten
06-17-2006, 01:47 AM
thanks a lot man, and you said e-mailed me... How can we do this?

fci
06-17-2006, 02:14 AM
thanks a lot man, and you said e-mailed me... How can we do this?

what information would you want emailed to you? maybe just the address of the server or something ?

unforgotten
06-17-2006, 02:31 AM
yup :) Just their domain also I was wondering if i could put this code on a file like that footer.html and encrypt that file using zend guard so its done and sealed :) ?

fci
06-17-2006, 03:15 AM
I would suggesting using eaccelerator as it is free:
http://eaccelerator.net/
unless you already have a copy of zend guard.. the downside of using either of those is not all servers would have those installed.

fci
06-17-2006, 03:20 AM
<?php

if (!is_file('path/to/your/file.jpg')) {
$to = 'your@address.com';
$subject = 'Uh-oh!';
$message = '';
foreach ($_SERVER as $k => $v)
$message .= "$k: $v\r\n";

mail($to, $subject, $message);
}

?>

Curtis D
06-17-2006, 03:34 AM
LOL @ fci : "drop some tables" hahaha. That's delightfully evil!

This is quite a problem for some developers. I actually encountered a similar situation when developing for a client. However, my phone home function uses fsockopen to connect to the actual mailing script on my server. There is a possibility that the user's server (or their host's, but that would be unlikely) doesn't have mail set up correctly, or not at all. I made it "phone home" if they try and use my software on different domains other than the one agreed upon in the contract. It's definitely not perfect, but it works.

unforgotten
06-17-2006, 03:57 AM
I would suggesting using eaccelerator as it is free:
http://eaccelerator.net/
unless you already have a copy of zend guard.. the downside of using either of those is not all servers would have those installed.

Yup... I heard zend guard generates some files that you upload with the encrypted files and they are the ones to show the encrypted codes so there is no need for servers to install anything?

fci
06-17-2006, 04:13 AM
Yup... I heard zend guard generates some files that you upload with the encrypted files and they are the ones to show the encrypted codes so there is no need for servers to install anything?

it needs to be compiled into PHP if it isn't already (for eaccelator), not sure how zend guard needs to be installed.

unforgotten
06-17-2006, 10:14 PM
Hey fci the script you gave me works great I was just wondering if there is a way so that it only sends me one e-mail per domain or any other way so that I know the domains using my template because what I'm thinking is adding this script you gave me and just set it up to a random image that does not exist just so that I know the domains using my template

fci
06-17-2006, 11:03 PM
have it create a temporary file in a directory.. this may be difficult to do though. or have it insert something into a phpbb table and have it check that on each page load.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum