The Little Guy Posted January 5, 2010 Share Posted January 5, 2010 I am making an API, and I would like to know how I could force the user to display: "Powered by Nebala.com" currently I have this in the class: echo '<div>Powered by <a href="http://nebala.com">Nebala.com</a></div>'; With the following the user could easily remove this: <?php class Question extends Nebala{ public function __construct($key, $id){ $this->key = $key; $this->id = $id; $this->action = 'question'; echo '<div>Powered by <a href="http://nebala.com">Nebala.com</a></div>'; } public function getQuestion($q = null){ if(!is_null($q)){ $this->url = $this->setURL($q); $this->connect(); return unserialize($this->content); }else{ return false; } } } ?> I have tried putting that in the return information, on the site: <?php while($row = mysql_fetch_assoc($sql)){ $arr[] = $row; } echo <div>Powered by <a href="http://nebala.com">Nebala.com</a></div>'; echo serialize($arr); exit; ?> but that doesn't work, it just wrecks the PHP for the clients api code. how could I do this? Quote Link to comment https://forums.phpfreaks.com/topic/187205-force-display-of-text-through-api/ Share on other sites More sharing options...
trq Posted January 5, 2010 Share Posted January 5, 2010 There really is no way of doing this without the end user easily being bale to remove it. Quote Link to comment https://forums.phpfreaks.com/topic/187205-force-display-of-text-through-api/#findComment-988608 Share on other sites More sharing options...
Brandon_R Posted January 5, 2010 Share Posted January 5, 2010 You could try something like ioncube but i don't suggest it. Most people including me will NEVER use encrypted scripts. Quote Link to comment https://forums.phpfreaks.com/topic/187205-force-display-of-text-through-api/#findComment-988610 Share on other sites More sharing options...
oni-kun Posted January 5, 2010 Share Posted January 5, 2010 Obfuscation is worthless for security, but I'd obviously bet you 95% of your clients would not take the time to browse timelessly through the script and attempt to view where the code is. You can add this: (your original message) echo '<script language="Javascript">document.write(unescape(\'%3C%64%69%76%3E%50%6F%77%65%72%65%64%20%62%79%20%3C%61%20%68%72%65%66%3D%22%68%74%74%70%3A%2F%2F%6E%65%62%61%6C%61%2E%63%6F%6D%22%3E%4E%65%62%61%6C%61%2E%63%6F%6D%3C%2F%61%3E%3C%2F%64%69%76%3E\'))</script>'; Or using JS escapes, base64_decode on an already coded string etc.. They'd look inconspicuous enough for most people. It's only a brandmark. EDIT: Fixed code. Quote Link to comment https://forums.phpfreaks.com/topic/187205-force-display-of-text-through-api/#findComment-988622 Share on other sites More sharing options...
The Little Guy Posted January 5, 2010 Author Share Posted January 5, 2010 Thanks oni-kun I could give that a try and see how it works out... Quote Link to comment https://forums.phpfreaks.com/topic/187205-force-display-of-text-through-api/#findComment-988635 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.