Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-16-2006, 11:31 PM   PM User | #1
unforgotten
New to the CF scene

 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
unforgotten is an unknown quantity at this point
I need help protecting some code lines

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:
Code:
$keepimage = "dir/to/image/image.jpg";
and somewhere in the footer.php file to put in a rule like

Code:
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
unforgotten is offline   Reply With Quote
Old 06-17-2006, 12:14 AM   PM User | #2
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
something like this...
Code:
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.
fci is offline   Reply With Quote
Old 06-17-2006, 12:47 AM   PM User | #3
unforgotten
New to the CF scene

 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
unforgotten is an unknown quantity at this point
thanks a lot man, and you said e-mailed me... How can we do this?

Last edited by unforgotten; 06-17-2006 at 12:49 AM..
unforgotten is offline   Reply With Quote
Old 06-17-2006, 01:14 AM   PM User | #4
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
Quote:
Originally Posted by unforgotten
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 ?
fci is offline   Reply With Quote
Old 06-17-2006, 01:31 AM   PM User | #5
unforgotten
New to the CF scene

 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
unforgotten is an unknown quantity at this point
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 ?
unforgotten is offline   Reply With Quote
Old 06-17-2006, 02:15 AM   PM User | #6
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
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 is offline   Reply With Quote
Old 06-17-2006, 02:20 AM   PM User | #7
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
PHP Code:
<?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);
}   

?>
fci is offline   Reply With Quote
Old 06-17-2006, 02:34 AM   PM User | #8
Curtis D
New Coder

 
Join Date: Jun 2006
Location: USA
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Curtis D is an unknown quantity at this point
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.
__________________
"Some people, when confronted with a problem, think, 'I know, I'll use regular expressions.' Now they have two problems."
--Jamie Zawinski
Curtis D is offline   Reply With Quote
Old 06-17-2006, 02:57 AM   PM User | #9
unforgotten
New to the CF scene

 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
unforgotten is an unknown quantity at this point
Quote:
Originally Posted by fci
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?
unforgotten is offline   Reply With Quote
Old 06-17-2006, 03:13 AM   PM User | #10
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
Quote:
Originally Posted by unforgotten
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.
fci is offline   Reply With Quote
Old 06-17-2006, 09:14 PM   PM User | #11
unforgotten
New to the CF scene

 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
unforgotten is an unknown quantity at this point
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
unforgotten is offline   Reply With Quote
Old 06-17-2006, 10:03 PM   PM User | #12
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
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.
fci is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:30 PM.


Advertisement
Log in to turn off these ads.